12.6.1-3 baseline

Former-commit-id: e9e5b0e3b9 [formerly bc96eba820] [formerly 7c5306b795] [formerly 7c5306b795 [formerly 42f3513175]] [formerly d57eb02b9e [formerly 7c5306b795 [formerly 42f3513175] [formerly d57eb02b9e [formerly 2f4e12140a9b026770563eee58577b8aa2c041e1]]]]
Former-commit-id: d57eb02b9e
Former-commit-id: ba2aee0c1363c0ee5cc1308f400105a1d35f44b6 [formerly 3b70f39d074d5d11b45290eba7eec94d80be38de] [formerly 32c0464d79 [formerly 1fdc0aa237]]
Former-commit-id: 32c0464d79
Former-commit-id: 471fa3ac04
This commit is contained in:
Steve Harris 2012-06-11 16:14:48 -05:00
parent f4dbaea634
commit 9195a172de
181 changed files with 10645 additions and 7107 deletions

View file

@ -30,4 +30,6 @@
<request> <productCode>34</productCode> <pdw20>16</pdw20> </request>
<request> <productCode>34</productCode> <pdw20>32</pdw20> </request>
</cronOTR>
<cronOTR cron="0 0 * * * ?" productCode="173" randomWait="600" hoursBack="3" wmo="SDUS8" nnn="DU3"/>
<cronOTR cron="0 0 12 * * ?" productCode="173" randomWait="600" hoursBack="24" wmo="SDUS8" nnn="DU6"/>
</cronOTRConfiguration>

View file

@ -1,72 +0,0 @@
/**
* 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.edex.plugin.text.dao;
import java.util.Calendar;
import com.raytheon.edex.db.dao.DefaultPluginDao;
import com.raytheon.edex.textdb.dbapi.impl.TextDB;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.edex.database.purge.PurgeLogger;
/**
* DAO for text products
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 10, 2009 2191 rjpeter Update retention time handling.
* Aug 18, 2009 2191 rjpeter Changed to version purging.
* </pre>
*
* @author
* @version 1
*/
public class TextDao extends DefaultPluginDao {
public TextDao(String pluginName) throws PluginException {
super(pluginName);
}
@Override
public void purgeAllData() {
logger.warn("purgeAllPluginData not implemented for text. No data will be purged.");
}
protected void loadScripts() throws PluginException {
// no op
}
public void purgeExpiredData() throws PluginException {
int deletedRecords = 0;
// only do full purge every few hours since incremental purge runs every
// minute
if (Calendar.getInstance().get(Calendar.HOUR_OF_DAY) % 3 == 0) {
TextDB.purgeStdTextProducts();
}
PurgeLogger.logInfo("Purged " + deletedRecords + " items total.",
"text");
}
}

View file

@ -485,18 +485,16 @@ class Procedure (SmartScript.SmartScript):
#
# get History of last time this grid was modified
#
username = ""
updtime = None
historyList=self.getGridHistory(dbid,parm,"SFC",gridTR)
for hists in historyList:
for hist in hists:
if hist[4] not in [None, "None"]:
username=hist[4].split(':')[1]
else:
username=""
if hist[5] is not None:
updtime=hist[5].unixTime()
else:
updtime = None
if self.VU.getDebug()>=1:
t2=self.gstring1(time.gmtime(updtime))
@ -830,6 +828,7 @@ class Procedure (SmartScript.SmartScript):
# different values from getComposite after IFPS16.
#
def getBetterComposite(self,parmName, timeRange):
from com.raytheon.uf.common.dataplugin.gfe.db.objects import GFERecord_GridType as GridType
#
# Get the type, rateParm flag, and limits
# for the parameter name passed in.
@ -864,7 +863,7 @@ class Procedure (SmartScript.SmartScript):
sum=self._empty+150.0
else:
sum=self._empty
if (wxType==1):
if GridType.VECTOR.equals(wxType):
sumv=self._empty
cnt = zeros_like(self._empty)
all = ones_like(self._empty)
@ -880,7 +879,7 @@ class Procedure (SmartScript.SmartScript):
#
# Add to sums, or min/max
#
if wxType==0: # SCALAR
if GridType.SCALAR.equals(wxType): # SCALAR
bits,isc=comp
#isc=self.getGrids("ISC",parmName,"SFC",tr)
#
@ -904,14 +903,14 @@ class Procedure (SmartScript.SmartScript):
else:
sum=where(bits,sum+isc,sum)
cnt[bits] += 1
if wxType==1: # VECTOR
if GridType.VECTOR.equals(wxType): # VECTOR
bits,mag,direc=comp
#(mag,dir)=self.getGrids("ISC",parmName,"SFC",tr)
(u,v)=self.MagDirToUV(mag,direc)
sum=where(bits,sum+u,sum)
sumv=where(bits,sumv+v,sumv)
cnt[bits] += 1
if wxType==2: # WEATHER
if GridType.WEATHER.equals(wxType): # WEATHER
bits,keys,strings=comp
#(keys,strings)=self.getGrids("ISC",parmName,"SFC",tr)
#
@ -920,9 +919,9 @@ class Procedure (SmartScript.SmartScript):
#
noISC=less(cnt,0.5)
bits=greater(cnt,0.5)
if ((wxType==0)or(wxType==1)):
if GridType.SCALAR.equals(wxType) or GridType.VECTOR.equals(wxType):
cnt[less(cnt,1)] = 1
if (wxType==1):
if GridType.VECTOR.equals(wxType):
sum=where(noISC,minlimit,sum/cnt)
sumv=where(noISC,minlimit,sumv/cnt)
(mag,direc)=self.UVToMagDir(sum,sumv)

View file

@ -97,8 +97,8 @@ class Procedure (SmartScript.SmartScript):
trList = []
for g in gridInfo:
start = g.gridTime().startTime().unixTime()
end = g.gridTime().endTime().unixTime()
start = g.gridTime().startTime().unixTime() * 1000
end = g.gridTime().endTime().unixTime() * 1000
tr = TimeRange.TimeRange(start,end)
if tr.overlaps(timeRange):
trList.append(tr)

View file

@ -4367,13 +4367,13 @@ class BOIVerifyUtility(SmartScript.SmartScript):
recmatch=logical_and(recbase,recfit)
recnumbers=compress(recmatch,self.fncRecs)
recList=list(recnumbers)
recList.sort(lambda x,y: cmp(self.fncStime[x],self.fncStime[y]))
recList.sort(lambda x,y: cmp(self.fncStime[int(x)],self.fncStime[int(y)]))
else:
recmatch=logical_and(greater(self.oncEtime,stime),
less(self.oncStime,etime))
recnumbers=compress(recmatch,self.oncRecs)
recList=list(recnumbers)
recList.sort(lambda x,y: cmp(self.oncStime[x],self.oncStime[y]))
recList.sort(lambda x,y: cmp(self.oncStime[int(x)],self.oncStime[int(y)]))
self.logMsg("number of intersecting grids:%d"%len(recList),10)
if len(recList)<1:
return retVal

View file

@ -107,7 +107,7 @@
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="New Orleans, LA (KLIX)" id="raobNewOrleans_LA"
editorType="gov.noaa.nws.ncep.ui.nsharp.skewt.NsharpSkewTEditor">
<substitute key="stationId" value="72231"/>
<substitute key="stationId" value="72233"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Wash-Dulles, VA (KIAD)" id="raobWash-Dulles"

View file

@ -88,6 +88,11 @@
menuText="Elko, NV (KLKN)" id="raobElko_NV"
editorType="gov.noaa.nws.ncep.ui.nsharp.skewt.NsharpSkewTEditor">
<substitute key="stationId" value="72582"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Las Vegas, NV (KVEF)" id="raobLasVegas_NV"
editorType="gov.noaa.nws.ncep.ui.nsharp.skewt.NsharpSkewTEditor">
<substitute key="stationId" value="72388"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
menuText="Medford, OR (KMFR)" id="raobMedford_OR"

View file

@ -21,7 +21,6 @@ package com.raytheon.uf.viz.alertviz;
import java.io.PrintStream;
import java.io.StringWriter;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CopyOnWriteArrayList;
import javax.jms.ExceptionListener;
@ -89,11 +88,7 @@ public class AlertVizClient implements MessageListener {
private CopyOnWriteArrayList<IAlertVizMessageCallback> listeners;
private static int POOL_SIZE = 5;
private java.util.Queue<Marshaller> marshallers = new ConcurrentLinkedQueue<Marshaller>();
private JAXBContext jaxbContext;
private Marshaller marshaller;
private static AlertVizClient instance;
@ -139,7 +134,8 @@ public class AlertVizClient implements MessageListener {
this.consumer.setMessageListener(this);
reconnect = false;
lastReconnectTime = System.currentTimeMillis();
jaxbContext = JAXBContext.newInstance(StatusMessage.class);
JAXBContext context = JAXBContext.newInstance(StatusMessage.class);
marshaller = context.createMarshaller();
} catch (JMSException e) {
reconnect = true;
throw new AlertvizException("Unable to connect to notification", e);
@ -162,11 +158,8 @@ public class AlertVizClient implements MessageListener {
if (retryOnExceptions == false && reconnect == true) {
printToConsole(statusMessage);
} else {
Marshaller marshaller = null;
try {
StringWriter sw = new StringWriter();
marshaller = getMarshaller();
marshaller.marshal(statusMessage, sw);
ActiveMQTextMessage message = new ActiveMQTextMessage();
message.setText(sw.toString());
@ -185,20 +178,8 @@ public class AlertVizClient implements MessageListener {
} catch (Exception e) {
throw new AlertvizException("Error sending message", e);
}
if (marshaller != null && marshallers.size() < POOL_SIZE) {
marshallers.add(marshaller);
}
}
}
private Marshaller getMarshaller() throws JAXBException {
Marshaller m = marshallers.poll();
if (m == null) {
m = jaxbContext.createMarshaller();
}
return m;
}
/**
* @param statusMessage

View file

@ -188,41 +188,38 @@ public class Container implements IConfigurationChangedListener {
private boolean isShotGun(StatusMessage message) {
boolean retVal = false;
if (lastMessage != null) {
final long shotgunMessageCheckTime = this.shotgunMessageStartTime == 0 ? this.lastMessage
.getEventTime().getTime() : this.shotgunMessageStartTime;
if (this.lastMessage.getCategory().equals(message.getCategory())
&& this.lastMessage.getPriority() == message.getPriority()
&& this.lastMessage.getMessage().equals(
message.getMessage())
&& (Math.abs(message.getEventTime().getTime()
- shotgunMessageCheckTime) < SHOTGUN_MESSAGE_MILLISECOND_THRESHOLD)) {
&& Math.abs(this.lastMessage.getEventTime().getTime()
- message.getEventTime().getTime()) < SHOTGUN_MESSAGE_MILLISECOND_THRESHOLD) {
retVal = true;
++this.shotgunMessageCount;
if (this.shotgunMessageStartTime == 0) {
this.shotgunMessageStartTime = lastMessage.getEventTime()
this.shotgunMessageStartTime = message.getEventTime()
.getTime();
}
} else {
if (this.shotgunMessageCount > 1) {
if (this.shotgunMessageCount != 0) {
StringBuilder sb = new StringBuilder("Received ")
.append(this.shotgunMessageCount)
.append(" duplicate messages in ")
.append(this.lastMessage.getEventTime().getTime()
.append(message.getEventTime().getTime()
- this.shotgunMessageStartTime)
.append(" milliseconds. For message: ")
.append(this.lastMessage.getCategory()).append(":")
.append(this.lastMessage.getSourceKey())
.append(" ").append(this.lastMessage.getMessage());
this.shotgunMessageStartTime = 0;
this.shotgunMessageCount = 0;
StatusMessage sm = new StatusMessage(
this.lastMessage.getSourceKey(), "GDN_ADMIN",
this.lastMessage.getPriority(),
this.lastMessage.getPlugin(), sb.toString(), null);
sm.setEventTime(SimulatedTime.getSystemTime().getTime());
logInternal(sm);
messageReceived(sm);
}
this.shotgunMessageStartTime = 0;
this.shotgunMessageCount = 1;
}
}

View file

@ -41,7 +41,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 24, 2007 njensen Initial creation
*
* May 21, 2012 DR 14833 gzhang Adding a getter for StyleRuleset
* </pre>
*
* @author njensen
@ -150,4 +150,23 @@ public class StyleManager {
}
/**2012-05-21
* DR 14833: FFMP uses this getter to find the color
* map if a user modified ffmpImageryStlyeRules.xml
* incorrectly.
*
* @param st: StyleType
* @return: StyleRuleset related to the StyleType
*/
public StyleRuleset getStyleRuleSet(StyleType st){
synchronized(st){
if( ! rules.containsKey(st)){
loadRules(st);
}
}
return rules.get(st);
}
}

View file

@ -35,4 +35,17 @@
scriptLibrary="BaseRequest">
</scriptTemplate>
</extension>
<!-- for making CWAT available on Localization Perspective in CAVE: 2012-05-14 from DHladky -->
<extension
point="com.raytheon.uf.viz.localization.localizationpath">
<path
application="D2D"
localizationType="common_static"
name="CWAT"
recursive="true"
value="cwat">
</path>
</extension>
</plugin>

View file

@ -178,8 +178,8 @@ public abstract class D2DNSharpResourceData extends
stnInfo.setRangestarttime(fcstTime);
}
if (coordinate != null) {
stnInfo.setLongitude((float) coordinate.x);
stnInfo.setLatitude((float) coordinate.y);
stnInfo.setLongitude(coordinate.x);
stnInfo.setLatitude(coordinate.y);
}
if (pointName != null) {
stnInfo.setStnDisplayInfo(pointName + " "

View file

@ -108,6 +108,7 @@
<styleRule>
<paramLevelMatches>
<parameter>Wind</parameter>
<parameter>Gust</parameter>
</paramLevelMatches>
<arrowStyle>
<displayUnits>kts</displayUnits>

View file

@ -32,6 +32,7 @@ import javax.measure.unit.Unit;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.DirectPosition2D;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.grib.GribModel;
@ -87,6 +88,8 @@ public class GribCSAdapter extends AbstractCrossSectionAdapter<GribRecord> {
private Unit<?> unit;
private CoordinateReferenceSystem crs;
/*
* (non-Javadoc)
*
@ -250,21 +253,6 @@ public class GribCSAdapter extends AbstractCrossSectionAdapter<GribRecord> {
if (xVal <= -9999) {
continue;
}
// these cases handle rotating a vector to be oriented
// towards the north pole rather than the up direction of a
// grid.
if (c == 0) {
speed = xVal;
} else if (c == 1) {
direction = xVal - 180
+ MapUtil.rotation(coordinates[i], area);
xVal = (float) direction;
direction = Math.toRadians(direction);
} else if (c == 2) {
xVal = (float) (-speed * Math.sin(direction));
} else if (c == 3) {
xVal = (float) (-speed * Math.cos(direction));
}
dataLists.get(c).add(new XYData(xVal, yVal));
}
}
@ -292,6 +280,7 @@ public class GribCSAdapter extends AbstractCrossSectionAdapter<GribRecord> {
super.addRecord(pdo);
if (pdo != null && pdo instanceof GribRecord) {
unit = ((GribRecord) pdo).getModelInfo().getParameterUnitObject();
crs = ((GribRecord) pdo).getSpatialObject().getCrs();
}
yRecords.remove(pdo.getDataTime());
}
@ -355,4 +344,12 @@ public class GribCSAdapter extends AbstractCrossSectionAdapter<GribRecord> {
}
}
@Override
public CoordinateReferenceSystem getDataCoordinateReferenceSystem() {
if (crs == null) {
return super.getDataCoordinateReferenceSystem();
}
return crs;
}
}

View file

@ -1,27 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DerivedParameter unit="kn" name="Wind Gust" abbreviation="Gust" xmlns:ns2="group">
<DerivedParameter unit="m/s" name="Wind Gust" abbreviation="Gust" xmlns:ns2="group">
<Method name="Vector" levels="Surface" models="obs">
<Field level="Station" abbreviation="windGust"/>
<Field abbreviation="WD"/>
<ConstantField value="1.0"/>
</Method>
<Method name="Vector">
<Field abbreviation="uGust"/>
<Field abbreviation="vGust"/>
<Field abbreviation="uGust" unit="m/s"/>
<Field abbreviation="vGust" unit="m/s"/>
</Method>
<Method name="Vector">
<Field abbreviation="WGS"/>
<Field abbreviation="WGS" unit="m/s"/>
<Field abbreviation="WGD"/>
<ConstantField value="1.0"/>
</Method>
<Method name="Vector">
<Field abbreviation="WGS"/>
<Field abbreviation="WGS" unit="m/s"/>
<Field abbreviation="WD"/>
<ConstantField value="1.0"/>
</Method>
<Method name="Vector">
<Field abbreviation="uW"/>
<Field abbreviation="vW"/>
<Field abbreviation="WGS"/>
<Field abbreviation="WGS" unit="m/s"/>
</Method>
</DerivedParameter>

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
* ------------ ---------- ----------- --------------------------
* Dec. 3, 2009 3424 zhao Initial creation.
* Jan 25, 2010 4281 wkwock/Zhao Added history-table-row-data related modules
* May 23, 2012 14410 zhao Modified getCellTypeForBlizWarn and getCellTypeForHsnowWarn modules
*
* </pre>
*
@ -751,22 +752,38 @@ public final class TableUtil {
String presentWx = report.getPresentWx();
CellType windSpeed = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_WIND_SPEED.getXmlKey(), report.getWindSpeed());
CellType windSpeed = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_BLIZZ_WIND_SPEED.getXmlKey(), report.getWindSpeed());
CellType peakWind = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_PEAK_WIND.getXmlKey(), report.getMaxWindSpeed());
CellType peakWind = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_BLIZZ_PEAK_WIND.getXmlKey(), report.getMaxWindSpeed());
CellType windGust = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_GUST_SPEED.getXmlKey(), report.getWindGust());
CellType windGust = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_BLIZZ_GUST_SPEED.getXmlKey(), report.getWindGust());
CellType visibility = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey(), report.getVisibility());
CellType visibility = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_BLIZZ_VIS.getXmlKey(), report.getVisibility());
if ( presentWx.contains("SN") || presentWx.contains("BLSN") ) {
// snow or blowing snow observed
if ( windSpeed.equals(CellType.R) || peakWind.equals(CellType.R) || windGust.equals(CellType.R) || visibility.equals(CellType.R) ) {
if ( windSpeed.equals(CellType.R) || peakWind.equals(CellType.R) || windGust.equals(CellType.R) ) {
if ( visibility.equals(CellType.R) ) {
type = CellType.R;
} else if ( windSpeed.equals(CellType.Y) || peakWind.equals(CellType.Y) || windGust.equals(CellType.Y) || visibility.equals(CellType.Y) ) {
} else {
type = CellType.Y;
} else if ( windSpeed.equals(CellType.G) || peakWind.equals(CellType.G) || windGust.equals(CellType.G) || visibility.equals(CellType.G) ) {
}
} else if ( windSpeed.equals(CellType.Y) || peakWind.equals(CellType.Y) || windGust.equals(CellType.Y) ) {
type = CellType.Y;
} else if ( windSpeed.equals(CellType.G) || peakWind.equals(CellType.G) || windGust.equals(CellType.G) ) {
if ( visibility.equals(CellType.R) || visibility.equals(CellType.Y) ) {
type = CellType.Y;
} else if ( visibility.equals(CellType.G) ) {
type = CellType.G;
} else {
type = CellType.NotAvailable;
}
} else {
if ( visibility.equals(CellType.R) || visibility.equals(CellType.Y) ) {
type = CellType.Y;
} else {
type = CellType.NotAvailable;
}
}
} else {
// snow or blowing snow not observed
@ -837,11 +854,11 @@ public final class TableUtil {
CellType type = CellType.NotAvailable; // default, assuming no observation available
CellType snowDepth = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey(), report.getSnowDepth());
CellType snowDepth = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_HSW_SNOW_DEPTH.getXmlKey(), report.getSnowDepth());
CellType snincrHourly = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey(), report.getSnincrHourly());
CellType snincrHourly = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_HSW_SNINCR_HOURLY.getXmlKey(), report.getSnincrHourly());
CellType snincrTotal = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey(), report.getSnincrTotal());
CellType snincrTotal = tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone, MonitorConfigConstants.SnowDisplay.SNOW_DISP_PROD_HSW_SNINCR_TOTAL.getXmlKey(), report.getSnincrTotal());
if ( snowDepth.equals(CellType.R) || snincrHourly.equals(CellType.R) || snincrTotal.equals(CellType.R) ) {
type = CellType.R;

View file

@ -173,13 +173,13 @@ public class TearOffMenuListener implements IMenuListener2 {
longest = check;
}
}
byte[] bytes = new byte[longest.length() * 2];
Arrays.fill(bytes, (byte) '|');
// String filled = new String(bytes);
String filled = "- - - - - - TEAR-OFF : "
+ menu.getParentItem().getText() + " - - - - - -";
// String filled = "-" * bytes.length
int length = longest.length();
if (length == 0) {
length = 10;
}
byte[] bytes = new byte[length];
Arrays.fill(bytes, (byte) '-');
String filled = new String(bytes);
new ActionContributionItem(new TearOffAction(filled, manager, menu))
.fill(menu, index);
}

View file

@ -19,11 +19,19 @@
**/
package com.raytheon.uf.viz.xy.crosssection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.geotools.geometry.DirectPosition2D;
import org.geotools.referencing.GeodeticCalculator;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.common.geospatial.MapUtil;
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.xy.crosssection.CrossSectionRotationsFile.RotationMode;
import com.raytheon.viz.core.slice.request.HeightScale;
import com.vividsolutions.jts.geom.Coordinate;
@ -46,10 +54,13 @@ import com.vividsolutions.jts.geom.Coordinate;
*/
public class CrossSectionRotation {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(CrossSectionRotation.class);
public static List<float[]> rotateVector(String parameter,
List<Coordinate> linePoints, List<float[]> floatData,
int lineLengthInMeters, HeightScale heightScale) {
int lineLengthInMeters, HeightScale heightScale,
CoordinateReferenceSystem dataCRS) {
if (floatData.size() < 4) {
return floatData;
}
@ -73,7 +84,7 @@ public class CrossSectionRotation {
int height = result.length / width;
float[] cosRot = new float[width];
float[] sinRot = new float[width];
getRotationCoefs(linePoints, cosRot, sinRot);
getRotationCoefs(linePoints, cosRot, sinRot, dataCRS);
switch (mode) {
case VR_NO_ROTATION: {
return floatData;
@ -166,18 +177,31 @@ public class CrossSectionRotation {
}
private static void getRotationCoefs(List<Coordinate> linePoints,
float[] cosRot, float[] sinRot) {
for (int i = 0; i < linePoints.size() - 1; i++) {
Coordinate c1 = linePoints.get(i);
Coordinate c2 = linePoints.get(i + 1);
float[] cosRot, float[] sinRot, CoordinateReferenceSystem crs) {
List<Coordinate> convertedPoints = new ArrayList<Coordinate>();
try {
MathTransform transform = MapUtil.getTransformFromLatLon(crs);
for (Coordinate c : linePoints) {
DirectPosition2D dp = new DirectPosition2D(c.x, c.y);
transform.transform(dp, dp);
convertedPoints.add(new Coordinate(dp.x, dp.y));
}
} catch (Throwable e) {
statusHandler.handle(Priority.VERBOSE,
"Error reprojecting points for cross section rotation", e);
convertedPoints = linePoints;
}
for (int i = 0; i < convertedPoints.size() - 1; i++) {
Coordinate c1 = convertedPoints.get(i);
Coordinate c2 = convertedPoints.get(i + 1);
double x = c2.x - c1.x;
double y = c2.y - c1.y;
double m = Math.sqrt(x * x + y * y);
cosRot[i] = (float) (x / m);
sinRot[i] = (float) (y / m);
}
cosRot[cosRot.length - 1] = Float.NaN;
sinRot[sinRot.length - 1] = Float.NaN;
}
}

View file

@ -29,8 +29,10 @@ import java.util.List;
import javax.measure.unit.Unit;
import org.geotools.coverage.grid.GridGeometry2D;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionDescriptor;
@ -116,4 +118,8 @@ public abstract class AbstractCrossSectionAdapter<T extends PluginDataObject>
});
}
public CoordinateReferenceSystem getDataCoordinateReferenceSystem() {
return MapUtil.LATLON_PROJECTION;
}
}

View file

@ -258,7 +258,8 @@ public abstract class AbstractCrossSectionResource extends
.getExtent().getMaxX(), 0)[0];
floatData = CrossSectionRotation.rotateVector(
resourceData.getParameter(), Arrays.asList(lineData),
floatData, lineLengthInMeters, descriptor.getHeightScale());
floatData, lineLengthInMeters, descriptor.getHeightScale(),
adapter.getDataCoordinateReferenceSystem());
if (adapter.getUnit().isCompatible(getUnit())) {
UnitConverter converter = adapter.getUnit().getConverterTo(
getUnit());

View file

@ -13,9 +13,9 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.viz.texteditor,
org.geotools,
com.raytheon.edex.plugin.ccfp,
com.raytheon.edex.plugin.taf,
com.raytheon.uf.common.pointdata;bundle-version="1.11.7",
com.raytheon.uf.common.serialization,
com.raytheon.edex.plugin.taf;bundle-version="1.12.1174",
com.raytheon.viz.pointdata;bundle-version="1.11.7",
com.raytheon.uf.common.python;bundle-version="1.11.7",
org.jep;bundle-version="1.0.0",
@ -23,7 +23,8 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.dataplugin.binlightning;bundle-version="1.0.0",
com.raytheon.uf.common.site,
com.raytheon.viz.ui.personalities.awips;bundle-version="1.12.1174",
com.raytheon.uf.viz.application;bundle-version="1.0.0"
com.raytheon.uf.viz.application;bundle-version="1.0.0",
com.raytheon.uf.common.tafqueue;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Export-Package: com.raytheon.viz.aviation,

View file

@ -49,8 +49,6 @@ import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.viz.aviation.monitor.TafUtil;
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
import com.raytheon.viz.aviation.utility.TafMessageData;
import com.raytheon.viz.aviation.utility.TransmissionQueue;
import com.raytheon.viz.avnconfig.ITafSiteConfig;
import com.raytheon.viz.avnconfig.TafSiteConfigFactory;
import com.raytheon.viz.avnconfig.TafSiteData;
@ -509,44 +507,47 @@ public class LoaderDialog extends CaveSWTDialog {
sb.append(TafUtil.LINE_BREAK);
sb.append(TafUtil.LINE_BREAK);
// Always retrieve pending TAF from the queue
TafMessageData pendingTaf = TransmissionQueue.getInstance()
.getPendingBySiteId(ident);
// TafQueueRecord pendingTaf = TransmissionQueue.getInstance()
// .getPendingBySiteId(ident);
// TODO get this working with database
Object pendingTaf = null;
if (pendingTaf != null) {
// Only ask one time if pending TAF(s) should be removed.
if (removePendingTags == false) {
String tafType = "Routine";
String pbbb = pendingTaf.getBBB();
if (pbbb.startsWith("A")) {
tafType = "Amended";
} else if (pbbb.startsWith("C")) {
tafType = "Correctetd";
} else if (pbbb.startsWith("R")) {
tafType = "Delayed";
}
String msg = tafType
+ " TAF(s) in pending queue will be removed!\n"
+ "Is this what you want to do? If not, press \'No\' and re-check\n"
+ "TAF forecast type for editing.";
MessageBox msgBox = new MessageBox(getParent(), SWT.YES
| SWT.NO);
msgBox.setMessage(msg);
msgBox.setText("Pending TAF");
if (SWT.YES == msgBox.open()) {
removePendingTags = true;
} else {
return;
}
}
String text = pendingTaf.getTafText();
sb.append(text);
TransmissionQueue.getInstance().remove(pendingTaf.getInfo());
if (i == 0) {
wmoId = pendingTaf.getWmoId();
siteId = pendingTaf.getSiteId();
bbb = pendingTaf.getBBB();
}
// if (removePendingTags == false) {
// String tafType = "Routine";
// String pbbb = pendingTaf.getBBB();
// if (pbbb.startsWith("A")) {
// tafType = "Amended";
// } else if (pbbb.startsWith("C")) {
// tafType = "Correctetd";
// } else if (pbbb.startsWith("R")) {
// tafType = "Delayed";
// }
// String msg = tafType
// + " TAF(s) in pending queue will be removed!\n"
// +
// "Is this what you want to do? If not, press \'No\' and re-check\n"
// + "TAF forecast type for editing.";
// MessageBox msgBox = new MessageBox(getParent(), SWT.YES
// | SWT.NO);
// msgBox.setMessage(msg);
// msgBox.setText("Pending TAF");
// if (SWT.YES == msgBox.open()) {
// removePendingTags = true;
// } else {
// return;
// }
// }
//
// String text = pendingTaf.getTafText();
// sb.append(text);
// TransmissionQueue.getInstance().remove(pendingTaf.getInfo());
//
// if (i == 0) {
// wmoId = pendingTaf.getWmoId();
// siteId = pendingTaf.getSiteId();
// bbb = pendingTaf.getBBB();
// }
} else {
TafRecord taf = null;
if (order.equals("template") == false) {

View file

@ -42,11 +42,15 @@ import org.eclipse.swt.widgets.Spinner;
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.common.tafqueue.ServerResponse;
import com.raytheon.uf.common.tafqueue.TafQueueRecord;
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.viz.aviation.AviationDialog;
import com.raytheon.viz.aviation.editor.EditorTafTabComp;
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
import com.raytheon.viz.aviation.utility.TafMessageData;
import com.raytheon.viz.aviation.utility.TransmissionQueue;
import com.raytheon.viz.aviation.xml.ForecasterConfig;
import com.raytheon.viz.avnconfig.IStatusSettable;
import com.raytheon.viz.avnconfig.ITafSiteConfig;
@ -321,19 +325,37 @@ public class SendDialog extends CaveSWTDialog {
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
TransmissionQueue queue = TransmissionQueue.getInstance();
sendAction();
}
});
gd = new GridData(80, SWT.DEFAULT);
Button cancelBtn = new Button(buttonComp, SWT.PUSH);
configMgr.setDefaultFontAndColors(cancelBtn, "Cancel", gd);
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
shell.dispose();
}
});
}
@SuppressWarnings("unchecked")
private void sendAction() {
TafQueueRequest request = new TafQueueRequest();
request.setType(Type.CREATE);
// Forecaster ID
int forecasterId = forecasterArray.get(
personList.getSelectionIndex()).getId();
// Transmit time
long now = System.currentTimeMillis();
int forecasterId = forecasterArray.get(personList.getSelectionIndex())
.getId();
// long now = System.currentTimeMillis();
Calendar xmitTime = Calendar.getInstance();
xmitTime.setTimeInMillis(now);
// xmitTime.setTimeInMillis(now);
xmitTime.setTimeZone(TimeZone.getTimeZone("GMT"));
xmitTime.set(Calendar.HOUR_OF_DAY, hourSpnr.getSelection());
xmitTime.set(Calendar.MINUTE, minuteSpnr.getSelection());
xmitTime.set(Calendar.SECOND, secondSpnr.getSelection());
// request.setXmitTime(xmitTime.getTime());
String xmitTimestamp = String.format(TIMESTAMP_FORMAT,
xmitTime.get(Calendar.DAY_OF_MONTH),
xmitTime.get(Calendar.HOUR_OF_DAY),
@ -341,10 +363,14 @@ public class SendDialog extends CaveSWTDialog {
// BBB
String in = tabComp.getTextEditorControl().getText();
String bbb = tabComp.getBBB();
// request.addArgument("bbb", bbb);
// WMO ID
String siteWmoId = tabComp.getWmoId();
// request.addArgument("wmoid", siteWmoId);
// WMO Site
String siteNode = tabComp.getWmoSiteId();
// String siteNode = tabComp.getWmoSiteId();
String siteNode = null;
java.util.List<String> stationIds = new ArrayList<String>();
ArrayList<String> tafs = new ArrayList<String>();
ArrayList<String> updatedTafs = new ArrayList<String>();
@ -372,40 +398,59 @@ public class SendDialog extends CaveSWTDialog {
}
}
boolean tafsQeueued = true;
java.util.List<TafQueueRecord> records = new ArrayList<TafQueueRecord>();
for (String tafText : tafs) {
String fourLetterId = tafText.substring(
tafText.indexOf('\n') + 1,
String fourLetterId = tafText.substring(tafText.indexOf('\n') + 1,
tafText.indexOf(' ', tafText.indexOf('\n')));
// Site ID
String siteId = fourLetterId.substring(1);
// Type
String type = tafText.substring(0, 3);
// String type = tafText.substring(0, 3);
// Update Header Time to transmission time.
tafText = TIMESTAMP_PATTERN.matcher(tafText).replaceFirst(
xmitTimestamp);
updatedTafs.add(tafText);
try {
ITafSiteConfig config = TafSiteConfigFactory
.getInstance();
ITafSiteConfig config = TafSiteConfigFactory.getInstance();
TafSiteData siteData = config.getSite(fourLetterId);
siteWmoId = siteData.wmo.split(" ")[0];
siteNode = siteData.wmo.split(" ")[1];
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM,
"Error reading site configuration for "
+ siteId
"Error reading site configuration for " + siteId
+ ", attempting to proceed anyway", e);
}
// Enqueue TAF for transmission
queue.enqueue(new TafMessageData(forecasterId, xmitTime,
tafText, bbb, siteId, siteWmoId, siteNode, type,
xmitTime));
TafQueueRecord record = new TafQueueRecord(forecasterId,
xmitTime.getTime(), tafText, bbb, siteId, siteWmoId,
siteNode, xmitTime.getTime());
records.add(record);
}
tabComp.setTafSent(true);
try {
// Enqueue TAFs for transmission
System.out.println("Before - " + request.toString());
request.setRecords(records);
ServerResponse<String> response = (ServerResponse<String>) ThriftClient
.sendRequest(request);
System.out.println(response.toString());
if (response.isError()) {
statusHandler.handle(Priority.PROBLEM, response.toString());
tafsQeueued = false;
}
} catch (VizException e) {
// TODO Auto-generated catch block. Please revise as
// appropriate.
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
msgStatComp.setMessageText(e.getMessage(), shell.getDisplay()
.getSystemColor(SWT.COLOR_RED).getRGB());
}
if (tafsQeueued) {
// Update the TAF display with transmission time.
StringBuilder sb = new StringBuilder();
String prefix = "";
@ -415,21 +460,11 @@ public class SendDialog extends CaveSWTDialog {
}
tabComp.getTextEditorControl().setText(sb.toString());
msgStatComp.setMessageText(
"The TAF has been sent to the transmission queue.",
shell.getDisplay().getSystemColor(SWT.COLOR_GREEN)
"The TAF has been sent to the transmission queue.", shell
.getDisplay().getSystemColor(SWT.COLOR_GREEN)
.getRGB());
shell.dispose();
}
});
gd = new GridData(80, SWT.DEFAULT);
Button cancelBtn = new Button(buttonComp, SWT.PUSH);
configMgr.setDefaultFontAndColors(cancelBtn, "Cancel", gd);
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
tabComp.setTafSent(tafsQeueued);
shell.dispose();
}
});
}
}

View file

@ -1,130 +0,0 @@
/**
* 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.aviation.utility;
import java.util.Calendar;
import java.util.TimeZone;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 27, 2009 avarani Initial creation
*
* </pre>
*
* @author avarani
* @version 1.0
*/
public class TafMessageData implements Comparable<TafMessageData> {
private int forecasterId;
private Calendar xmitTime;
private String tafText;
private String bbb;
private String siteId;
private String siteWmoId;
private String siteNode;
private String type;
private Calendar headerTime;
public TafMessageData(int forecasterId, Calendar xmitTime, String tafText,
String bbb, String siteId, String siteWmoId, String siteNode,
String type, Calendar headerTime) {
this.forecasterId = forecasterId;
this.xmitTime = xmitTime;
this.tafText = tafText;
this.bbb = bbb;
this.siteId = siteId;
this.siteWmoId = siteWmoId;
this.siteNode = siteNode;
this.type = type;
this.headerTime = headerTime;
}
public String getInfo() {
return String
.format(
"%1$03d-%7$s%8$s%5$s-%6$s-%7$s-%2$ty%2$tm%2$td%2$tH%2$tM-%4$s-%9$d",
forecasterId, headerTime, tafText, bbb, siteId,
siteWmoId, siteNode, type,
(xmitTime.getTimeInMillis() / 1000));
}
// Update the xmitTime to the current time.
public void updateTime() {
xmitTime = Calendar.getInstance();
xmitTime.setTimeInMillis(System.currentTimeMillis());
xmitTime.setTimeZone(TimeZone.getTimeZone("GMT"));
}
public long getXmitTime() {
return xmitTime.getTimeInMillis();
}
public String getTafText() {
return tafText;
}
/*
* (non-Javadoc)
*
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
@Override
public int compareTo(TafMessageData o) {
if (o.xmitTime.before(this.xmitTime)) {
return -1;
} else if (this.xmitTime.before(o.xmitTime)) {
return 1;
} else {
return 0;
}
}
public String getSiteId() {
return siteId;
}
public String getWmoId() {
return siteWmoId;
}
public String getBBB() {
return bbb;
}
public void setSiteId(String siteId) {
this.siteId = siteId;
}
}

View file

@ -1,191 +0,0 @@
/**
* 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.aviation.utility;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Calendar;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import com.raytheon.uf.common.dissemination.OUPRequest;
import com.raytheon.uf.common.dissemination.OUPResponse;
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
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.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
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;
/**
* This job handles the actual transmission of the TAF.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 31, 2009 avarani Initial creation
*
* </pre>
*
* @author avarani
* @version 1.0
*/
public class TafTransmissionJob extends Job {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(TafTransmissionJob.class);
/**
* The TafMessageData to be sent out by this job.
*/
private TafMessageData data;
/**
* @param name
*/
public TafTransmissionJob(String name, TafMessageData data) {
super(name);
this.data = data;
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
* IProgressMonitor)
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
OfficialUserProduct oup = new OfficialUserProduct();
String name = data.getInfo();
String[] words = name.split("-");
String awips = words[1];
String tstamp = words[4].substring(4);
String bbb = words[5].substring(words[5].length() - 3);
oup.setFilename(name);
oup.setProductText(data.getTafText());
oup.setAwipsWanPil(awips);
oup.setUserDateTimeStamp(tstamp);
oup.setSource("AvnFPS");
if (!bbb.equals("___")) {
oup.setWmoType(bbb);
}
OUPRequest req = new OUPRequest();
req.setProduct(oup);
OUPResponse resp;
boolean success = false;
String additionalInfo = "";
try {
resp = (OUPResponse) ThriftClient.sendRequest(req);
success = resp.isSendLocalSuccess();
if (resp.hasFailure()) {
// check which kind of failure
Priority p = Priority.EVENTA;
if (!resp.isAttempted()) {
// if was never attempted to send or store even locally
p = Priority.CRITICAL;
additionalInfo = " ERROR local store never attempted";
} else if (!resp.isSendLocalSuccess()) {
// if send/store locally failed
p = Priority.CRITICAL;
additionalInfo = " ERROR store locally failed";
} else if (!resp.isSendWANSuccess()) {
// if send to WAN failed
if (resp.getNeedAcknowledgment()) {
// if ack was needed, if it never sent then no ack
// was received
p = Priority.CRITICAL;
additionalInfo = " ERROR send to WAN failed and no acknowledgment received";
} else {
// if no ack was needed
p = Priority.EVENTA;
additionalInfo = " WARNING send to WAN failed";
}
} else if (resp.getNeedAcknowledgment()
&& !resp.isAcknowledged()) {
// if sent but not acknowledged when acknowledgment is
// needed
p = Priority.CRITICAL;
additionalInfo = " ERROR no acknowledgment received";
}
statusHandler.handle(p, resp.getMessage());
}
} catch (VizException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
TransmissionQueue queue = TransmissionQueue.getInstance();
queue.updateMessageStatus(data, success);
String logMessage;
if (success) {
logMessage = "SUCCESS " + data.getInfo() + additionalInfo;
} else {
logMessage = "FAILURE " + data.getInfo() + additionalInfo;
}
String tempTafPath = "aviation/transmissionLogs/";
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext context = pm.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE);
String path = pm.getFile(context, tempTafPath).getAbsolutePath();
File tmp = new File(path);
if (!(tmp.exists())) {
tmp.mkdirs();
}
String fname = "AviationTransmissionLog.txt";
LocalizationFile lFile = pm.getLocalizationFile(context, tempTafPath
+ fname);
File file = lFile.getFile();
try {
FileWriter writer = new FileWriter(file, true);
BufferedWriter output = new BufferedWriter(writer);
Calendar c = Calendar.getInstance();
String year = Integer.toString(c.get(Calendar.YEAR));
String month = Integer.toString(c.get(Calendar.MONTH) + 1);
String day = Integer.toString(c.get(Calendar.DAY_OF_MONTH));
output.write(year + month + day + "," + logMessage + "\n");
output.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return Status.OK_STATUS;
}
}

View file

@ -1,349 +0,0 @@
/**
* 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.aviation.utility;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
/**
* The TransmissionQueue class manages the transmission queue for AvnFPS. It
* stores a list of TAFs that are pending and sent as well as a list of TAFs
* that failed to transmit.
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 27, 2009 avarani Initial creation
*
* </pre>
*
* @author avarani
* @version 1.0
*/
public class TransmissionQueue {
private static TransmissionQueue xmitQueueInstance = null;
private HashMap<TafMessageData, TafTransmissionJob> pendingList;
private ArrayList<TafMessageData> sentList;
private ArrayList<TafMessageData> errorList;
/**
* private constructor
*/
private TransmissionQueue() {
pendingList = new HashMap<TafMessageData, TafTransmissionJob>();
sentList = new ArrayList<TafMessageData>();
errorList = new ArrayList<TafMessageData>();
}
/**
* @return a reference to the TransmissionQueue instance
*/
public static synchronized TransmissionQueue getInstance() {
if (xmitQueueInstance == null) {
xmitQueueInstance = new TransmissionQueue();
}
return xmitQueueInstance;
}
/**
* Add a TafMessageData object to the pending queue.
*
* @param data
* TafMessageData object
*/
public void enqueue(TafMessageData data) {
long now = System.currentTimeMillis();
long xmitTime = data.getXmitTime();
long delay = xmitTime - now;
if (delay < 0) {
delay = 0;
}
TafTransmissionJob job = new TafTransmissionJob(
"AvnFPS TAF transmission job", data);
job.setSystem(true);
job.schedule(delay);
pendingList.put(data, job);
}
/**
* Prohibit cloning
*/
@Override
public Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException();
}
/**
* Retrieve a list of the pending TAFs.
*
* @return an ArrayList containing the info strings of the pending TAFs.
*/
public ArrayList<String> getPending() {
ArrayList<String> out = new ArrayList<String>();
Set<TafMessageData> keys = pendingList.keySet();
for (TafMessageData data : keys) {
out.add(data.getInfo());
}
return out;
}
public TafMessageData getPendingBySiteId(String siteId) {
Set<TafMessageData> keys = pendingList.keySet();
TafMessageData found = null;
for (TafMessageData data : keys) {
if (data.getSiteId().equals(siteId)) {
found = data;
break;
}
}
return found;
}
/**
* Retrieve a list of the TAFs that have been successfuly sent.
*
* @return an ArrayLsit containing the info strings of the TAFs that have
* been successfuly sent.
*/
public ArrayList<String> getSent() {
ArrayList<String> out = new ArrayList<String>();
for (TafMessageData data : sentList) {
out.add(data.getInfo());
}
return out;
}
/**
* Retrieve a list of the TAFs that failed to send.
*
* @return an ArrayList containing the info string of the TAFs that failed
* to send.
*/
public ArrayList<String> getErrors() {
ArrayList<String> out = new ArrayList<String>();
for (TafMessageData data : errorList) {
out.add(data.getInfo());
}
return out;
}
/**
* Retrieve the text of a specified TAF in the pending list
*
* @param tafInfo
* TAF info string for the desired TAF
* @return The text of the TAF
*/
public String getPendingText(String tafInfo) {
Set<TafMessageData> keys = pendingList.keySet();
String text = null;
for (TafMessageData data : keys) {
if (tafInfo.equals(data.getInfo())) {
text = data.getTafText();
break;
}
}
return text;
}
/**
* Retrieve the text of a specified TAF in the sent list
*
* @param tafInfo
* TAF info string for the desired TAF
* @return The text of the TAF
*/
public String getSentText(String tafInfo) {
String text = null;
for (TafMessageData data : sentList) {
if (tafInfo.equals(data.getInfo())) {
text = data.getTafText();
break;
}
}
return text;
}
/**
* Retrieve the text of a specified TAF in the error list
*
* @param tafInfo
* TAF info string for the desired TAF
* @return The text of the TAF
*/
public String getErrorText(String tafInfo) {
String text = null;
for (TafMessageData data : errorList) {
if (tafInfo.equals(data.getInfo())) {
text = data.getTafText();
break;
}
}
return text;
}
/**
* Retrive a log of all transmission attempts for the current day.
*
* @return an ArrayList containing the status of all transmission attempts
* for the current day.
*/
public ArrayList<String> getLog() {
ArrayList<String> logList = new ArrayList<String>();
try {
String tempTafPath = "aviation/transmissionLogs/";
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext context = pm.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE);
String fname = "AviationTransmissionLog.txt";
LocalizationFile lFile = pm.getLocalizationFile(context,
tempTafPath + fname);
File file = lFile.getFile();
FileReader reader = new FileReader(file);
BufferedReader input = new BufferedReader(reader);
String line = null;
while ((line = input.readLine()) != null) {
logList.add(line);
}
} catch (IOException e) {
logList.add("Error, log file not found.");
}
return logList;
}
/**
* Remove a TAF from the list of pending TAFs.
*
* @param tafInfo
* the TafMessageData info string for the TAF to be removed from
* the pending queue.
*/
public void remove(String tafInfo) {
Set<TafMessageData> keys = pendingList.keySet();
for (TafMessageData data : keys) {
if (tafInfo.equals(data.getInfo())) {
TafTransmissionJob job = pendingList.remove(data);
job.cancel();
break;
}
}
}
/**
* Attempt to retransmit a TAF.
*
* @param tafInfo
* the TafMessageData info string for the TAF to retransmit.
* @param bad
* flag that determines which list to look in for the TAF to
* retransmit. True indicates the TAF should come from the error
* list, false indicates the sent list.
*/
public void retransmit(String tafInfo, boolean bad) {
TafMessageData retrans = null;
ArrayList<TafMessageData> list = null;
// If bad flag is set, check the bad list for the taf to retransmit,
// otherwise check the sent list.
if (bad) {
list = errorList;
} else {
list = sentList;
}
for (TafMessageData data : list) {
if (tafInfo.equals(data.getInfo())) {
list.remove(data);
retrans = data;
break;
}
}
retrans.updateTime();
enqueue(retrans);
}
/**
* Update the status of a pending TAF by moving it either to the sent or the
* error list. This method should only be called by the TafTransmissionJob's
* run method.
*
* @param taf
* the TafMessageData object to update
* @param success
* boolean
*/
public void updateMessageStatus(TafMessageData taf, boolean success) {
String tafInfo = taf.getInfo();
Set<TafMessageData> keys = pendingList.keySet();
for (TafMessageData data : keys) {
if (tafInfo.equals(data.getInfo())) {
pendingList.remove(data);
break;
}
}
if (success) {
sentList.add(taf);
} else {
errorList.add(taf);
}
}
}

View file

@ -21,8 +21,6 @@ package com.raytheon.viz.aviation.utility;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.HashMap;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
@ -35,14 +33,21 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.tafqueue.ServerResponse;
import com.raytheon.uf.common.tafqueue.TafQueueRecord.TafQueueState;
import com.raytheon.uf.common.tafqueue.TafQueueRequest;
import com.raytheon.uf.common.tafqueue.TafQueueRequest.Type;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.requests.ThriftClient;
import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
import com.raytheon.viz.avnconfig.HelpUsageDlg;
import com.raytheon.viz.avnconfig.IStatusSettable;
import com.raytheon.viz.avnconfig.MessageStatusComp;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.widgets.ToggleSelectList;
/**
* TransmissionQueueDlg class displays the Transmission Queue dialog for AvnFPS.
@ -52,6 +57,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 28 FEB 2008 938 lvenable Initial creation
* 14 MAY 2012 14715 rferrel Use EDEX to perform requests.
*
* </pre>
*
@ -60,6 +66,26 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
*
*/
public class TransmissionQueueDlg extends CaveSWTDialog {
private static String helpText = "This dialog is used to manage transmission and transmission log files.\n\n"
+ "The top area manages the forecast files written by the forecast editor.\n"
+ "The 'Files' scrolled list window lists files in one of 'pending', 'sent'\n"
+ "and 'bad' directories. The time is when the file was written. The file\n"
+ "name is \n"
+ " xxx-CCCCNNNXXX-yymmddHHMM-BBB\n"
+ "where xxx is the forecaster number. The transmission program \n"
+ "avnxmitserv uses NNN to determine the transmission window for regular\n"
+ "forecasts.\n\n"
+ "The bottom area is used to view transmission log files. There is one\n"
+ "file for each day of the week. By default, log files for the current day\n"
+ "are shown.\n\nButtons:\n"
+ " Refresh: refreshes both the directory list and log file windows.\n"
+ " View: allows to view selected transmission file(s)\n"
+ " Remove: deletes transmission files\n"
+ " Retransmit: forces the transmission program to send selected files.\n"
+ " If the file is in the 'bad' or 'sent' directory, it is \n"
+ " moved back to 'pending'. The transmission time (the last\n"
+ " part of the file name) is updated to the current time.\n"
+ " Help: displays this window";
/**
* Pending radio button.
@ -76,10 +102,17 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
*/
private Button badRdo;
/**
* Button to retransmit selected sent or bad records.
*/
private Button retransmitBtn;
/**
* Transmission list control.
*/
private List transList;
private ToggleSelectList transList;
private java.util.List<String> transListId;
/**
* Transmission day control.
@ -100,15 +133,20 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
"Wednesday", "Thursday", "Friday", "Saturday" };
/**
* Selected day of the week.
* The Selected day of the week Calendar day of the week value.
*/
private String selectedDay;
private int selectedDay;
/**
* Main composite.
*/
private Composite mainComp;
/**
* Message status composite.
*/
private IStatusSettable msgStatComp;
/**
* Constructor.
*
@ -136,6 +174,8 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
GridLayout gl = new GridLayout(1, true);
mainComp = new Composite(shell, SWT.NONE);
mainComp.setLayout(gl);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
mainComp.setLayoutData(gd);
// Initialize all of the controls and layouts
initializeComponents();
@ -145,8 +185,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
* Initialize the components on the display.
*/
private void initializeComponents() {
int dayInt = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
selectedDay = dayOfWeek[dayInt - 1];
selectedDay = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
ResourceConfigMgr configMgr = ResourceConfigMgr.getInstance();
configMgr.setDefaultColors(mainComp);
@ -198,6 +237,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
@Override
public void widgetSelected(SelectionEvent event) {
populateData();
updateDayTransList();
}
});
@ -209,25 +249,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
viewBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
int idx = transList.getSelectionIndex();
if (idx >= 0) {
String tafInfo = transList.getItem(idx);
TransmissionQueue queue = TransmissionQueue.getInstance();
String tafText = null;
if (pendingRdo.getSelection()) {
tafText = queue.getPendingText(tafInfo);
} else if (sentRdo.getSelection()) {
tafText = queue.getSentText(tafInfo);
} else if (badRdo.getSelection()) {
tafText = queue.getErrorText(tafInfo);
}
TransmissionViewerDlg tvd = new TransmissionViewerDlg(
shell, tafText, tafInfo);
tvd.open();
}
viewTafs();
}
});
@ -235,42 +257,33 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
Button removeBtn = new Button(buttonComp, SWT.PUSH);
removeBtn.setLayoutData(gd);
removeBtn.setText("Remove");
removeBtn.setToolTipText("Delete selected forecast");
configMgr.setDefaultFontAndColors(removeBtn);
removeBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
TransmissionQueue queue = TransmissionQueue.getInstance();
if (pendingRdo.getSelection()) {
MessageBox questionMB = new MessageBox(shell,
SWT.ICON_WARNING | SWT.YES | SWT.NO);
MessageBox questionMB = new MessageBox(shell, SWT.ICON_WARNING
| SWT.YES | SWT.NO);
questionMB.setText("Remove Pending Transmission");
questionMB
.setMessage("Are you sure you want to remove this pending transmission from the queue?");
int result = questionMB.open();
if (result == SWT.YES) {
queue.remove(transList.getItem(transList
.getSelectionIndex()));
populateData();
}
removeSelected();
}
}
});
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Button retransmitBtn = new Button(buttonComp, SWT.PUSH);
retransmitBtn = new Button(buttonComp, SWT.PUSH);
retransmitBtn.setLayoutData(gd);
retransmitBtn.setText("Retransmit");
configMgr.setDefaultFontAndColors(retransmitBtn);
retransmitBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
TransmissionQueue queue = TransmissionQueue.getInstance();
queue.retransmit(
transList.getItem(transList.getSelectionIndex()),
badRdo.getSelection());
populateData();
retransmit();
}
});
@ -282,15 +295,136 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
helpBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
String text = "This dialog is used to manage transmission and to transmission log files.\n\nThe top area is to manage forecast files written by the forecast editor.\nThe 'Files' scrolled list window lists files in one of 'pending', 'sent'\nand 'bad' directories. The time is when the file was written. The file\nname is \n xxx-CCCCNNNXXX-yymmddHHMM-BBB\nwhere xxx is the forecaster number. The transmission program \navnxmitserv uses NNN to determine the transmission window for regular \nforecasts.\n\nThe bottom area is used to view transmission log files. There is one \nfile for each day of the week. By default, log files for the current day \nare shown.\n\nButtons:\n Refresh: refreshes both the directory list and log file windows.\n View: allows to view selected transmission file(s)\n Remove: deletes transmission files\n Retransmit: forces the transmission program to send selected files.\n If the file is in the 'bad' or 'sent' directory, it is \n moved back to 'pending'. The transmission time (the last\n part of the file name) is updated to the current time.\n Help: displays this window";
String description = "Help";
HelpUsageDlg usageDlg = new HelpUsageDlg(shell, description,
text);
helpText);
usageDlg.open();
}
});
}
/**
* Action method to request the selected records be immediately transmitted.
*/
@SuppressWarnings("unchecked")
private void retransmit() {
int[] indices = transList.getSelectionIndices();
if (indices.length == 0) {
return;
}
TafQueueRequest request = new TafQueueRequest();
request.setType(Type.RETRANSMIT);
request.setState(getDisplayState());
java.util.List<String> idList = new ArrayList<String>();
for (int index : indices) {
idList.add(transListId.get(index));
}
request.addArgument("idlist", idList);
try {
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
.sendRequest(request);
int color = SWT.COLOR_GREEN;
if (response.isError()) {
color = SWT.COLOR_RED;
}
msgStatComp.setMessageText(response.getMessages().get(0),
getParent().getDisplay().getSystemColor(color).getRGB());
populateTransList(response.getPayload());
} catch (VizException e) {
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
.getSystemColor(SWT.COLOR_RED).getRGB());
}
}
/**
* Determine the state of the records being viewed.
*
* @return state
*/
private TafQueueState getDisplayState() {
TafQueueState state = TafQueueState.PENDING;
if (sentRdo.getSelection()) {
state = TafQueueState.SENT;
} else if (badRdo.getSelection()) {
state = TafQueueState.BAD;
}
return state;
}
/**
* This brings up the TAF viewer and populates it with the selected records.
*/
@SuppressWarnings("unchecked")
private void viewTafs() {
int[] indices = transList.getSelectionIndices();
if (indices.length == 0) {
return;
}
java.util.List<String> idList = new ArrayList<String>();
for (int index : indices) {
idList.add(transListId.get(index));
}
TafQueueRequest request = new TafQueueRequest();
request.setType(Type.GET_TAFS);
request.addArgument("idlist", idList);
ServerResponse<String> response = null;
try {
response = (ServerResponse<String>) ThriftClient
.sendRequest(request);
String tafText = response.getPayload();
String tafInfo = null;
if (indices.length == 1) {
tafInfo = transList.getItem(indices[0]);
} else {
tafInfo = "Viewing multiple forecasts";
}
TransmissionViewerDlg tvd = new TransmissionViewerDlg(shell,
tafText, tafInfo);
tvd.open();
} catch (VizException e) {
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
.getSystemColor(SWT.COLOR_RED).getRGB());
}
}
/**
* Action to perform to remove the selected records from being displayed.
* This updates the database and repopulates the list.
*/
@SuppressWarnings("unchecked")
private void removeSelected() {
TafQueueRequest request = new TafQueueRequest();
request.setType(Type.REMOVE_SELECTED);
request.setState(getDisplayState());
java.util.List<String> idList = new ArrayList<String>();
for (int index : transList.getSelectionIndices()) {
idList.add(transListId.get(index));
}
request.addArgument("idlist", idList);
try {
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
.sendRequest(request);
populateTransList(response.getPayload());
int color = SWT.COLOR_GREEN;
if (response.isError()) {
color = SWT.COLOR_RED;
}
msgStatComp.setMessageText(response.getMessages().get(0),
getParent().getDisplay().getSystemColor(color).getRGB());
} catch (VizException e) {
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
.getSystemColor(SWT.COLOR_RED).getRGB());
}
}
/**
* Create the file transmission controls.
*/
@ -316,36 +450,36 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
directoryGroup.setLayoutData(gd);
configMgr.setDefaultFontAndColors(directoryGroup);
SelectionAdapter adapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
Button button = (Button) event.getSource();
if (button.getSelection()) {
retransmitBtn.setEnabled((Boolean) button.getData());
populateData();
}
}
};
gd = new GridData(85, SWT.DEFAULT);
pendingRdo = new Button(directoryGroup, SWT.RADIO);
configMgr.setDefaultFontAndColors(pendingRdo, "pending", gd);
pendingRdo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
populateData();
}
});
pendingRdo.addSelectionListener(adapter);
pendingRdo.setData(false);
gd = new GridData(85, SWT.DEFAULT);
sentRdo = new Button(directoryGroup, SWT.RADIO);
sentRdo.setSelection(true);
retransmitBtn.setEnabled(true);
configMgr.setDefaultFontAndColors(sentRdo, "sent", gd);
sentRdo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
populateData();
}
});
sentRdo.addSelectionListener(adapter);
sentRdo.setData(true);
gd = new GridData(85, SWT.DEFAULT);
badRdo = new Button(directoryGroup, SWT.RADIO);
configMgr.setDefaultFontAndColors(badRdo, "bad", gd);
badRdo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
populateData();
}
});
badRdo.addSelectionListener(adapter);
badRdo.setData(true);
// -------------------------------------------------
// Create right side label and transmission list
@ -367,10 +501,11 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
gd.widthHint = 600;
gd.heightHint = 150;
transList = new List(transListComp, SWT.BORDER | SWT.SINGLE
transList = new ToggleSelectList(transListComp, SWT.BORDER | SWT.MULTI
| SWT.V_SCROLL | SWT.H_SCROLL);
transList.setLayoutData(gd);
configMgr.setListBoxFont(transList);
transListId = new ArrayList<String>();
}
/**
@ -384,22 +519,29 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
dayOfWeekComp.setLayoutData(gd);
configMgr.setDefaultColors(dayOfWeekComp);
for (String day : dayOfWeek) {
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
final Button dayRdo = new Button(dayOfWeekComp, SWT.RADIO);
dayRdo.setText(day);
dayRdo.setData(day);
dayRdo.setLayoutData(gd);
configMgr.setDefaultFontAndColors(dayRdo);
dayRdo.addSelectionListener(new SelectionAdapter() {
SelectionAdapter adapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
selectedDay = (String) dayRdo.getData();
Button dayRdo = (Button) event.getSource();
if (dayRdo.getSelection()) {
selectedDay = (Integer) dayRdo.getData();
updateDayTransList();
}
});
}
};
if (day.compareTo(selectedDay) == 0) {
for (int index = 0; index < dayOfWeek.length; ++index) {
String day = dayOfWeek[index];
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
Button dayRdo = new Button(dayOfWeekComp, SWT.RADIO);
dayRdo.setText(day);
// The Calendar.SUNDAY, MONDAY, etc.
dayRdo.setData(index + 1);
dayRdo.setLayoutData(gd);
configMgr.setDefaultFontAndColors(dayRdo);
dayRdo.addSelectionListener(adapter);
if (day.compareTo(dayOfWeek[selectedDay - 1]) == 0) {
dayRdo.setSelection(true);
}
}
@ -418,7 +560,7 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
dayLbl = new Label(transAttemptComp, SWT.CENTER);
dayLbl.setText(selectedDay);
dayLbl.setText(dayOfWeek[selectedDay - 1]);
dayLbl.setLayoutData(gd);
configMgr.setDefaultFontAndColors(dayLbl);
@ -438,76 +580,98 @@ public class TransmissionQueueDlg extends CaveSWTDialog {
* Create the message status composite.
*/
private void createMessageControl(ResourceConfigMgr configMgr) {
new MessageStatusComp(mainComp, configMgr.getDefaultBackgroundRGB(),
msgStatComp = new MessageStatusComp(mainComp,
configMgr.getDefaultBackgroundRGB(),
configMgr.getMsgBarBackground());
}
/**
* Update the transmission day list.
*/
@SuppressWarnings("unchecked")
private void updateDayTransList() {
TransmissionQueue queue = TransmissionQueue.getInstance();
ArrayList<String> display = null;
Calendar c = Calendar.getInstance();
HashMap<String, String> calendar = new HashMap<String, String>();
String year = Integer.toString(c.get(Calendar.YEAR));
String month = Integer.toString(c.get(Calendar.MONTH) + 1);
String day = Integer.toString(c.get(Calendar.DATE));
String date = year + month + day;
calendar.put(dayOfWeek[c.get(Calendar.DAY_OF_WEEK) - 1], date);
TafQueueRequest request = new TafQueueRequest();
request.setType(Type.GET_LOG);
for (int i = 1; i < 7; i++) {
c.add(Calendar.DATE, -1);
year = Integer.toString(c.get(Calendar.YEAR));
month = Integer.toString(c.get(Calendar.MONTH) + 1);
day = Integer.toString(c.get(Calendar.DATE));
date = year + month + day;
calendar.put(dayOfWeek[c.get(Calendar.DAY_OF_WEEK) - 1], date);
dayLbl.setText(dayOfWeek[selectedDay - 1]);
StringBuilder txt = new StringBuilder();
// Adjust currentDay to start of the day
Calendar currentDay = Calendar.getInstance();
currentDay.set(Calendar.HOUR_OF_DAY, 0);
currentDay.set(Calendar.MINUTE, 0);
currentDay.set(Calendar.SECOND, 0);
currentDay.set(Calendar.MILLISECOND, 0);
// Adjust selected day to current or previous week.
Calendar selectedDayStart = Calendar.getInstance();
selectedDayStart.setTime(currentDay.getTime());
selectedDayStart.set(Calendar.DAY_OF_WEEK, selectedDay);
if (currentDay.compareTo(selectedDayStart) < 0) {
selectedDayStart.add(Calendar.DAY_OF_MONTH, -7);
}
request.addArgument("starttime", selectedDayStart.getTime());
dayLbl.setText(selectedDay);
System.out.println(selectedDay);
// Determine start of next day.
Calendar selectedDayEnd = Calendar.getInstance();
selectedDayEnd.setTime(selectedDayStart.getTime());
selectedDayEnd.add(Calendar.DAY_OF_MONTH, 1);
request.addArgument("endtime", selectedDayEnd.getTime());
display = queue.getLog();
String txt = "";
if (display.size() == 1 && display.get(0).startsWith("Error")) {
txt = display.get(0);
} else {
for (String str : display) {
String today = calendar.get(selectedDay);
String[] bits = str.split(",");
if (today.equals(bits[0])) {
txt += bits[1] + "\n";
try {
ServerResponse<String> response = (ServerResponse<String>) ThriftClient
.sendRequest(request);
txt.append(response.getPayload());
transStText.setText(txt.toString());
} catch (VizException e) {
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
.getSystemColor(SWT.COLOR_RED).getRGB());
}
}
}
transStText.setText(txt);
}
/**
* Populate the top text area with a list of TAF messages that have been
* successfuly sent, are pending transmission, or have failed.
* successfully sent, are pending transmission, or have failed.
*/
@SuppressWarnings("unchecked")
private void populateData() {
TransmissionQueue queue = TransmissionQueue.getInstance();
transList.removeAll();
ArrayList<String> display = null;
transListId.clear();
if (pendingRdo.getSelection()) {
display = queue.getPending();
} else if (sentRdo.getSelection()) {
display = queue.getSent();
} else if (badRdo.getSelection()) {
display = queue.getErrors();
try {
TafQueueRequest request = new TafQueueRequest();
request.setType(Type.GET_LIST);
request.setState(getDisplayState());
ServerResponse<java.util.List<String>> response = (ServerResponse<java.util.List<String>>) ThriftClient
.sendRequest(request);
if (response.isError()) {
msgStatComp.setMessageText(response.getMessages().get(0),
getParent().getDisplay().getSystemColor(SWT.COLOR_RED)
.getRGB());
}
populateTransList(response.getPayload());
} catch (VizException e) {
msgStatComp.setMessageText(e.getMessage(), getParent().getDisplay()
.getSystemColor(SWT.COLOR_RED).getRGB());
}
}
Collections.sort(display);
for (String str : display) {
transList.add(str);
/**
* This takes the payload list of strings and splits them up into the
* display list and a hidden list of record ids. Assumes each entry is of
* the format: record_id,record_info.
*
* @param payload
*/
private void populateTransList(java.util.List<String> payload) {
transList.removeAll();
transListId.clear();
for (String record : payload) {
String[] bits = record.split(",");
transListId.add(bits[0]);
transList.add(bits[1]);
}
}
}

View file

@ -79,6 +79,8 @@ public class TransmissionViewerDlg extends CaveSWTDialog {
protected void initializeComponents(Shell shell) {
mainComp = new Composite(shell, SWT.NONE);
mainComp.setLayout(new GridLayout(1, false));
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
mainComp.setLayoutData(gd);
// Initialize all of the controls and layouts
initializeComponents();

View file

@ -130,8 +130,8 @@ public class HelpUsageDlg extends CaveSWTDialog {
*/
private void createHelpTextControl() {
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = 300;
gd.widthHint = 475;
gd.heightHint = 420;
gd.widthHint = 600;
helpStTxt = new StyledText(shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
| SWT.H_SCROLL);
helpStTxt.setWordWrap(false);

View file

@ -50,4 +50,11 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.tafqueue"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>

View file

@ -559,7 +559,8 @@ public class TimeOfArrivalLayer extends AbstractStormTrackResource {
*/
public void reopenDialog() {
// Open the dialog
if (dialog == null || dialog.getShell().isDisposed()) {
if (dialog == null || dialog.getShell() == null
|| dialog.getShell().isDisposed()) {
VizApp.runAsync(new Runnable() {
@Override

View file

@ -0,0 +1,195 @@
/**
* 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.gfe.dialogs;
import java.util.HashMap;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 16, 2012 jdynina Initial creation
*
* </pre>
*
* @author jdynina
* @version 1.0
*/
public class ButtonEntryDialog extends Dialog {
/**
* Dialog shell.
*/
private Shell shell;
/**
* The display control.
*/
private Display display;
private String dialogTitle;
private HashMap<String,String[]> inputMap;
private String inputText = "";
private String[] selections;
public ButtonEntryDialog(Shell parentShell, String title, HashMap<String,String[]> map) {
super(parentShell, 0);
this.dialogTitle = title;
this.inputMap = map;
}
public String open() {
Shell parent = getParent();
display = parent.getDisplay();
shell = new Shell(parent, SWT.DIALOG_TRIM);
if (dialogTitle != null) {
shell.setText(dialogTitle);
}
// Create the main layout for the shell.
GridLayout mainLayout = new GridLayout(1, false);
shell.setLayout(mainLayout);
// Initialize data and all of the controls and layouts
initializeComponents();
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
return inputText;
}
private void initializeComponents() {
createInputControls();
createBottomButtons();
}
private void createInputControls() {
Composite controlComp = new Composite(shell, SWT.NONE);
GridLayout gl = new GridLayout(inputMap.size(), false);
controlComp.setLayout(gl);
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, true);
controlComp.setLayoutData(gd);
selections = new String[inputMap.size()];
Listener listener = new Listener () {
public void handleEvent(Event event) {
Button button = (Button)event.widget;
if (!button.getSelection()) return;
int i = 0;
for (String s : inputMap.keySet()) {
for (String value : inputMap.get(s)) {
if ((value == button.getText()) &&
(selections[i] != button.getText()))
selections[i] = button.getText();
}
i++;
}
}
};
int i = 0;
for (String s : inputMap.keySet()) {
int j = 0;
Group group = new Group(controlComp, SWT.SHADOW_IN);
group.setText(s);
group.setLayout(new RowLayout(SWT.VERTICAL));
for (String value : inputMap.get(s)) {
Button button = new Button(group, SWT.RADIO);
button.setText(value);
if (j == 0) button.setSelection(true);
if (j == 0) selections[i] = value;
button.addListener(SWT.Selection, listener);
j++;
}
i++;
}
}
private void createBottomButtons() {
Composite buttonComp = new Composite(shell, SWT.NONE);
GridLayout gl = new GridLayout(2, false);
buttonComp.setLayout(gl);
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
buttonComp.setLayoutData(gd);
gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
gd.widthHint = 80;
Button okBtn = new Button(buttonComp, SWT.PUSH);
okBtn.setText("OK");
okBtn.setLayoutData(gd);
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
for (String selection : selections) {
inputText = (inputText + selection + " ");
}
shell.dispose();
}
});
gd = new GridData(SWT.LEFT, SWT.DEFAULT, true, false);
gd.widthHint = 80;
Button cancelBtn = new Button(buttonComp, SWT.PUSH);
cancelBtn.setText("Cancel");
cancelBtn.setLayoutData(gd);
cancelBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
inputText = null;
shell.dispose();
}
});
}
}

View file

@ -132,6 +132,8 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
for (int idx : idxs) {
try {
Boolean run = true;
String name = scriptsList.getItem(idx);
String cmd = scriptDict.get(name);
@ -183,14 +185,42 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
// {startTime}
// {endTime}
// The user is prompted for a list of radiobutton values.
// The user is prompted for a list of radio button values.
// {entryButtons: <name of variable>: <list of values separated
// by
// commas>}
// int entryIdx = cmd.indexOf("{entryButtons:");
// if (entryIdx >= 0) {
// int endEntryIdx = cmd.indexOf("}", entryIdx);
// }
int count = cmd.split("entryButtons").length - 1;
if (count > 0) {
int entryIdx = 0, i = 0, start = 0;
HashMap<String,String[]> map = new HashMap<String,String[]>();
while (entryIdx != -1) {
entryIdx = cmd.indexOf("{entryButtons:",entryIdx);
if (entryIdx >= 0) {
int endEntryIdx = cmd.indexOf("}", entryIdx);
String[] entry = cmd.substring(entryIdx + 1, endEntryIdx)
.split(":");
map.put(entry[1],entry[2].split(","));
if (i == 0) start = entryIdx;
entryIdx=endEntryIdx+1;
i++;
}
if (entryIdx == -1) {
ButtonEntryDialog buttonDlg = new ButtonEntryDialog(
this.getShell(), name, map);
String returnMsg = buttonDlg.open();
if (returnMsg == null) {
// cancel pressed
run = false;
continue;
}
start = start - 3;
cmd = cmd.substring(0, start) + returnMsg;
}
}
}
// The user is prompted for a list of check box values.
// {entryChecks: <name of variable>: <list of values separated
@ -216,6 +246,7 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
String returnMsg = entryDlg.open();
if (returnMsg == null) {
// cancel pressed
run = false;
continue;
}
configFile = returnMsg;
@ -224,7 +255,7 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
+ cmd.substring(endEntryIdx + 1);
}
TaskManager.getInstance().createScriptTask(name, cmd);
if (run) TaskManager.getInstance().createScriptTask(name, cmd);
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),

View file

@ -54,6 +54,8 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
* 19 JAN 2010 4085 ryu Save and load draft.
* 1 DEC 2010 6130 ryu Show output log when formatter fails.
* 2 SEP 2011 10654 gzhou Delete running/pending task and close tab.
* 23 MAY 2012 14859 ryu Select VTEC formatting in practice mode
* based on VTECMessageType setting.
*
* </pre>
*
@ -426,11 +428,31 @@ public class ProductAreaComp extends Composite implements
formattingCbo.add("Normal: X-Vtec");
formattingCbo.add("Test: NoVTEC");
formattingCbo.add("Test: T-Vtec");
int pracType = 0;
if (practiceMode) {
formattingCbo.select(1);
String pil = (String) textProductMgr.getProductDefinition(productName)
.get("pil");
if (pil != null) {
String vtecMode = textProductMgr.getVtecMessageType(
pil.substring(0, 3));
if (vtecMode == null) {
pracType = 0;
} else if ("O".equals(vtecMode)) {
pracType = 1;
} else if ("E".equals(vtecMode)) {
pracType = 2;
} else if ("X".equals(vtecMode)) {
pracType = 3;
} else if ("T".equals(vtecMode)) {
pracType = 5;
} else {
formattingCbo.select(0);
pracType = 4;
}
}
}
formattingCbo.select(pracType);
formattingCbo.setVisible(practiceMode);
// create the progress bar

View file

@ -68,10 +68,6 @@ public class GFEEditAreaMenu extends CompoundContributionItem {
*/
@Override
protected IContributionItem[] getContributionItems() {
// TODO, fix this code to not show extra items
// boolean needTear = com.raytheon.uf.viz.core.Activator.getDefault()
// .getPreferenceStore().getBoolean("tearoffmenus");
MenuManager menuMgr = new MenuManager("Edit Areas");
DataManager dm = DataManager.getCurrentInstance();
if (dm != null) {
@ -81,25 +77,13 @@ public class GFEEditAreaMenu extends CompoundContributionItem {
int menuLength = GFEPreference
.getIntPreference("MaxMenuItemsBeforeCascade");
menuLength = (menuLength > 1) ? menuLength : 30;
// if (addTear && needTear) {
// menuMgr.addMenuListener(new TearOffMenuListener(menuMgr));
// addTear = false;
// }
for (String group : groupList) {
MenuManager mm = new MenuManager(group);
menuMgr.add(mm);
// if (needTear) {
// menuMgr.addMenuListener(new TearOffMenuListener(mm));
// addTear = true;
// }
mm.addMenuListener(new TearOffMenuListener(mm));
int count = 0;
for (String ref : refMgr.getGroupData(group)) {
// if (needTear && addTear) {
// mm.addMenuListener(new TearOffMenuListener(mm));
// addTear = false;
// }
Map<String, String> parms = new HashMap<String, String>();
parms.put("name", ref);
mm.add(new CommandContributionItem(
@ -112,10 +96,6 @@ public class GFEEditAreaMenu extends CompoundContributionItem {
MenuManager mm1 = new MenuManager("More");
mm.add(mm1);
mm = mm1;
// if (needTear && addTear) {
// mm.addMenuListener(new TearOffMenuListener(mm));
// addTear = false;
// }
}
}

View file

@ -38,7 +38,8 @@ import com.raytheon.viz.hydrocommon.HydroConstants;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 31, 2009 mpduff Initial creation
* Mar 31, 2009 mpduff Initial creation.
* May 17, 2012 558 mpduff Adding null checks to RPFparams objects.
*
* </pre>
*
@ -117,9 +118,11 @@ public class SetTimeVals {
// "No records in RpfParams table, using defaults\n");
} else {
rpfPtr = results.get(0);
if (rpfPtr != null && rpfPtr.getId() != null) {
dbObshrs = rpfPtr.getId().getObshrs();
dbFcsthrs = rpfPtr.getId().getFcsthrs();
}
}
/* get the token value */
String basisHrs = appsDefaults.getToken("basis_hours_filter");

View file

@ -38,6 +38,7 @@ import com.raytheon.viz.hydrocommon.datamanager.HydroDataManager;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 2, 2009 2259 mpduff Initial creation
* May 14, 2012 14965 wkwock Fix crash in query for data
*
* </pre>
*
@ -198,8 +199,7 @@ public class FloodReportDataManager extends HydroDataManager {
ArrayList<Object[]> rs = runQuery("select fs from riverstat where lid = '"
+ lid + "'");
if ((rs != null) && (rs.size() > 0)) {
if ((rs != null) && (rs.size() > 0) && rs.get(0)[0]!=null) {
fs = (Double) rs.get(0)[0];
}

View file

@ -75,6 +75,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Dec 3, 2010 4952 lbousaidi
* Jan 13, 2011 5415 lbousaidi added a dialog when
* "Compute Latest data" button runs
* May 14, 2012 14965 wkwock fix crash in query for data
*
* </pre>
*
@ -984,21 +985,21 @@ public class FloodReportDlg extends CaveSWTDialog {
}
/* now output the info for the event */
String stream = dman.getRiver(lid);
String basin = dman.getRiverBasin(lid);
String stream = dman.getRiver(data.getLid());
String basin = dman.getRiverBasin(data.getLid());
if (!basin.equals(prevBasin)) {
if (basin!=null && prevBasin!=null && !basin.equals(prevBasin)) {
buffer.append("\n\nBASIN: " + basin + "\n");
}
if (!stream.equals(prevStream)) {
if (stream!=null && prevStream!=null && !stream.equals(prevStream)) {
buffer.append("\n RIVER: " + stream + "\n");
}
if (!data.getLid().equals(prevLid)) {
buffer
.append("\n " + data.getLongName() + ", "
+ dman.getState(lid) + " (" + data.getLid()
+ dman.getState(data.getLid()) + " (" + data.getLid()
+ ")\n");
}

View file

@ -130,7 +130,7 @@
mnemonic="T">
</command>
<command
commandId="com.raytheon.viz.ui.actions.notImplemented2"
commandId="com.raytheon.viz.mpe.ui.actions.transmitRFCBias"
label="Transmit RFC Bias"
mnemonic="a">
</command>
@ -891,7 +891,7 @@
name="NOT Implemented">
</command>
<command
id="com.raytheon.viz.ui.actions.notImplemented2"
id="com.raytheon.viz.mpe.ui.actions.transmitRFCBias"
name="Transmit RFC Bias">
</command>
<command
@ -1106,6 +1106,23 @@
definitionId="com.raytheon.viz.inMPEActionSet">
</reference>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.mpe.ui.actions.TransmitRFCBias"
commandId="com.raytheon.viz.mpe.ui.actions.transmitRFCBias">
<enabledWhen>
<with
variable="com.raytheon.viz.mpe.ui.transmitRFCBias">
<equals value="true">
</equals>
</with>
</enabledWhen>
<activeWhen>
<reference
definitionId="com.raytheon.viz.inMPEActionSet">
</reference>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.mpe.ui.actions.RecenterAction"
@ -1644,6 +1661,14 @@
priorityLevel="activeWorkbenchWindow">
</variable>
</sourceProvider>
<sourceProvider
provider="com.raytheon.viz.mpe.ui.TransmitRFCBiasProvider">
<variable
name="com.raytheon.viz.mpe.ui.transmitRFCBias"
priorityLevel="activeWorkbenchWindow">
</variable>
</sourceProvider>
</extension>
<extension point="org.eclipse.ui.themes">
<themeElementCategory

View file

@ -0,0 +1,116 @@
/**
* 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.mpe.ui;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.ui.AbstractSourceProvider;
import org.eclipse.ui.ISources;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.services.ISourceProviderService;
import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.viz.ui.VizWorkbenchManager;
/**
* Source Provider for best estimate menu enablement
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 09, 2012 wkwock Initial creation
*
* </pre>
*
* @author wkwock
* @version 1.0
*/
public class TransmitRFCBiasProvider extends AbstractSourceProvider {
private static final String[] MENU_ENABLED = new String[] { "com.raytheon.viz.mpe.ui.transmitRFCBias" };
private Map<String, Boolean> sourceMap = new HashMap<String, Boolean>();
private boolean enabled = false;
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.ISourceProvider#dispose()
*/
@Override
public void dispose() {
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.ISourceProvider#getCurrentState()
*/
@Override
public Map<String, Boolean> getCurrentState() {
sourceMap.put(MENU_ENABLED[0], enabled);
return sourceMap;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
*/
@Override
public String[] getProvidedSourceNames() {
return MENU_ENABLED;
}
public static void setEnabled(boolean enabled) {
AppsDefaults appsDefaults = AppsDefaults.getInstance();
boolean transmitFlag=appsDefaults.getBoolean("mpe_transmit_bias", false);
IWorkbenchWindow window = VizWorkbenchManager.getInstance()
.getCurrentWindow();
if (window != null) {
ISourceProviderService service = (ISourceProviderService) window
.getService(ISourceProviderService.class);
TransmitRFCBiasProvider provider = (TransmitRFCBiasProvider) service
.getSourceProvider(MENU_ENABLED[0]);
Map<String, Boolean> sourceMap = new HashMap<String, Boolean>();
sourceMap.put(MENU_ENABLED[0], transmitFlag?enabled:false);
provider.fireSourceChanged(ISources.ACTIVE_WORKBENCH_WINDOW,
sourceMap);
}
}
public static TransmitRFCBiasProvider getProvider(ExecutionEvent event) {
ISourceProviderService service = (ISourceProviderService) HandlerUtil
.getActiveWorkbenchWindow(event).getService(
ISourceProviderService.class);
return (TransmitRFCBiasProvider) service
.getSourceProvider(MENU_ENABLED[0]);
}
}

View file

@ -33,6 +33,7 @@ import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.viz.mpe.ui.MPEDisplayManager;
import com.raytheon.viz.mpe.ui.TransmitRFCBiasProvider;
import com.raytheon.viz.mpe.ui.dialogs.ChooseDataPeriodDialog;
import com.raytheon.viz.mpe.ui.rsc.XmrgResource;
import com.raytheon.viz.ui.EditorUtil;
@ -105,7 +106,7 @@ public class ChooseHour extends AbstractHandler {
xmrgRsc.updateXmrg(false);
}
}
TransmitRFCBiasProvider.setEnabled(true);
return null;
}
}

View file

@ -26,6 +26,7 @@ import org.eclipse.core.commands.ExecutionException;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.viz.mpe.ui.MPEDisplayManager;
import com.raytheon.viz.mpe.ui.TransmitRFCBiasProvider;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
@ -77,6 +78,8 @@ public class ClearMPEData extends AbstractHandler {
displayMgr.clearMPEData();
displayMgr.setDisplayedResource(null);
}
TransmitRFCBiasProvider.setEnabled(false);
return null;
}

View file

@ -0,0 +1,55 @@
package com.raytheon.viz.mpe.ui.actions;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.IEditorPart;
import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.viz.mpe.ui.MPEDisplayManager;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
public class TransmitRFCBias extends AbstractHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorPart editor = EditorUtil.getActiveEditor();
IDisplayPane pane = null;
if (editor instanceof IMultiPaneEditor) {
IMultiPaneEditor multiPane = (IMultiPaneEditor) editor;
if (multiPane.getNumberofPanes() > 1
&& multiPane.displayedPaneCount() > 1) {
pane = multiPane.getSelectedPane(IMultiPaneEditor.LOAD_ACTION);
} else {
pane = ((IDisplayPaneContainer) editor).getDisplayPanes()[0];
}
}
MPEDisplayManager dm = MPEDisplayManager.getInstance(pane);
Date currentDate = dm.getCurrentDate();
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHH");
String transmitDate = formatter.format(currentDate);
AppsDefaults appsDefaults = AppsDefaults.getInstance();
String scriptDir = appsDefaults.getToken("pproc_bin");
String scriptName = "transmit_rfc_bias";
ProcessBuilder pb = new ProcessBuilder(scriptDir + "/" + scriptName,
transmitDate);
try {
pb.start();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}

View file

@ -701,7 +701,8 @@ public class PlotModelFactory2 {
return null;
}
public synchronized String getStationMessage(PlotData stationData, String dataURI) {
public synchronized String getStationMessage(PlotData stationData,
String dataURI) {
PlotPythonScript script = null;
StringBuilder sampleMessage = new StringBuilder();
try {
@ -879,6 +880,7 @@ public class PlotModelFactory2 {
if (element.winds.barbElement != null) {
element.winds.barbNode.setNodeValue(" ");
}
renderArrow(windGust, windDir, speedUnit, element);
return false;
}
return true;

View file

@ -21,6 +21,7 @@ package com.raytheon.viz.texteditor.alarmalert.dialogs;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.image.WritableRaster;
import java.io.File;
import org.eclipse.swt.SWT;
@ -35,6 +36,7 @@ import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@ -50,7 +52,9 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.viz.texteditor.alarmalert.util.AlarmBeepJob;
import com.raytheon.viz.texteditor.alarmalert.util.FlashBellJob;
/**
* TODO Add Description
@ -64,6 +68,7 @@ import com.raytheon.viz.texteditor.alarmalert.util.AlarmBeepJob;
* Aug 16, 2010 2187 cjeanbap Fixed a NullPointerException
* Dec 23, 2010 7375 cjeanbap Force dialog ON TOP of over Dialog/Windows.
* 03/19/2012 D. Friedman Fix alarming. Disable runloop in open().
* May 18, 2012 jkorman Added flashing alarm image.
* </pre>
*
* @author mnash
@ -72,6 +77,10 @@ import com.raytheon.viz.texteditor.alarmalert.util.AlarmBeepJob;
public class AlarmAlertBell extends Dialog implements MouseMoveListener,
MouseListener {
// delay in milliseconds - flash every 1 1/2 seconds
private static final int FLASH_DELAY = 1500;
private Shell parentShell;
private Shell alarmShell;
@ -82,6 +91,18 @@ public class AlarmAlertBell extends Dialog implements MouseMoveListener,
private String bellPath;
private FlashBellJob flasher;
private Image norm_bell;
private Image revs_bell;
private boolean invert = false;
private boolean active = false;
private Button button;
private AlarmBeepJob abj = null;
private static int locationX = -1;
@ -177,17 +198,13 @@ public class AlarmAlertBell extends Dialog implements MouseMoveListener,
}
public Object open(boolean alarm) {
// setInitialDialogLocation();
if (alarm) {
// provides the beep to alert the user that an alarm has come in
abj = new AlarmBeepJob("AlarmBeepJob");
abj.schedule();
}
if (alarmShell != null && alarmShell.isVisible()) {
alarmShell.setVisible(true);
} else {
if (alarmShell == null) {
display = parentShell.getDisplay();
if (alarmShell == null) {
initShell();
@ -195,25 +212,31 @@ public class AlarmAlertBell extends Dialog implements MouseMoveListener,
alarmShell.setLocation(locationX, locationY);
alarmShell.pack();
}
alarmShell.setVisible(true);
alarmShell.pack();
alarmShell.setActive();
/* // TODO: what is this for?
while (!alarmShell.isDisposed()) {
if (!display.isDisposed() && !display.readAndDispatch()) {
display.sleep();
}
}
*/
/*// TODO: put this in the correct location.
labelFont.dispose();
*/
}
invert = false;
active = true;
flasher = new FlashBellJob("FlashBell", this, FLASH_DELAY);
return null;
}
/**
* Close the AlarmAlertBell and turn off the "flasher" job
* if running.
*/
public void close() {
if(!alarmShell.isDisposed()) {
alarmShell.setVisible(false);
}
active = false;
if(flasher != null) {
flasher.cancel();
flasher = null;
}
}
private void setInitialDialogLocation() {
if (locationX < 0) {
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
@ -237,10 +260,12 @@ public class AlarmAlertBell extends Dialog implements MouseMoveListener,
.getLocalizationFile(localization,
"images" + File.separator + "bell.gif");
bellPath = imageFile.getFile().getAbsolutePath();
Image bell = new Image(display, bellPath);
Button button = new Button(alarmShell, SWT.IMAGE_GIF);
button.setImage(bell);
norm_bell = new Image(display, bellPath);
button = new Button(alarmShell, SWT.IMAGE_GIF);
if(norm_bell != null) {
createInvertImage(bellPath);
button.setImage(norm_bell);
}
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
@ -248,18 +273,16 @@ public class AlarmAlertBell extends Dialog implements MouseMoveListener,
alarmDlg = CurrentAlarmQueue.getInstance(getParent());
alarmDlg.setDialogFocus();
alarmDlg.open();
alarmShell.setVisible(false);
} else {
if (alarmDlg.getShell().isDisposed()) {
alarmDlg = CurrentAlarmQueue.getInstance(alarmShell);
alarmDlg.setDialogFocus();
alarmDlg.open();
alarmShell.setVisible(false);
} else {
alarmDlg.setDialogFocus();
alarmShell.setVisible(false);
}
}
close();
}
});
}
@ -286,6 +309,9 @@ public class AlarmAlertBell extends Dialog implements MouseMoveListener,
moveDialog = false;
}
/**
*
*/
@Override
public void mouseMove(MouseEvent e) {
if (origin != null && moveDialog == true) {
@ -298,18 +324,41 @@ public class AlarmAlertBell extends Dialog implements MouseMoveListener,
}
/**
* Returns if dialog is disposed.
*
* @return True if disposed, false if not.
* Create an inverse image of the bell.
*/
public boolean isDisposed() {
return alarmShell.isDisposed();
private void createInvertImage(String path) {
if (norm_bell != null) {
ImageData id = new ImageData(path);
for(int i = 0;i < id.width;i++) {
for(int j = 0;j < id.height;j++) {
if(id.getPixel(i,j) == 0) {
id.setPixel(i,j,1);
} else {
id.setPixel(i,j,0);
}
}
}
revs_bell = new Image(display, id);
}
}
/**
* return the shell of the AlarmAlertBell
* Check to see if the dialog is active.
* @return
*/
public Shell getAlarmShell() {
return alarmShell;
public boolean isActive() {
return active;
}
/**
* Alternate between normal and reverse images.
*/
public void flash() {
if(invert) {
button.setImage(revs_bell);
} else {
button.setImage(norm_bell);
}
invert = !invert;
}
}

View file

@ -30,12 +30,9 @@ import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.Font;
@ -266,48 +263,66 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements
textComp.setLayout(gl);
GridData textData = new GridData(SWT.FILL, SWT.FILL, true, true);
textComp.setLayoutData(textData);
list = new List(textComp, SWT.BORDER | SWT.V_SCROLL);
list = new List(textComp, SWT.BORDER | SWT.V_SCROLL | SWT.SINGLE);
list.setLayoutData(textData);
list.addKeyListener(new KeyListener() {
list.addSelectionListener(new SelectionListener() {
@Override
public void keyPressed(KeyEvent e) {
// if (list.getSelectionIndex() >= list.getItemCount() - 1) {
// list.setSelection(0);
// } else {
// list.setSelection(list.getSelectionIndex() - 1);
// }
//
// if (list.getSelectionIndex() <= 0) {
// list.setSelection(list.getItemCount() - 1);
// } else {
// list.setSelection(list.getSelectionIndex() + 1);
// }
// System.out.println("List selc : " +
// list.getSelectionIndex());
}
@Override
public void keyReleased(KeyEvent e) {
public void widgetSelected(SelectionEvent e) {
// TODO Auto-generated method stub
}
});
list.addMouseListener(new MouseListener() {
@Override
public void mouseDoubleClick(MouseEvent e) {
}
@Override
public void mouseDown(MouseEvent e) {
}
@Override
public void mouseUp(MouseEvent e) {
System.err.println("CurrentAlarmQueue Selected:"
+ list.getSelectionCount() + " "
+ list.getSelection()[0]);
displayList();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// TODO Auto-generated method stub
System.err.println("CurrentAlarmQueue DefaultSelected:"
+ list.getSelection());
}
});
// list.addKeyListener(new KeyListener() {
//
// @Override
// public void keyPressed(KeyEvent e) {
// // if (list.getSelectionIndex() >= list.getItemCount() - 1) {
// // list.setSelection(0);
// // } else {
// // list.setSelection(list.getSelectionIndex() - 1);
// // }
// //
// // if (list.getSelectionIndex() <= 0) {
// // list.setSelection(list.getItemCount() - 1);
// // } else {
// // list.setSelection(list.getSelectionIndex() + 1);
// // }
// // System.out.println("List selc : " +
// // list.getSelectionIndex());
// }
//
// @Override
// public void keyReleased(KeyEvent e) {
// // TODO Auto-generated method stub
//
// }
//
// });
// list.addMouseListener(new MouseListener() {
// @Override
// public void mouseDoubleClick(MouseEvent e) {
// }
//
// @Override
// public void mouseDown(MouseEvent e) {
// }
//
// @Override
// public void mouseUp(MouseEvent e) {
// displayList();
// }
// });
}
/**
@ -378,8 +393,7 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements
.remove(list.getSelectionIndex());
list.remove(list.getSelectionIndex());
if (list.getItemCount() == 0) {
AlarmAlertFunctions.getAlarmalertbell().getAlarmShell()
.setVisible(false);
AlarmAlertFunctions.getAlarmalertbell().close();
}
}
@ -403,12 +417,14 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements
String bbb = "";
String awipsId = "";
// Use awips command to retrieve correct alarm product if it does
// Use awips command to retrieve correct alarm product if it
// does
// not match (DR_14624)
if (!alarmHHMM.equals(hhmm)) {
String hdrDate = hdrTime.substring(0,2);
String hdrDate = hdrTime.substring(0, 2);
hdrTime = hdrDate.concat(alarmHHMM);
prods = getAwipsTextProduct(awipsId, wmoId, site, hdrTime, bbb);
prods = getAwipsTextProduct(awipsId, wmoId, site, hdrTime,
bbb);
}
}
}
@ -470,8 +486,7 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements
}
AlarmAlertLists.getInstance().getCurrentAlarms().clear();
list.removeAll();
AlarmAlertFunctions.getAlarmalertbell().getAlarmShell()
.setVisible(false);
AlarmAlertFunctions.getAlarmalertbell().close();
}
if (alarmDisplayDlg == null) {
java.util.List<StdTextProduct> prods = new ArrayList<StdTextProduct>();
@ -563,10 +578,12 @@ public class CurrentAlarmQueue extends CaveSWTDialog implements
*/
public java.util.List<StdTextProduct> getAwipsTextProduct(String awipsId,
String wmoId, String site, String hdrTime, String bbb) {
ICommand cmd = CommandFactory.getAwipsCommand(awipsId, wmoId, site, hdrTime, bbb);
ICommand cmd = CommandFactory.getAwipsCommand(awipsId, wmoId, site,
hdrTime, bbb);
executeCommand(cmd);
return prodList;
}
/*
* (non-Javadoc)
*

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.alarmalert.util;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Button;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.viz.texteditor.alarmalert.dialogs.AlarmAlertBell;
/**
* TODO
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 18, 2012 jkorman Initial creation
*
* </pre>
*
* @author mnash
* @version 1.0
*/
public class FlashBellJob extends Job {
private AlarmAlertBell bell;
private int delay;
private boolean disposed = false;
/**
*
* @param name
* @param bell
* @param delay
*/
public FlashBellJob(String name, AlarmAlertBell bell, int delay) {
super(name);
this.bell = bell;
this.delay = delay;
schedule(delay);
}
/**
*
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
if((bell != null) && (bell.isActive())) {
VizApp.runSync(new Runnable() {
@Override
public void run() {
System.out.println("Flashing bell");
bell.flash();
}
});
System.out.println("Scheduling bell");
schedule(delay);
} else {
dispose();
}
return Status.OK_STATUS;
}
/**
* Cancel this job and release its reference to the DataManager
*/
public void dispose() {
System.out.println("Disposing bell job");
disposed = true;
bell = null;
this.cancel();
}
}

View file

@ -86,7 +86,6 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 06/28/2010 4639 cjeanbap Allow user to create a new text product.
*
* 01/26/2012 14468 D.Friedman Fix initial BBB field selection.
* 05/30/2012 15046 D.Friedman Always set addressee field to ALL.
* </pre>
*
* @author lvenable
@ -449,7 +448,7 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
addresseeTF.setTextLimit(4);
addresseeTF.setLayoutData(rd);
// Set the "default" addressee to "ALL".
addresseeTF.setText("ALL");
addresseeTF.setText(parentEditor.getAddressee());
// When the number of characters enter reaches the max limit and
// the caret position is at the end then switch focus to the next
@ -461,7 +460,15 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
wmoTtaaiiTF.setFocus();
}
handleAddresseeModified();
// If the user changes the text in the addressee text field
// then "untoggle" the toggle buttons.
if (addresseeTF.getText().compareTo("000") != 0
&& addresseeTF.getText().compareTo("DEF") != 0
&& addresseeTF.getText().compareTo("ALL") != 0) {
zerosBtn.setSelection(false);
defBtn.setSelection(false);
allBtn.setSelection(false);
}
}
});
@ -511,7 +518,6 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
addresseeTF.setText("ALL");
}
});
handleAddresseeModified();
Label sepLbl = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
sepLbl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@ -939,16 +945,4 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
}
});
}
private void handleAddresseeModified() {
// If the user changes the text in the addressee text field
// then update the toggle buttons.
String addressee = addresseeTF.getText();
if (zerosBtn != null)
zerosBtn.setSelection("000".equals(addressee));
if (defBtn != null)
defBtn.setSelection("DEF".equals(addressee));
if (allBtn != null)
allBtn.setSelection("ALL".equals(addressee));
}
}

View file

@ -160,8 +160,7 @@ public class TextWorkstationDlg extends CaveSWTDialog implements
TextWorkstationConstants.getTextWorkstationQueueName(), null,
this);
notify.checkExpirationNotices(shell);
AlarmAlertFunctions.getAlarmalertbell().getAlarmShell()
.setVisible(false);
AlarmAlertFunctions.getAlarmalertbell().close();
for (TextEditorDialog teDlg : textEditorArray) {
if (teDlg != null) {
teDlg.disposeDialog();

View file

@ -73,6 +73,10 @@ import com.raytheon.viz.core.units.UnitRegistrar;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 28, 2011 mschenke Initial creation
* May 16, 2012 #636 dgilling Ensure exception is thrown
* and CAVE immediately exits
* if connection cannot be made to
* localization server.
*
* </pre>
*
@ -134,7 +138,18 @@ public abstract class AbstractCAVEComponent implements IStandaloneComponent {
display = new Display();
}
try {
initializeLocalization(nonui);
} catch (Exception e) {
e.printStackTrace();
statusHandler.handle(
Priority.CRITICAL,
"Could not connect to localization server: "
+ e.getLocalizedMessage(), e);
// we return EXIT_OK here so eclipse doesn't try to pop up an error
// dialog which would break gfeClient-based cron jobs.
return IApplication.EXIT_OK;
}
initializeSerialization();
initializeDataStoreFactory();
initializeObservers();
@ -318,15 +333,9 @@ public abstract class AbstractCAVEComponent implements IStandaloneComponent {
new PyPiesDataStoreFactory(pypiesProps));
}
protected void initializeLocalization(boolean nonui) {
try {
protected void initializeLocalization(boolean nonui) throws Exception {
new LocalizationInitializer(!nonui,
!LocalizationManager.internalAlertServer).run();
} catch (Exception e1) {
e1.printStackTrace();
statusHandler.handle(Priority.CRITICAL,
"Error setting up localization", e1);
}
}
protected void initializeSerialization() {

View file

@ -90,6 +90,16 @@ public class AffectedAreas {
return name;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the areaNotation
*/
@ -104,6 +114,14 @@ public class AffectedAreas {
return areasNotation;
}
public void setAreaNotation(String areaNotation) {
this.areaNotation = areaNotation;
}
public void setAreasNotation(String areasNotation) {
this.areasNotation = areasNotation;
}
/**
* @return the partOfParentRegion
*/
@ -118,6 +136,10 @@ public class AffectedAreas {
return parentRegion;
}
public void setPartOfArea(List<String> partOfArea) {
this.partOfArea = partOfArea;
}
/**
* @return the points
*/

View file

@ -278,23 +278,30 @@ public class GisUtil {
return list;
}
public static Coordinate[] convertAlaskaLons(Coordinate[] oldCoords) {
public static Coordinate d2dCoordinate(Coordinate oldCoord) {
Coordinate coord = new Coordinate();
if (oldCoord.x > 150. && oldCoord.y > 45.) {
coord.x = oldCoord.x - 360.;
} else {
coord.x = oldCoord.x;
}
coord.y = oldCoord.y;
return coord;
}
public static Coordinate[] d2dCoordinates(Coordinate[] oldCoords) {
int length = oldCoords.length;
Coordinate[] coords = new Coordinate[length];
for (int i = 0; i < length; i++) {
coords[i] = new Coordinate();
if (oldCoords[i].x > 150. && oldCoords[i].y > 45.) {
coords[i].x = oldCoords[i].x - 360.;
} else {
coords[i].x = oldCoords[i].x;
}
coords[i].y = oldCoords[i].y;
coords[i] = d2dCoordinate(oldCoords[i]);
}
return coords;
}
public static Point2D[] convertCoords(Coordinate[] oldCoords) {
Coordinate[] coords = convertAlaskaLons(oldCoords);
Coordinate[] coords = d2dCoordinates(oldCoords);
ArrayList<Point2D> pts = new ArrayList<Point2D>();
int firstX = (int) (coords[0].x * 100);
int firstY = (int) (coords[0].y * 100);

View file

@ -93,6 +93,8 @@ import com.vividsolutions.jts.geom.Point;
* Apr 18, 2012 DR14733 Qinglu Lin David's fix is used, which creates another
* ClosestPoint object in the for loop
* that loops over availablePoints.
* May 21, 2012 DR14480 Qinglu Lin Added code to prevent duplicate cities
* in pathcast.
*
* </pre>
*
@ -526,6 +528,9 @@ public class Wx {
// with first pathcast and goes through each point within maxCount,
// check for same point in other pathcast objects. If same point
// exists, remove from which ever pathcast is furthest away
Set<String> closestPtNames = new HashSet<String>(30);
List<ClosestPoint> tmpPoints = new ArrayList<ClosestPoint>(
maxCount);
Queue<PathCast> tmp = new ArrayDeque<PathCast>(pathcasts);
while (tmp.isEmpty() == false) {
PathCast pc = tmp.remove();
@ -553,10 +558,16 @@ public class Wx {
}
}
List<ClosestPoint> tmpPoints = new ArrayList<ClosestPoint>(
maxCount);
tmpPoints.clear();
for (int i = 0; i < points.size() && i < maxCount; ++i) {
tmpPoints.add(points.get(i));
ClosestPoint point = points.get(i);
String name = point.getName();
if (!closestPtNames.contains(name)) {
// To prevent duplicate cities in pathcast,
// only unused point is added to tmpPoints
tmpPoints.add(point);
closestPtNames.add(name);
}
}
if (tmpPoints.size() > 0) {
pc.points = tmpPoints.toArray(new ClosestPoint[tmpPoints

View file

@ -827,30 +827,16 @@ public class WarngenDialog extends CaveSWTDialog implements
updateListCbo.removeAll();
String site = warngenLayer.getLocalizedSite();
CurrentWarnings cw = CurrentWarnings.getInstance(site);
java.util.List<AbstractWarningRecord> records = cw.getWarnings();
java.util.List<AbstractWarningRecord> warnings = cw
.getCurrentWarnings();
java.util.List<AbstractWarningRecord> correctableWarnings = cw
.getCorrectableWarnings(warngenLayer.getConfiguration()
.getPhensigs());
ArrayList<String> dropDownItems = new ArrayList<String>();
// Rules for correcting warnings are different than other followups.
correctableWarnings = FollowUpUtil.checkCorApplicable(
warngenLayer.getConfiguration(), correctableWarnings, records);
for (AbstractWarningRecord w : correctableWarnings) {
FollowupData data = new FollowupData(WarningAction.COR, w);
updateListCbo.setData(data.displayString, data);
corYes = true;
dropDownItems.add(data.displayString);
}
WarningAction[] acts = new WarningAction[] { WarningAction.CON,
WarningAction[] acts = new WarningAction[] { WarningAction.CON, WarningAction.COR,
WarningAction.CAN, WarningAction.EXP, WarningAction.NEW,
WarningAction.EXT };
for (int i = 0; i < warnings.size(); i++) {
for (WarningAction act : acts) {
if (FollowUpUtil.checkApplicable(
if (FollowUpUtil.checkApplicable(site,
warngenLayer.getConfiguration(), warnings.get(i), act)) {
FollowupData data = new FollowupData(act, warnings.get(i));
updateListCbo.setData(data.displayString, data);
@ -862,6 +848,8 @@ public class WarngenDialog extends CaveSWTDialog implements
|| act == WarningAction.CAN
|| act == WarningAction.EXP) {
follow = true;
} else if (act == WarningAction.COR) {
corYes = true;
}
dropDownItems.add(data.displayString);
}
@ -1509,8 +1497,6 @@ public class WarngenDialog extends CaveSWTDialog implements
* item from update list selected
*/
public void updateListSelected() {
bulletList.setEnabled(true);
durationList.setEnabled(true);
warngenLayer.setOldWarningPolygon(null);
setPolygonLocked(false);
if (updateListCbo.getSelectionIndex() >= 0) {
@ -1561,6 +1547,8 @@ public class WarngenDialog extends CaveSWTDialog implements
return;
}
bulletList.setEnabled(true);
durationList.setEnabled(true);
totalSegments = 0;
warngenLayer.getStormTrackState().endTime = null;
WarningAction action = WarningAction.valueOf(data.getAct());

View file

@ -170,6 +170,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
private static Map<String, GeospatialDataList> siteMap = new HashMap<String, GeospatialDataList>();
private static Map<String, Geometry> timezoneMap = new HashMap<String, Geometry>();
public static final String GID = "gid";
private static final String AREA = "WARNGEN_AREA";
@ -784,6 +786,20 @@ public class WarngenLayer extends AbstractStormTrackResource {
System.out.println("Time to lookup geospatial data "
+ (System.currentTimeMillis() - tq0));
siteMap.put(currKey, gData);
GeospatialData[] timezones = GeospatialFactory.getTimezones();
if (timezones != null) {
for (GeospatialData timezone : timezones) {
if (timezone.attributes.containsKey(gmd.getTimeZoneField())) {
String oneLetterTimezone = String.valueOf(
timezone.attributes.get(gmd.getTimeZoneField()));
if (timezoneMap.containsKey(oneLetterTimezone) == false) {
timezoneMap.put(oneLetterTimezone, timezone.geometry);
}
}
}
}
} catch (Exception e) {
statusHandler.handle(Priority.WARN,
"Error in initializing geometries.", e);
@ -842,6 +858,10 @@ public class WarngenLayer extends AbstractStormTrackResource {
return new GeospatialData[0];
}
public Geometry getTimezoneGeom(String oneLetterTimezone) {
return timezoneMap.get(oneLetterTimezone);
}
/**
* Gets the polygon in lat/lon projection
*
@ -1135,14 +1155,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
Geometry intersection = null;
try {
// Get intersection between county and hatched boundary
try {
intersection = GeometryUtil.intersection(hatchedArea,
prepGeom);
} catch (TopologyException e) {
// side location conflict using a prepared geom
// need the actual geom for this case
intersection = GeometryUtil.intersection(hatchedArea, geom);
}
intersection = GeometryUtil.intersection(hatchedArea,prepGeom);
if (intersection.isEmpty()) {
continue;
}
@ -1734,19 +1747,13 @@ public class WarngenLayer extends AbstractStormTrackResource {
Matcher m = tmlPtrn.matcher(rawMessage);
if (m.find()) {
Calendar issueTime = warnRecord.getIssueTime();
int day = issueTime.get(Calendar.DAY_OF_MONTH);
int tmlHour = Integer.parseInt(m.group(1));
// This is for the case when the warning text was created,
// but actually issued the next day.
if (tmlHour > issueTime.get(Calendar.HOUR_OF_DAY)) {
day--;
}
int tmlMinute = Integer.parseInt(m.group(2));
int day = warnRecord.getIssueTime().get(Calendar.DAY_OF_MONTH);
int hour = Integer.parseInt(m.group(1));
int minute = Integer.parseInt(m.group(2));
frameTime = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
frameTime.set(Calendar.DAY_OF_MONTH, day);
frameTime.set(Calendar.HOUR_OF_DAY, tmlHour);
frameTime.set(Calendar.MINUTE, tmlMinute);
frameTime.set(Calendar.HOUR_OF_DAY, hour);
frameTime.set(Calendar.MINUTE, minute);
} else {
frameTime = warnRecord.getIssueTime();
}
@ -2152,7 +2159,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
for (GeospatialData f : geoData.features) {
Geometry geom = f.geometry;
if (prefixes.contains(GeometryUtil.getPrefix(geom.getUserData()))) {
state.strings.put(geom.getCentroid().getCoordinate(), "W");
Coordinate center = GisUtil.d2dCoordinate(geom.getCentroid().getCoordinate());
state.strings.put(center, "W");
}
}
}

View file

@ -212,7 +212,7 @@ public class TemplateRunner {
context.put("dateUtil", new DateUtil());
context.put("pointComparator", new ClosestPointComparator());
String action = followupData != null ? followupData.getAct() : null;
String action = followupData != null ? followupData.getAct() : WarningAction.NEW.toString();
String phen = followupData != null ? followupData.getPhen() : null;
String sig = followupData != null ? followupData.getSig() : null;
String etn = followupData != null ? followupData.getEtn() : null;
@ -244,13 +244,20 @@ public class TemplateRunner {
for (AffectedAreas area : areas) {
if (area.getTimezone() != null) {
// Handles counties that span two counties
for (String oneLetterTimeZone : area.getTimezone().split("")) {
if (oneLetterTimeZone.length() != 0) {
String oneLetterTimeZones = area.getTimezone().trim();
if (oneLetterTimeZones.length() == 1) {
timeZones.add(String.valueOf(oneLetterTimeZones.charAt(0)));
} else {
for (int i = 0; i < oneLetterTimeZones.length(); i++) {
String oneLetterTimeZone = String.valueOf(oneLetterTimeZones.charAt(i));
Geometry timezoneGeom = warngenLayer.getTimezoneGeom(oneLetterTimeZone);
if (timezoneGeom != null && GeometryUtil.intersects(warningArea, timezoneGeom)) {
timeZones.add(oneLetterTimeZone);
}
}
}
}
}
Iterator<String> iterator = timeZones.iterator();
while (iterator.hasNext()) {
@ -321,7 +328,7 @@ public class TemplateRunner {
// Convert to Point2D representation as Velocity requires
// getX() and getY() methods which Coordinate does not have
Coordinate[] newStormLocs = GisUtil
.convertAlaskaLons(stormLocs);
.d2dCoordinates(stormLocs);
Point2D.Double[] coords = new Point2D.Double[newStormLocs.length];
for (int i = 0; i < newStormLocs.length; i++) {
coords[i] = new Point2D.Double(newStormLocs[i].x,
@ -439,10 +446,21 @@ public class TemplateRunner {
Calendar cal = oldWarn.getEndTime();
cal.add(Calendar.MILLISECOND, 1);
context.put("expire", cal.getTime());
if (stormTrackState.originalTrack) {
context.put("specialCorText",
FollowUpUtil.getSpecialCorText(oldWarn));
String originalText = FollowUpUtil.originalText(oldWarn);
m = FollowUpUtil.vtecPtrn.matcher(originalText);
int totalSegments = 0;
while (m.find()) {
totalSegments++;
}
if (stormTrackState.originalTrack) {
context.put("originalText", originalText);
}
ArrayList<AffectedAreas> al = null;
if (totalSegments > 1) {
al = FollowUpUtil.canceledAreasFromText(originalText);
}
context.put("cancel"+ config.getAreaConfig().getVariable(), al);
context.put("ugclinecan", FollowUpUtil.getUgcLineCanFromText(originalText));
} else if (selectedAction == WarningAction.EXT) {
context.put("action", WarningAction.EXT.toString());
context.put("etn", etn);
@ -558,8 +576,7 @@ public class TemplateRunner {
+ (System.currentTimeMillis() - tz0));
return WarningTextHandler.handle(script.toString().toUpperCase(),
areas, cancelareas,
WarningAction.valueOf((String) context.get("action")),
areas, cancelareas, selectedAction,
config.getAutoLockText());
}

View file

@ -180,15 +180,6 @@ public class CurrentWarnings {
return rval;
}
/**
* Get a list of the correctable warning records
*
* @return the correctable warnings
*/
public List<AbstractWarningRecord> getCorrectableWarnings() {
return getCorrectableWarnings(null);
}
/**
* Get a list of the correctable warning records for the phensigs. Or all
* correctable warnings if phensigs is null
@ -196,38 +187,34 @@ public class CurrentWarnings {
* @param phenSigs
* @return
*/
public List<AbstractWarningRecord> getCorrectableWarnings(String[] phenSigs) {
public List<AbstractWarningRecord> getCorrectableWarnings(AbstractWarningRecord warnRec) {
List<AbstractWarningRecord> rval = new ArrayList<AbstractWarningRecord>();
Calendar current = Calendar.getInstance();
Calendar end = Calendar.getInstance();
current.setTime(SimulatedTime.getSystemTime().getTime());
boolean valid;
synchronized (officeId) {
for (AbstractWarningRecord warning : records) {
valid = true;
if (phenSigs != null) {
valid = false;
for (String phenSig : phenSigs) {
if (warning.getPhensig() != null
&& warning.getPhensig().equals(phenSig)) {
valid = true;
}
}
}
WarningAction action = getAction(warning.getAct());
String phensig = warning.getPhensig();
String etn = warning.getEtn();
if (warnRec.getPhensig().equals(phensig) && warnRec.getEtn().equals(etn)) {
WarningAction action = WarningAction.valueOf(warning.getAct());
end.setTime(warning.getStartTime().getTime());
end.add(Calendar.MINUTE, 10);
TimeRange t = new TimeRange(warning.getStartTime().getTime(),
end.getTime());
if (valid
&& (action == WarningAction.NEW
|| action == WarningAction.CON || action == WarningAction.EXT)
if ((action == WarningAction.NEW || action == WarningAction.CON || action == WarningAction.EXT)
&& t.contains(current.getTime())) {
rval.add(warning);
} else if (action == WarningAction.CAN || action == WarningAction.EXP) {
rval.clear();
return rval;
}
}
}
}
return rval;
}
@ -266,6 +253,7 @@ public class CurrentWarnings {
for (AbstractWarningRecord warning : warnings) {
if (getAction(warning.getAct()) == WarningAction.CON) {
if (rval != null) {
//rval.setAct("CON");
rval.setGeometry(warning.getGeometry());
rval.setCountyheader(warning.getCountyheader());
rval.setUgczones(warning.getUgczones());

View file

@ -21,6 +21,7 @@ package com.raytheon.viz.warngen.util;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.EnumSet;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -30,6 +31,9 @@ import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.viz.warngen.gis.AffectedAreas;
import com.raytheon.viz.warngen.gis.GisUtil;
import com.raytheon.viz.warngen.gis.GisUtil.Direction;
/**
* This utility will provide methods for determining what followup products are
@ -60,7 +64,7 @@ public class FollowUpUtil {
* This method checks whether a particular followup should be available
* given a Warning Record, a vtec Action, and a template configuration
*/
public static boolean checkApplicable(WarngenConfiguration config,
public static boolean checkApplicable(String site, WarngenConfiguration config,
AbstractWarningRecord record, WarningAction action) {
// Current Time
@ -79,7 +83,6 @@ public class FollowUpUtil {
}
}
if (valueCheck) {
boolean isNewProduct = false;
for (String s : config.getFollowUps()) {
WarningAction act = WarningAction.valueOf(s);
if (act == action
@ -87,37 +90,15 @@ public class FollowUpUtil {
&& act != WarningAction.COR) {
rval = true;
}
if (act == WarningAction.NEW) {
isNewProduct = true;
}
}
if (action == WarningAction.COR) {
WarningAction recordAct = WarningAction
.valueOf(record.getAct());
if (isNewProduct
&& getTimeRange(action, record).contains(cal.getTime())) {
if (action == WarningAction.COR && checkCorApplicable(site, config, record)) {
rval = true;
} else if (!isNewProduct && (recordAct != WarningAction.NEW)
&& (recordAct != WarningAction.COR)
&& (recordAct != WarningAction.EXT)) {
rval = true;
}
}
}
return rval;
}
/**
* Check whether or not a given Warning Record satisfies the requirements to
* be correctible given the selected template
*/
public static ArrayList<AbstractWarningRecord> checkCorApplicable(
WarngenConfiguration config,
List<AbstractWarningRecord> correctableWarnings,
List<AbstractWarningRecord> currentWarnings) {
ArrayList<AbstractWarningRecord> list = new ArrayList<AbstractWarningRecord>();
private static boolean checkCorApplicable(String site, WarngenConfiguration config, AbstractWarningRecord warnRec) {
boolean allowsCONProduct = false;
boolean allowsCORProduct = false;
for (String s : config.getFollowUps()) {
@ -130,43 +111,35 @@ public class FollowUpUtil {
}
if (allowsCORProduct == false) {
return list;
return false;
}
CurrentWarnings cw = CurrentWarnings.getInstance(site);
List<AbstractWarningRecord> correctableWarnings = cw.getCorrectableWarnings(warnRec);
boolean wasContinued = false;
for (AbstractWarningRecord w : correctableWarnings) {
if (WarningAction.valueOf(w.getAct()) == WarningAction.CON) {
wasContinued = true;
}
}
// Adding a COR option for continuation follow ups
if (allowsCONProduct) {
for (AbstractWarningRecord warnRec : correctableWarnings) {
if (WarningAction.valueOf(warnRec.getAct()) == WarningAction.CON) {
list.add(warnRec);
}
}
} else {
for (AbstractWarningRecord warnRec : correctableWarnings) {
boolean valid = false;
if (WarningAction.valueOf(warnRec.getAct()) == WarningAction.NEW
|| WarningAction.valueOf(warnRec.getAct()) == WarningAction.EXT) {
valid = true;
for (AbstractWarningRecord w : currentWarnings) {
WarningAction act = WarningAction.valueOf(w.getAct());
if (warnRec.getEtn().equals(w.getEtn())
&& warnRec.getPhensig().equals(w.getPhensig())
&& (act == WarningAction.CAN
|| act == WarningAction.CON || act == WarningAction.EXP)) {
valid = false;
}
}
if (correctableWarnings.isEmpty() == false && ((allowsCONProduct && wasContinued)
|| (allowsCONProduct == false && wasContinued == false))) {
return true;
}
if (valid) {
list.add(warnRec);
}
}
return false;
}
return list;
}
public static String getSpecialCorText(AbstractWarningRecord record) {
/**
* Returns the raw message of the record but removes
* the first wmoid and the pil (the first two lines of the warning)
* @param record
* @return
*/
public static String originalText(AbstractWarningRecord record) {
String originalMessage = record.getRawmessage();
@ -197,6 +170,126 @@ public class FollowUpUtil {
return originalMessage;
}
/**
* Returns a list of the canceled areas from the original text
* @param originalText
* @return
*/
public static ArrayList<AffectedAreas> canceledAreasFromText(String originalText) {
boolean ugcdone = false;
boolean namedone = false;
boolean insideHeadline = false;
String ugcLine = "";
String namesLine = "";
String headline = "";
for (String line : originalText.trim().split("\n")) {
if (line.contains("TEST") || line.trim().length() == 0) {
continue;
}
Matcher m = WarningTextHandler.ugcPtrn.matcher(line);
if (!ugcdone && m.find()) {
ugcLine += m.group();
continue;
} else if (ugcLine.length() > 0) {
ugcdone = true;
}
m = WarningTextHandler.listOfAreaNamePtrn.matcher(line);
if (!namedone && m.find()) {
namesLine += m.group();
continue;
} else if (namesLine.length() > 0) {
namedone = true;
}
if (line.startsWith("...")) {
headline += line.substring(3);
insideHeadline = true;
} else if (insideHeadline) {
if (line.trim().endsWith("...")) {
headline += line.substring(0,line.length() - 3);
insideHeadline = false;
break;
}
headline += line;
}
}
String[] ugcs = ugcLine.split("-");
String[] names = namesLine.split("-");
String[] areas = headline.split("\\.\\.\\.");
ArrayList<AffectedAreas> al = new ArrayList<AffectedAreas>();
String stateAbbreviation = null;
String areaNotation = null;
String areasNotation = null;
String fips = null;
String name = null;
List<String> partOfArea = null;
for (int i = 0; i < ugcs.length; i++) {
AffectedAreas affectedArea = new AffectedAreas();
String ugc = ugcs[i].trim();
if (ugc.length() == 6) {
stateAbbreviation = ugc.substring(0,2);
if (ugc.charAt(2) == 'Z') {
areaNotation = "ZONE";
areasNotation = "ZONES";
} else {
areaNotation = "COUNTY";
areasNotation = "COUNTIES";
}
}
fips = ugc.substring(ugc.length() - 3);
if (i < names.length) {
name = names[i].substring(0, names[i].length()-3);
}
if (name != null) {
for (String area : areas) {
if (area.contains(name)) {
EnumSet<Direction> set = EnumSet.noneOf(Direction.class);
for (Direction direction : Direction.values()) {
if (area.contains(direction.name())) {
set.add(direction);
}
}
partOfArea = GisUtil.asStringList(set);
break;
}
}
}
affectedArea.setFips(fips);
affectedArea.setStateabbr(stateAbbreviation);
affectedArea.setAreaNotation(areaNotation);
affectedArea.setAreasNotation(areasNotation);
affectedArea.setName(name);
affectedArea.setPartOfArea(partOfArea);
al.add(affectedArea);
}
return al;
}
public static String getUgcLineCanFromText(String originalText) {
String ugcLine = "";
for (String line : originalText.trim().split("\n")) {
Matcher m = WarningTextHandler.ugcPtrn.matcher(line);
if (m.find()) {
ugcLine += line;
continue;
} else if (ugcLine.length() > 0) {
break;
}
}
return ugcLine;
}
/**
* This method determines a time range for which a particular action can be
* performed on a particular warngen product. For instance, a Reissue (NEW)

View file

@ -88,7 +88,7 @@ public class WarningTextHandler {
.compile("(\\d{1,2})(\\d{2})\\s(AM|PM)\\s(\\w{3,4})\\s\\w{3}\\s(\\w{3})\\s{1,}(\\d{1,2})\\s(\\d{4})");
/** The UGC line (ex. NEC003-008-010-110325) */
private static final Pattern ugcPtrn = Pattern
public static final Pattern ugcPtrn = Pattern
.compile("((\\w{2}[CZ](\\d{3}-){1,}){1,})|(\\d{3}-){1,}");
/** The VTEC line (ex. /O.NEW.KOAX.TO.W.0001.110715T1722Z-110715T1730Z) */
@ -118,7 +118,8 @@ public class WarningTextHandler {
private static Pattern immediateCausePtrn = null;
/** ex. SARPY NE-DOUGLAS NE-WASHINGTON NE- */
private static final Pattern listOfAreaNamePtrn = Pattern.compile("(\\s\\w{2}-)");
public static final Pattern listOfAreaNamePtrn = Pattern
.compile("(((\\w{1,}\\s{1}){1,}\\w{2}-){0,}((\\w{1,}\\s{1}){1,}\\w{2}-))");
private static final Pattern secondBulletPtrn = Pattern.compile("\\*(|\\s"
+ TEST_MSG2 + ")\\sUNTIL\\s\\d{3,4}\\s(AM|PM)\\s\\w{3,4}");
@ -657,9 +658,8 @@ public class WarningTextHandler {
}
}
}
boolean firstSplit = true;
while (m.find()) {
String group = m.group();
String group = m.group().trim();
if (group.trim().length() == 0) {
break;
@ -670,11 +670,7 @@ public class WarningTextHandler {
sb.append(" ");
}
if (firstSplit == false && group.startsWith(" ")) {
group = group.substring(1);
}
sb.append(group);
firstSplit = false;
}
}
first = false;

View file

@ -0,0 +1,39 @@
#!/bin/bash
# This script will remove the existing monitoringArea files from
# fog, safeseas, and snow site directories.
#
# This update needs to be performed with build 12.6.1.
#
echo ""
echo "Press Enter to perform the updates Ctrl-C to quit."
read done
if [ -d /awips2/edex/data/utility/common_static/site ]; then
cd /awips2/edex/data/utility/common_static/site
if [ $? -ne 0 ]; then
echo "FATAL: Site directories do not exist!"
exit 1
fi
for site in `ls -1d *`;
do
for comp in fog safeseas snow
do
echo "INFO: Removing files from /awips2/edex/data/utility/common_static/site/$site/$comp/monitoringArea"
if [ -d /awips2/edex/data/utility/common_static/site/${site}/${comp}/monitoringArea ]; then
cd /awips2/edex/data/utility/common_static/site/${site}/${comp}/monitoringArea
if [ $? -ne 0 ]; then
echo "FATAL: Could not change directory to site/$site/$comp/monitoringArea directory"
else
rm /awips2/edex/data/utility/common_static/site/${site}/${comp}/monitoringArea/*
if [ $? -ne 0 ]; then
echo "FATAL: Could not remove files from /awips2/edex/data/utility/common_static/site/$site/$comp/monitoringArea"
fi
fi
fi
done
done
echo "INFO: This update was successful."
fi
exit 0

View file

@ -175,8 +175,19 @@
<hrapGridFactor>4</hrapGridFactor>
</source>
<source>
<SourceName>VGBRADAR</SourceName>
<DisplayName>Virtual Gage Basins RADAR</DisplayName>
<SourceName>VGBDHR</SourceName>
<DisplayName>Virtual Gage Basins DHR</DisplayName>
<DurationHour>1</DurationHour>
<dataPath>hd_ob92oax</dataPath>
<dataType>RADAR</dataType>
<sourceType>GAGE</sourceType>
<rateOrAccum>rate</rateOrAccum>
<expirationMinutes>15</expirationMinutes>
<unit>inches</unit>
</source>
<source>
<SourceName>VGBDPR</SourceName>
<DisplayName>Virtual Gage Basins DPR</DisplayName>
<DurationHour>1</DurationHour>
<dataPath>hd_ob92oax</dataPath>
<dataType>RADAR</dataType>
@ -210,7 +221,7 @@
<qpf>PRTM</qpf>
<qpf>BPRTM</qpf>
<guidance>FFG0124hr, FFG0324hr, FFG0624hr</guidance>
<virtual>VGBRADAR</virtual>
<virtual>VGBDHR</virtual>
</product>
<product primarySource="DPR">
<rate>DPR</rate>
@ -219,6 +230,6 @@
<qpf>BPRTM</qpf>
<qpf>PRTM</qpf>
<guidance>FFG0124hr, FFG0324hr, FFG0624hr</guidance>
<virtual>VGBRADAR</virtual>
<virtual>VGBDPR</virtual>
</product>
</FFMPSourceConfig>

View file

@ -137,7 +137,13 @@
##########################################
## FLOOD ADVISORY FOLLOW-UP HEADER INFO ##
##########################################
#if(${action}!="CANCON")
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}!="CANCON" && ${CORCAN}!="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FLS${siteId}
@ -217,7 +223,7 @@ THE HEAVY RAIN HAS ENDED...AND FLOODING IS NO LONGER EXPECTED TO POSE A THREAT.
########################
## FLOOD ADVISORY CON ##
########################
#if(${action}=="CON" || ${action}=="COR")
#if(${action}=="CON" || (${action}=="COR" && ${CORCAN}=="false"))
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
@ -463,6 +469,157 @@ A FLOOD ADVISORY MEANS RIVER OR STREAM FLOWS ARE ELEVATED...OR PONDING OF WATER
#end
#################################### END OF CTA STUFF ###################################
#elseif(${CORCAN}=="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FLS${siteId}
#if(${productClass}=="T")
TEST...FLOOD ADVISORY...TEST
#else
FLOOD ADVISORY
#end
NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
${ugclinecan}
/${productClass}.COR.${vtecOffice}.FA.Y.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.N.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
...THE ${advType} ${hycType}HAS BEEN CANCELLED FOR ##
#headlineLocList(${areas} true true true false)##
...
########### END NEW HEADLINE CODE ####################
!** THE HEAVY RAIN HAS ENDED (AND/OR) FLOOD WATER IS RECEDING. THEREFORE...THE FLOODING THREAT HAS ENDED. **!
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. DO NOT TAKE ACTION BASED ON THIS MESSAGE.
#end
#printcoords(${areaPoly}, ${list})
$$
${ugcline}
/${productClass}.COR.${vtecOffice}.FA.Y.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.N.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#if(${productClass}=="T")
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)
...##
########### END NEW HEADLINE CODE ####################
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. AT ${dateUtil.format(${event}, ${timeFormat.clock}, ${localtimezone})}...!** warning basis **!
#else
AT ${dateUtil.format(${event}, ${timeFormat.clock}, ${localtimezone})}...${report}. ${estimate}
#end
#set ($phenomena = "FLASH FLOOD")
#set ($warningType = "ADVISORY")
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#locationsList("SOME LOCATIONS THAT WILL EXPERIENCE MINOR FLOODING INCLUDE" "THE FLOODING IS EXPECTED TO IMPACT MAINLY RURAL AREAS OF" 0 ${cityList} ${otherPoints} ${areas} ${dateUtil} ${timeFormat} 0)
#if(${list.contains($bullets, "addRainfall")})
ADDITIONAL RAINFALL OF !** Edit Amount **! INCHES IS EXPECTED OVER THE AREA. THIS ADDITIONAL RAIN WILL MAKE MINOR FLOODING.
#end
#if(${list.contains($bullets, "specificPlace")})
MINOR FLOODING IS OCCURRING NEAR !** Enter Location **!.
#end
#if(${list.contains($bullets, "drainages")})
#drainages(${riverdrainages})
#end
## parse file command here is to pull in mile marker info
## #parse("mileMarkers.vm")
#####################
## CALL TO ACTIONS ##
#####################
#foreach ($bullet in $bullets)
#if($bullet.endsWith("CTA"))
#set ($ctaSelected = "YES")
#end
#end
##
#if(${ctaSelected} == "YES")
PRECAUTIONARY/PREPAREDNESS ACTIONS...
#end
#if(${list.contains($bullets, "dontdrownCTA")})
MOST FLOOD DEATHS OCCUR IN AUTOMOBILES. NEVER DRIVE YOUR VEHICLE INTO AREAS WHERE THE WATER COVERS THE ROADWAY. FLOOD WATERS ARE USUALLY DEEPER THAN THEY APPEAR. JUST ONE FOOT OF FLOWING WATER IS POWERFUL ENOUGH TO SWEEP VEHICLES OFF THE ROAD. WHEN ENCOUNTERING FLOODED ROADS MAKE THE SMART CHOICE...TURN AROUND...DONT DROWN.
#end
#if(${list.contains($bullets, "urbanCTA")})
EXCESSIVE RUNOFF FROM HEAVY RAINFALL WILL CAUSE PONDING OF WATER IN URBAN AREAS...HIGHWAYS...STREETS AND UNDERPASSES AS WELL AS OTHER POOR DRAINAGE AREAS AND LOW LYING SPOTS. DO NOT ATTEMPT TO TRAVEL ACROSS FLOODED ROADS. FIND ALTERNATE ROUTES. IT TAKES ONLY A FEW INCHES OF SWIFTLY FLOWING WATER TO CARRY VEHICLES AWAY.
#end
#if(${list.contains($bullets, "ruralCTA")})
EXCESSIVE RUNOFF FROM HEAVY RAINFALL WILL CAUSE FLOODING OF SMALL CREEKS AND STREAMS...AS WELL AS FARM AND COUNTRY ROADS. DO NOT ATTEMPT TO TRAVEL ACROSS FLOODED ROADS. FIND ALTERNATE ROUTES.
#end
#if(${list.contains($bullets, "donotdriveCTA")})
DO NOT DRIVE YOUR VEHICLE INTO AREAS WHERE THE WATER COVERS THE ROADWAY. THE WATER DEPTH MAY BE TOO GREAT TO ALLOW YOUR CAR TO CROSS SAFELY. MOVE TO HIGHER GROUND.
#end
#if(${list.contains($bullets, "lowspotsCTA")})
IN HILLY TERRAIN THERE ARE HUNDREDS OF LOW WATER CROSSINGS WHICH ARE POTENTIALLY DANGEROUS IN HEAVY RAIN. DO NOT ATTEMPT TO TRAVEL ACROSS FLOODED ROADS. FIND ALTERNATE ROUTES. IT TAKES ONLY A FEW INCHES OF SWIFTLY FLOWING WATER TO CARRY VEHICLES AWAY.
#end
#if(${list.contains($bullets, "powerCTA")})
DO NOT UNDERESTIMATE THE POWER OF FLOOD WATERS. ONLY A FEW INCHES OF RAPIDLY FLOWING WATER CAN QUICKLY CARRY AWAY YOUR VEHICLE.
#end
#if(${list.contains($bullets, "reportFloodingCTA")})
TO REPORT FLOODING...HAVE THE NEAREST LAW ENFORCEMENT AGENCY RELAY YOUR REPORT TO THE NATIONAL WEATHER SERVICE FORECAST OFFICE.
#end
#if(${list.contains($bullets, "advisoryMeansCTA")})
A FLOOD ADVISORY MEANS RIVER OR STREAM FLOWS ARE ELEVATED...OR PONDING OF WATER IN URBAN OR OTHER AREAS IS OCCURRING OR IS IMMINENT. DO NOT ATTEMPT TO TRAVEL ACROSS FLOODED ROADS. FIND ALTERNATE ROUTES. IT TAKES ONLY A FEW INCHES OF SWIFTLY FLOWING WATER TO CARRY VEHICLES AWAY.
#end
#if(${ctaSelected} == "YES")
&&
#end
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. DO NOT TAKE ACTION BASED ON THIS MESSAGE.

View file

@ -186,7 +186,12 @@
##########################################
## FLOOD ADVISORY FOLLOW-UP HEADER INFO ##
##########################################
#if(${action}!="CANCON")
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}!="CANCON" && ${CORCAN}!="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FLS${siteId}
@ -412,6 +417,35 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#elseif(${CORCAN} == "true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FLS${siteId}
#if(${productClass}=="T")
TEST...FLOOD ADVISORY...TEST
#else
FLOOD ADVISORY
#end
NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
${ugclinecan}
/${productClass}.COR.${vtecOffice}.FA.Y.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.N.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
@ -545,6 +579,196 @@ A FLOOD ADVISORY MEANS RIVER OR STREAM FLOWS ARE ELEVATED...OR PONDING OF WATER
#end
#################################### END OF CTA STUFF ###################################
#elseif(${CORCAN}=="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FLS${siteId}
#if(${productClass}=="T")
TEST...FLOOD ADVISORY...TEST
#else
FLOOD ADVISORY
#end
NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
${ugclinecan}
/${productClass}.COR.${vtecOffice}.FA.Y.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.N.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#elseif(${CORCAN} == "true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FLS${siteId}
#if(${productClass}=="T")
TEST...FLOOD ADVISORY...TEST
#else
FLOOD ADVISORY
#end
NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
${ugclinecan}
/${productClass}.COR.${vtecOffice}.FA.Y.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.N.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
...THE ${advType} ${hycType}HAS BEEN CANCELLED FOR ##
#headlineLocList(${cancelareas} true true true false)
...##
########### END NEW HEADLINE CODE ####################
## One line explanation - user can delete the one they don't want
## or delete both and explain why manually
!** THE HEAVY RAIN HAS ENDED. THEREFORE...THE FLOODING THREAT HAS ENDED. **!
!** THE FLOOD WATER IS RECEDING. THEREFORE...THE FLOODING THREAT HAS ENDED. **!
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. DO NOT TAKE ACTION BASED ON THIS MESSAGE.
#end
#printcoords(${areaPoly}, ${list})
$$
${ugcline}
/${productClass}.COR.${vtecOffice}.FA.Y.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.N.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
...THE ${advType} REMAINS IN EFFECT UNTIL ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})} FOR ##
## REMMED OUT FOR Alaska
## #headlineLocList(${areas} true true true false)
!**INSERT RIVER/STREAM OR AREA **! IN !**INSERT GEO AREA**!...##
########### END NEW HEADLINE CODE ####################
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. AT ${dateUtil.format(${event}, ${timeFormat.clock}, ${localtimezone})}...!** warning basis **!
#else
AT ${dateUtil.format(${event}, ${timeFormat.clock}, ${localtimezone})}...${report}. ${estimate}
#end
#set ($phenomena = "FLASH FLOOD")
#set ($warningType = "ADVISORY")
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
##locationsList("SOME LOCATIONS THAT WILL EXPERIENCE MINOR FLOODING INCLUDE" "THE FLOODING IS EXPECTED TO IMPACT MAINLY RURAL AREAS OF" 0 ${cityList} ${otherPoints} ${areas} ${dateUtil} ${timeFormat} 0) EXCLUDED FOR ALASKA
#if(${list.contains($bullets, "fcstPoint")})
FOR THE !** insert river name and forecast point **!...
AT ${dateUtil.format(${now}, ${timeFormat.clock}, ${localtimezone})} THE STAGE WAS !** xx.x **! FEET.
FLOOD STAGE IS !** xx.x **! FEET.
FORECAST... !** insert crest stage and time **!.
IMPACTS...!** discussion of expected impacts and flood path **!
#else
!** insert impacts and flood path **!
#end
#if(${list.contains($bullets, "addRainfall")})
ADDITIONAL RAINFALL OF !** Edit Amount **! INCHES IS EXPECTED OVER THE AREA. THIS ADDITIONAL RAIN WILL MAKE MINOR FLOODING.
#end
#if(${list.contains($bullets, "specificPlace")})
MINOR FLOODING IS OCCURRING NEAR !** Enter Location **!.
#end
#if(${list.contains($bullets, "drainages")})
#drainages(${riverdrainages})
#end
#####################
## CALL TO ACTIONS ##
#####################
#foreach ($bullet in $bullets)
#if($bullet.endsWith("CTA"))
#set ($ctaSelected = "YES")
#end
#end
##
#if(${ctaSelected} == "YES")
PRECAUTIONARY/PREPAREDNESS ACTIONS...
#end
#if(${list.contains($bullets, "dontdrownCTA")})
MOST FLOOD DEATHS OCCUR IN AUTOMOBILES. NEVER DRIVE YOUR VEHICLE INTO AREAS WHERE THE WATER COVERS THE ROADWAY. FLOOD WATERS ARE USUALLY DEEPER THAN THEY APPEAR. JUST ONE FOOT OF FLOWING WATER IS POWERFUL ENOUGH TO SWEEP VEHICLES OFF THE ROAD. WHEN ENCOUNTERING FLOODED ROADS MAKE THE SMART CHOICE...TURN AROUND...DONT DROWN.
#end
#if(${list.contains($bullets, "urbanCTA")})
EXCESSIVE RUNOFF FROM HEAVY RAINFALL WILL CAUSE ELEVATED LEVELS ON SMALL CREEKS AND STREAMS...AND PONDING OF WATER IN URBAN AREAS...HIGHWAYS...STREETS AND UNDERPASSES AS WELL AS OTHER POOR DRAINAGE AREAS AND LOW LYING SPOTS.
#end
#if(${list.contains($bullets, "ruralCTA")})
EXCESSIVE RUNOFF FROM HEAVY RAINFALL WILL CAUSE FLOODING OF SMALL CREEKS AND STREAMS...HIGHWAYS AND UNDERPASSES. ADDITIONALLY...COUNTRY ROADS AND FARMLANDS ALONG THE BANKS OF CREEKS...STREAMS AND OTHER LOW LYING AREAS ARE SUBJECT TO FLOODING.
#end
#if(${list.contains($bullets, "donotdriveCTA")})
DO NOT DRIVE YOUR VEHICLE INTO AREAS WHERE THE WATER COVERS THE ROADWAY. THE WATER DEPTH MAY BE TOO GREAT TO ALLOW YOUR CAR TO CROSS SAFELY. MOVE TO HIGHER GROUND.
#end
#if(${list.contains($bullets, "lowspotsCTA")})
IN HILLY TERRAIN THERE ARE HUNDREDS OF LOW WATER CROSSINGS WHICH ARE POTENTIALLY DANGEROUS IN HEAVY RAIN. DO NOT ATTEMPT TO TRAVEL ACROSS FLOODED ROADS. FIND ALTERNATE ROUTES. IT TAKES ONLY A FEW INCHES OF SWIFTLY FLOWING WATER TO CARRY VEHICLES AWAY.
#end
#if(${list.contains($bullets, "powerCTA")})
DO NOT UNDERESTIMATE THE POWER OF FLOOD WATERS. ONLY A FEW INCHES OF RAPIDLY FLOWING WATER CAN QUICKLY CARRY AWAY YOUR VEHICLE.
#end
#if(${list.contains($bullets, "reportFloodingCTA")})
TO REPORT FLOODING...HAVE THE NEAREST LAW ENFORCEMENT AGENCY RELAY YOUR REPORT TO THE NATIONAL WEATHER SERVICE FORECAST OFFICE.
#end
#if(${list.contains($bullets, "advisoryMeansCTA")})
A FLOOD ADVISORY MEANS RIVER OR STREAM FLOWS ARE ELEVATED...OR PONDING OF WATER IN URBAN OR OTHER AREAS IS OCCURRING OR IS IMMINENT. DO NOT ATTEMPT TO TRAVEL ACROSS FLOODED ROADS. FIND ALTERNATE ROUTES. IT TAKES ONLY A FEW INCHES OF SWIFTLY FLOWING WATER TO CARRY VEHICLES AWAY.
#end
#if(${ctaSelected} == "YES")
&&
#end
#end
####################################
## END OF FLOOD ADVISORY PRODUCTS ##

View file

@ -50,6 +50,11 @@ NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}=="CANCON")
${ugclinecan}
################### VTEC/COUNTY LINE ##################
@ -58,6 +63,14 @@ ${ugclinecan}
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#elseif(${CORCAN}=="true")
${ugclinecan}
################### VTEC/COUNTY LINE ##################
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
/00000.0.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#else
${ugcline}
################### VTEC/COUNTY LINE ##################
@ -85,7 +98,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#elseif(${action}=="EXP")
#set($expcanHLTag = "WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}")
#set($expcanBODYTag = "WILL BE ALLOWED TO EXPIRE")
#elseif(${action}=="CAN" || ${action}=="CANCON")
#elseif(${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#set($expcanHLTag = "IS CANCELLED")
#set($expcanBODYTag = "HAS BEEN CANCELLED")
#end
@ -102,7 +115,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#headlineLocList(${areas} true true true false)
${expcanHLTag}...
## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE
#elseif(${action}=="CANCON")
#elseif(${action}=="CANCON" || ${CORCAN}=="true")
...THE FLOOD WARNING FOR ##
#if (${hycType} != "")
<L>${hycType}</L> IN ##
@ -116,7 +129,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#######################################
## EXPIRATION/CANCELLATION BODY ##
#######################################
#if(${action}=="EXP" || ${action} == "CAN" || ${action}=="CANCON")
#if(${action}=="EXP" || ${action} == "CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#if(${list.contains($bullets, "recedingWater")} && ${list.contains($bullets, "rainEnded")})
THE HEAVY RAIN HAS ENDED AND FLOOD WATERS HAVE RECEDED...NO LONGER POSING A THREAT TO LIFE OR PROPERTY. PLEASE CONTINUE TO HEED ANY ROAD CLOSURES.
@ -154,12 +167,28 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#elseif(${CORCAN}=="true")
${ugcline}
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz})}/
/00000.0.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#end
############################
## CONTINUATION STATEMENT ##
############################
#if(${action}=="CANCON" || ${action}=="CON")
#if(${action}=="CANCON" || ${action}=="CON" || ${action}=="COR" || ${CORCAN}=="true")
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end

View file

@ -74,6 +74,11 @@ NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}=="CANCON")
${ugclinecan}
################### VTEC/COUNTY LINE ##################
@ -82,6 +87,14 @@ ${ugclinecan}
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#elseif(${CORCAN}=="true")
${ugclinecan}
################### VTEC/COUNTY LINE ##################
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
/00000.0.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#else
${ugcline}
################### VTEC/COUNTY LINE ##################
@ -110,7 +123,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#elseif(${action}=="EXP")
#set($expcanHLTag = "WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}")
#set($expcanBODYTag = "WILL BE ALLOWED TO EXPIRE")
#elseif(${action}=="CAN" || ${action}=="CANCON")
#elseif(${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#set($expcanHLTag = "IS CANCELLED")
#set($expcanBODYTag = "HAS BEEN CANCELLED")
#end
@ -127,7 +140,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#headlineLocList(${areas} true true true false)
${expcanHLTag}...
## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE
#elseif(${action}=="CANCON")
#elseif(${action}=="CANCON" || ${CORCAN}=="true")
...THE FLOOD WARNING FOR ##
#if (${hycType} != "")
<L>${hycType}</L> IN ##
@ -142,7 +155,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#######################################
## EXPIRATION/CANCELLATION STATEMENT ##
#######################################
#if(${action}=="EXP" || ${action} == "CAN" || ${action}=="CANCON")
#if(${action}=="EXP" || ${action} == "CAN" || ${action}=="CANCON" || ${CORCAN})
#if(${list.contains($bullets, "recedingWater")} && ${list.contains($bullets, "rainEnded")})
THE HEAVY RAIN HAS ENDED AND FLOOD WATERS HAVE RECEDED...NO LONGER POSING A THREAT TO LIFE OR PROPERTY. PLEASE CONTINUE TO HEED ANY ROAD CLOSURES.
#elseif(${list.contains($bullets, "recedingWater")})
@ -175,12 +188,28 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#elseif(${CORCAN}=="true")
${ugcline}
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz})}/
/00000.0.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#end
############################
## CONTINUATION STATEMENT ##
############################
#if(${action}=="CANCON" || ${action}=="CON")
#if(${action}=="CANCON" || ${action}=="CON" || ${action}=="COR" || ${CORCAN}=="true")
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end

View file

@ -5,11 +5,16 @@
################################################
##
### CREATE PHRASING DEPENDING ON WHETHER WE ISSUE EXP PRIOR TO EXPIRATION TIME OR NOT
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${now.compareTo(${expire})} >= 0 && ${action}=="EXP" )
#set($expcanHLTag = "HAS EXPIRED")
#elseif(${action}=="EXP")
#set($expcanHLTag = "WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}")
#elseif(${action}=="CAN" || ${action}=="CANCON")
#elseif(${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#set($expcanHLTag = "IS CANCELLED")
#end
#############
@ -67,7 +72,7 @@ THIS IS A TEST MESSAGE. ##
#############
## EWW CON ##
#############
#if(${action}=="CON" || ${action}=="COR")
#if(${action}=="CON" || (${action}=="COR" && ${CORCAN}=="false"))
##
#set($reportType1 = "ASSOCIATED WITH THE EYEWALL OF HURRICANE !**name**!...WERE MOVING ONSHORE")
#set($reportType = "EXTREME WINDS")
@ -224,7 +229,7 @@ THE SAFEST PLACE TO BE DURING A MAJOR LANDFALLING HURRICANE IS IN A REINFORCED I
#################
## EWW CAN/CON ##
#################
#if(${action}=="CANCON")
#if(${action}=="CANCON" || ${CORCAN}=="true")
##
#set($reportType1 = "ASSOCIATED WITH THE EYEWALL OF HURRICANE !**name**!...WERE MOVING ONSHORE")
#set($reportType = "EXTREME WINDS")

View file

@ -8,7 +8,6 @@
## Modified by MIKE DANGELO 2-23-2012
## Modified by EVAN BOOKBINDER 2-24-2012
## Modified by Phil Kurimski 2-29-2012
## Modified by Mike Rega 05-02-2012 - DR 14885 MND blank line
#################################### SET SOME VARs ###################################
#set ($hycType = "")
#set ($snowMelt = "")
@ -24,7 +23,6 @@
######################################################################################
${WMOId} ${vtecOffice} 000000 ${BBBId}
FFS${siteId}
#if(${productClass}=="T")
TEST...FLASH FLOOD STATEMENT...TEST
#else
@ -34,6 +32,11 @@ NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}=="CANCON")
${ugclinecan}
################### VTEC/COUNTY LINE ##################
@ -42,6 +45,14 @@ ${ugclinecan}
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#elseif(${CORCAN}=="true")
${ugclinecan}
################### VTEC/COUNTY LINE ##################
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
/00000.0.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#else
${ugcline}
################### VTEC/COUNTY LINE ##################
@ -70,7 +81,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#elseif(${action}=="EXP")
#set($expcanHLTag = "WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}")
#set($expcanBODYTag = "WILL BE ALLOWED TO EXPIRE")
#elseif(${action}=="CAN" || ${action}=="CANCON")
#elseif(${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#set($expcanHLTag = "IS CANCELLED")
#set($expcanBODYTag = "HAS BEEN CANCELLED")
#end
@ -86,7 +97,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#headlineLocList(${areas} true true true false)
${expcanHLTag}...
## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE
#elseif(${action}=="CANCON")
#elseif(${action}=="CANCON" || ${CORCAN}=="true")
...THE FLASH FLOOD WARNING FOR ##
#if (${hycType} != "")
<L>${hycType}</L> IN ##
@ -101,7 +112,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
## EXPIRATION/CANCELLATION STATEMENT ##
#######################################
#if(${action}=="EXP" || ${action} == "CAN" || ${action}=="CANCON")
#if(${action}=="EXP" || ${action} == "CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#if(${list.contains($bullets, "rainEnded")})
THE HEAVY RAIN HAS ENDED...AND FLOODING IS NO LONGER EXPECTED TO POSE A THREAT.
@ -134,12 +145,28 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#elseif(${CORCAN}=="true")
${ugcline}
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz})}/
/00000.0.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#end
############################
## CONTINUATION STATEMENT ##
############################
#if(${action}=="CANCON" || ${action}=="CON")
#if(${action}=="CANCON" || ${action}=="CON" || ${action}=="COR" || ${CORCAN}=="true")
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end

View file

@ -6,7 +6,6 @@
## done in August.
## Edited by Mike Dangelo 01-26-2012 at CRH TIM
## Edited by Phil Kurimski 2-29-2012
## Edited by Mike Rega 5-02-2012 DR 14885 MND blank line
#################################### SET SOME VARs ###################################
#set ($hycType = "")
#set ($snowMelt = "")
@ -22,7 +21,6 @@
######################################################################################
${WMOId} ${vtecOffice} 000000 ${BBBId}
FFS${siteId}
#if(${productClass}=="T")
TEST...FLASH FLOOD STATEMENT...TEST
#else
@ -32,6 +30,11 @@ NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}=="CANCON")
${ugclinecan}
################### VTEC/COUNTY LINE ##################
@ -40,6 +43,14 @@ ${ugclinecan}
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#elseif(${CORCAN}=="true")
${ugclinecan}
################### VTEC/COUNTY LINE ##################
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
/00000.0.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#else
${ugcline}
################### VTEC/COUNTY LINE ##################
@ -68,7 +79,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#elseif(${action}=="EXP")
#set($expcanHLTag = "WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}")
#set($expcanBODYTag = "WILL BE ALLOWED TO EXPIRE")
#elseif(${action}=="CAN" || ${action}=="CANCON")
#elseif(${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#set($expcanHLTag = "IS CANCELLED")
#set($expcanBODYTag = "HAS BEEN CANCELLED")
#end
@ -84,7 +95,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#headlineLocList(${areas} true true true false)
${expcanHLTag}...
## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE
#elseif(${action}=="CANCON")
#elseif(${action}=="CANCON" || ${CORCAN}=="true")
...THE FLASH FLOOD WARNING FOR ##
#if (${hycType} != "")
<L>${hycType}</L> IN ##
@ -99,7 +110,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
## EXPIRATION/CANCELLATION STATEMENT ##
#######################################
#if(${action}=="EXP" || ${action} == "CAN" || ${action}=="CANCON")
#if(${action}=="EXP" || ${action} == "CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#if(${list.contains($bullets, "recedingWater")})
FLOOD WATERS HAVE RECEDED...AND ARE NO LONGER EXPECTED TO POSE A THREAT TO LIFE OR PROPERTY. PLEASE CONTINUE TO HEED ANY ROAD CLOSURES.
#elseif(${list.contains($bullets, "rainEnded")})
@ -131,12 +142,28 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#elseif(${CORCAN})
${ugcline}
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz})}/
/00000.0.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#end
############################
## CONTINUATION STATEMENT ##
############################
#if(${action}=="CANCON" || ${action}=="CON")
#if(${action}=="CANCON" || ${action}=="CON" || ${action}=="COR" || ${CORCAN}=="true")
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end

View file

@ -83,12 +83,23 @@ NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}=="CANCON")
${ugclinecan}
/${productClass}.CAN.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#elseif(${CORCAN}=="true")
${ugclinecan}
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#else
${ugcline}
/${productClass}.${action}.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
@ -120,7 +131,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#elseif(${action}=="EXP")
#set($expcanHLTag = "WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}")
#set($expcanBODYTag = "WILL BE ALLOWED TO EXPIRE")
#elseif(${action}=="CAN" || ${action}=="CANCON")
#elseif(${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#set($expcanHLTag = "IS CANCELLED")
#set($expcanBODYTag = "HAS BEEN CANCELLED")
#end
@ -133,7 +144,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#headlineLocList(${areas} true true true false)
${expcanHLTag}...
## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE
#elseif(${action}=="CANCON")
#elseif(${action}=="CANCON" || ${CORCAN}=="true")
...THE ${eventType} WARNING FOR ##
#headlineLocList(${cancelareas} true true true false)
${expcanHLTag}...
@ -145,7 +156,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#########################################
## NOW LETS FORGE OUR CAN/EXP STATEMENTS#
#########################################
#if(${action}=="EXP" || ${action}=="CAN" || ${action}=="CANCON")
#if(${action}=="EXP" || ${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#### SET A DEFAULT STATEMENT IN CASE NO BULLET WAS SELECTED OR AVAILABLE
#if(${stormType} == "line")
#set($expcanPhrase = "THE LINE OF STORMS WHICH PROMPTED THE WARNING HAVE !** WEAKENED/MOVED OUT OF THE WARNED AREA **!. THEREFORE THE WARNING ${expcanBODYTag}.")
@ -330,8 +341,23 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#elseif(${CORCAN}=="true")
${ugcline}
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz})}/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
#if(${action}=="CANCON" || ${action}=="CON")
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#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)
...##

View file

@ -174,7 +174,12 @@
####################################
## DAM BREAK FFW FOLLOW-UP HEADER ##
####################################
#if(${action}!="CANCON")
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}!="CANCON" && ${CORCAN}!="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FFS${siteId}
@ -217,7 +222,7 @@ ${endwarning}
#######################
## DAM BREAK FFW CON ##
#######################
#if(${action}=="CON")
#if(${action}=="CON" || (${action}=="COR" && ${CORCAN}=="false"))
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
@ -556,6 +561,195 @@ TO REPORT FLOODING...HAVE THE NEAREST LAW ENFORCEMENT AGENCY RELAY YOUR REPORT T
&&
#end
#elseif(${CORCAN}=="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FFS${siteId}
#if(${productClass}=="T")
TEST...FLASH FLOOD STATEMENT...TEST
#else
FLASH FLOOD STATEMENT
#end
NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
${ugclinecan}
/${productClass}.COR.${vtecOffice}.FF.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.${floodseverity}.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
...THE FLASH FLOOD WARNING ${headline}HAS BEEN CANCELLED FOR ##
#headlineLocList(${cancelareas} true true true false)
...##
########### END NEW HEADLINE CODE ####################
## Explanation
${endwarning}
#printcoords(${areaPoly}, ${list})
$$
${ugcline}
/${productClass}.COR.${vtecOffice}.FF.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.${floodseverity}.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
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)
...##
########### END NEW HEADLINE CODE ####################
###############################################################################
## Flash Flood Emergency per NWS 10-922 Directive goes after initial headline #
###############################################################################
#if(${list.contains($bullets, "ffwEmergency")})
...THIS IS A FLASH FLOOD EMERGENCY FOR !**ENTER LOCATION**!...
#end
#####################################################
## Changed report to match selections in template
#####################################################
#set ($report = "${reportType1}")
#if(${list.contains($bullets, "county")})
#set ($report = "COUNTY DISPATCH REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "lawEnforcement")})
#set ($report = "LOCAL LAW ENFORCEMENT REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "corps")})
#set ($report = "CORPS OF ENGINEERS REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "damop")})
#set ($report = "DAM OPERATORS REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "bureau")})
#set ($report = "BUREAU OF RECLAMATION REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "public")})
#set ($report = "THE PUBLIC REPORTED ${reportType1}")
#end
## Storm current location description
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#thirdBullet(${dateUtil},${event},${timeFormat},${localtimezone},${secondtimezone}) ${report}.
#set ($phenomena = "FLASH FLOOD")
#set ($warningType = "WARNING")
##########################################################################
## Optional 4th bullet...comment out if needed.
##########################################################################
## This first if loop will override the locations impacted statement
## with the site specific information in the 4th bullet.
##########################################################################
#if (${sitespecSelected} == "YES")
${addInfo}
${scenario}
${ruleofthumb}
##########################################################################
## Continue with the regular 4th bullet information
##########################################################################
#elseif(${list.contains($bullets, "pathcast")})
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#pathCast("THE FLOOD WILL BE NEAR..." "THIS FLOODING" ${pathCast} ${otherPoints} ${areas} ${dateUtil} ${timeFormat})
#elseif(${list.contains($bullets, "listofcities")})
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#### THE THIRD ARGUMENT IS A NUMBER SPECIFYING THE NUMBER OF COLUMNS TO OUTPUT THE CITIES LIST IN
#### 0 IS A ... SEPARATED LIST, 1 IS ONE PER LINE, >1 IS A COLUMN FORMAT
#### IF YOU USE SOMETHING OTHER THAN "LOCATIONS IMPACTED INCLUDE" LEAD IN BELOW, MAKE SURE THE
#### ACCOMPANYING XML FILE PARSE STRING IS CHANGED TO MATCH!
#locationsList("LOCATIONS IMPACTED INCLUDE..." "THIS FLOODING WILL AFFECT MAINLY RURAL AREAS OF" 0 ${cityList} ${otherPoints} ${areas} ${dateUtil} ${timeFormat})
#end
############################ End of Optional 4th Bullet ###########################
#if(${list.contains($bullets, "drainages")})
#drainages(${riverdrainages})
#end
#####################
## CALL TO ACTIONS ##
#####################
#######################################################################
## Check to see if we've selected any calls to action. In our .xml file
## we ended each CTA bullet ID with "CTA" for this reason as a 'trip'
#######################################################################
#foreach ($bullet in $bullets)
#if ($bullet.endsWith("CTA"))
#set ($ctaSelected = "YES")
#end
#end
##
#if (${ctaSelected} == "YES")
PRECAUTIONARY/PREPAREDNESS ACTIONS...
#end
##
${sitespecCTA}
${volcanoCTA}
#if(${list.contains($bullets, "floodMovingCTA")})
FLOOD WATERS ARE MOVING DOWN !**name of channel**! FROM !**location**! TO !**location**!. THE FLOOD CREST IS EXPECTED TO REACH !**location(s)**! BY !**time(s)**!.
#end
#if(${list.contains($bullets, "taddCTA")})
MOST FLOOD DEATHS OCCUR IN AUTOMOBILES. NEVER DRIVE YOUR VEHICLE INTO AREAS WHERE THE WATER COVERS THE ROADWAY. FLOOD WATERS ARE USUALLY DEEPER THAN THEY APPEAR. JUST ONE FOOT OF FLOWING WATER IS POWERFUL ENOUGH TO SWEEP VEHICLES OFF THE ROAD. WHEN ENCOUNTERING FLOODED ROADS MAKE THE SMART CHOICE...TURN AROUND...DONT DROWN.
#end
#if(${list.contains($bullets, "nighttimeCTA")})
BE ESPECIALLY CAUTIOUS AT NIGHT WHEN IT IS HARDER TO RECOGNIZE THE DANGERS OF FLOODING. IF FLOODING IS OBSERVED ACT QUICKLY. MOVE UP TO HIGHER GROUND TO ESCAPE FLOOD WATERS. DO NOT STAY IN AREAS SUBJECT TO FLOODING WHEN WATER BEGINS RISING.
#end
#if(${list.contains($bullets, "vehicleCTA")})
DO NOT DRIVE YOUR VEHICLE INTO AREAS WHERE THE WATER COVERS THE ROADWAY. THE WATER DEPTH MAY BE TOO GREAT TO ALLOW YOUR CAR TO CROSS SAFELY. MOVE TO HIGHER GROUND.
#end
#if(${list.contains($bullets, "warningMeansCTA")})
A FLASH FLOOD WARNING MEANS FLASH FLOODING IS OCCURRING OR IS IMMINENT. MOST FLOOD RELATED DEATHS OCCUR IN AUTOMOBILES. DO NOT ATTEMPT TO CROSS WATER COVERED BRIDGES...DIPS...OR LOW WATER CROSSINGS. NEVER TRY TO CROSS A FLOWING STREAM...EVEN A SMALL ONE...ON FOOT. TO ESCAPE RISING WATER MOVE UP TO HIGHER GROUND.
#end
#if(${list.contains($bullets, "powerFloodCTA")})
DO NOT UNDERESTIMATE THE POWER OF FLOOD WATERS. ONLY A FEW INCHES OF RAPIDLY FLOWING WATER CAN QUICKLY CARRY AWAY YOUR VEHICLE.
#end
#if(${list.contains($bullets, "reportCTA")})
TO REPORT FLOODING...HAVE THE NEAREST LAW ENFORCEMENT AGENCY RELAY YOUR REPORT TO THE NATIONAL WEATHER SERVICE FORECAST OFFICE.
#end
#if (${ctaSelected} == "YES")
&&
#end
#end
#######################
## DAM BREAK FFW EXP ##

View file

@ -174,7 +174,12 @@
####################################
## DAM BREAK FFW FOLLOW-UP HEADER ##
####################################
#if(${action}!="CANCON")
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}!="CANCON" && ${CORCAN}!="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FFS${siteId}
@ -217,7 +222,7 @@ ${endwarning}
#######################
## DAM BREAK FFW CON ##
#######################
#if(${action}=="CON")
#if(${action}=="CON" || (${action}=="COR" && ${CORCAN}=="false"))
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
@ -555,6 +560,199 @@ TO REPORT FLOODING...HAVE THE NEAREST LAW ENFORCEMENT AGENCY RELAY YOUR REPORT T
&&
#end
#elseif(${CORCAN}=="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
FFS${siteId}
#if(${productClass}=="T")
TEST...FLASH FLOOD STATEMENT...TEST
#else
FLASH FLOOD STATEMENT
#end
NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
${ugclinecan}
/${productClass}.COR.${vtecOffice}.FF.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.${floodseverity}.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
...THE FLASH FLOOD WARNING ${headline}HAS BEEN CANCELLED FOR ##
#headlineLocList(${cancelareas} true true true false)
...##
########### END NEW HEADLINE CODE ####################
## Explanation
${endwarning}
#printcoords(${areaPoly}, ${list})
$$
${ugcline}
/${productClass}.COR.${vtecOffice}.FF.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
/00000.${floodseverity}.${ic}.000000T0000Z.000000T0000Z.000000T0000Z.OO/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
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)
...##
########### END NEW HEADLINE CODE ####################
###############################################################################
## Flash Flood Emergency per NWS 10-922 Directive goes after initial headline #
###############################################################################
#if(${list.contains($bullets, "ffwEmergency")})
...THIS IS A FLASH FLOOD EMERGENCY FOR !**ENTER LOCATION**!...
#end
#####################################################
## Changed report to match selections in template
#####################################################
#set ($report = "${reportType1}")
#if(${list.contains($bullets, "county")})
#set ($report = "COUNTY DISPATCH REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "lawEnforcement")})
#set ($report = "LOCAL LAW ENFORCEMENT REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "corps")})
#set ($report = "CORPS OF ENGINEERS REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "damop")})
#set ($report = "DAM OPERATORS REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "bureau")})
#set ($report = "BUREAU OF RECLAMATION REPORTED ${reportType1}")
#end
#if(${list.contains($bullets, "public")})
#set ($report = "THE PUBLIC REPORTED ${reportType1}")
#end
## Storm current location description
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#thirdBullet(${dateUtil},${event},${timeFormat},${localtimezone},${secondtimezone}) ${report}.
#set ($phenomena = "FLASH FLOOD")
#set ($warningType = "WARNING")
##########################################################################
## Optional 4th bullet...comment out if needed.
##########################################################################
## This first if loop will override the locations impacted statement
## with the site specific information in the 4th bullet.
##########################################################################
#if (${sitespecSelected} == "YES")
${addInfo}
${scenario}
${ruleofthumb}
##########################################################################
## Continue with the regular 4th bullet information
##########################################################################
#elseif(${list.contains($bullets, "pathcast")})
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#pathCast("THE FLOOD WILL BE NEAR..." "THIS FLOODING" ${pathCast} ${otherPoints} ${areas} ${dateUtil} ${timeFormat})
#elseif(${list.contains($bullets, "listofcities")})
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#### THE THIRD ARGUMENT IS A NUMBER SPECIFYING THE NUMBER OF COLUMNS TO OUTPUT THE CITIES LIST IN
#### 0 IS A ... SEPARATED LIST, 1 IS ONE PER LINE, >1 IS A COLUMN FORMAT
#### IF YOU USE SOMETHING OTHER THAN "LOCATIONS IMPACTED INCLUDE" LEAD IN BELOW, MAKE SURE THE
#### ACCOMPANYING XML FILE PARSE STRING IS CHANGED TO MATCH!
#locationsList("LOCATIONS IMPACTED INCLUDE..." "THIS FLOODING" 0 ${cityList} ${otherPoints} ${areas} ${dateUtil} ${timeFormat})
#end
############################ End of Optional 4th Bullet ###########################
#if(${list.contains($bullets, "drainages")})
#drainages(${riverdrainages})
#end
## parse file command here is to pull in mile marker info
## #parse("mileMarkers.vm")
#if(${list.contains($bullets, "floodMoving")})
FLOOD WATERS ARE MOVING DOWN !**name of channel**! FROM !**location**! TO !**location**!. THE FLOOD CREST IS EXPECTED TO REACH !**location(s)**! BY !**time(s)**!.
#end
#####################
## CALL TO ACTIONS ##
#####################
#######################################################################
## Check to see if we've selected any calls to action. In our .xml file
## we ended each CTA bullet ID with "CTA" for this reason as a 'trip'
#######################################################################
#foreach ($bullet in $bullets)
#if ($bullet.endsWith("CTA"))
#set ($ctaSelected = "YES")
#end
#end
##
#if (${ctaSelected} == "YES")
PRECAUTIONARY/PREPAREDNESS ACTIONS...
#end
##
${sitespecCTA}
${volcanoCTA}
#if(${list.contains($bullets, "taddCTA")})
MOST FLOOD DEATHS OCCUR IN AUTOMOBILES. NEVER DRIVE YOUR VEHICLE INTO AREAS WHERE THE WATER COVERS THE ROADWAY. FLOOD WATERS ARE USUALLY DEEPER THAN THEY APPEAR. JUST ONE FOOT OF FLOWING WATER IS POWERFUL ENOUGH TO SWEEP VEHICLES OFF THE ROAD. WHEN ENCOUNTERING FLOODED ROADS MAKE THE SMART CHOICE...TURN AROUND...DONT DROWN.
#end
#if(${list.contains($bullets, "nighttimeCTA")})
BE ESPECIALLY CAUTIOUS AT NIGHT WHEN IT IS HARDER TO RECOGNIZE THE DANGERS OF FLOODING. IF FLOODING IS OBSERVED ACT QUICKLY. MOVE UP TO HIGHER GROUND TO ESCAPE FLOOD WATERS. DO NOT STAY IN AREAS SUBJECT TO FLOODING WHEN WATER BEGINS RISING.
#end
#if(${list.contains($bullets, "vehicleCTA")})
DO NOT DRIVE YOUR VEHICLE INTO AREAS WHERE THE WATER COVERS THE ROADWAY. THE WATER DEPTH MAY BE TOO GREAT TO ALLOW YOUR CAR TO CROSS SAFELY. MOVE TO HIGHER GROUND.
#end
#if(${list.contains($bullets, "warningMeansCTA")})
A FLASH FLOOD WARNING MEANS FLASH FLOODING IS OCCURRING OR IS IMMINENT. MOST FLOOD RELATED DEATHS OCCUR IN AUTOMOBILES. DO NOT ATTEMPT TO CROSS WATER COVERED BRIDGES...DIPS...OR LOW WATER CROSSINGS. NEVER TRY TO CROSS A FLOWING STREAM...EVEN A SMALL ONE...ON FOOT. TO ESCAPE RISING WATER MOVE UP TO HIGHER GROUND.
#end
#if(${list.contains($bullets, "powerFloodCTA")})
DO NOT UNDERESTIMATE THE POWER OF FLOOD WATERS. ONLY A FEW INCHES OF RAPIDLY FLOWING WATER CAN QUICKLY CARRY AWAY YOUR VEHICLE.
#end
#if(${list.contains($bullets, "reportCTA")})
TO REPORT FLOODING...HAVE THE NEAREST LAW ENFORCEMENT AGENCY RELAY YOUR REPORT TO THE NATIONAL WEATHER SERVICE FORECAST OFFICE.
#end
#if (${ctaSelected} == "YES")
&&
#end
#end
#######################
## DAM BREAK FFW EXP ##

View file

@ -57,12 +57,23 @@ NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}=="CANCON")
${ugclinecan}
/${productClass}.CAN.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#elseif(${CORCAN}=="true")
${ugclinecan}
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
#foreach (${area} in ${cancelareas})
${area.name} ${area.stateabbr}-##
#end
#else
${ugcline}
/${productClass}.${action}.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire},${timeFormat.ymdthmz})}/
@ -94,7 +105,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#elseif(${action}=="EXP")
#set($expcanHLTag = "WILL EXPIRE AT ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}")
#set($expcanBODYTag = "WILL BE ALLOWED TO EXPIRE")
#elseif(${action}=="CAN" || ${action}=="CANCON")
#elseif(${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#set($expcanHLTag = "IS CANCELLED")
#set($expcanBODYTag = "HAS BEEN CANCELLED")
#end
@ -107,7 +118,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#headlineLocList(${areas} true true true false)
${expcanHLTag}...
## SLIGHTLY DIFFERENT VARIABLE FOR PARTIAL CANCELLATION HEADLINE
#elseif(${action}=="CANCON")
#elseif(${action}=="CANCON" || ${CORCAN}=="true")
...THE ${eventType} WARNING FOR ##
#headlineLocList(${cancelareas} true true true false)
${expcanHLTag}...
@ -119,7 +130,7 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#########################################
## NOW LETS FORGE OUR CAN/EXP STATEMENTS#
#########################################
#if(${action}=="EXP" || ${action}=="CAN" || ${action}=="CANCON")
#if(${action}=="EXP" || ${action}=="CAN" || ${action}=="CANCON" || ${CORCAN}=="true")
#### SET A DEFAULT STATEMENT IN CASE NO BULLET WAS SELECTED OR AVAILABLE
#if(${stormType} == "line")
#set($expcanPhrase = "THE LINE OF STORMS WHICH PROMPTED THE WARNING HAVE !** WEAKENED/MOVED OUT OF THE WARNED AREA **!. THEREFORE THE WARNING ${expcanBODYTag}.")
@ -304,8 +315,23 @@ ${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#elseif(${CORCAN}=="true")
${ugcline}
/${productClass}.COR.${vtecOffice}.${phenomena}.W.${etn}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz})}/
#foreach (${area} in ${areas})
${area.name} ${area.stateabbr}-##
#end
#if(${action}=="CANCON" || ${action}=="CON")
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#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)
...##

View file

@ -40,10 +40,14 @@
## HEADER FOR NON-CAN/CON PRODUCTS
#######################################################################
##
#if(${action}!="CANCON")
#if(${action}=="COR" && ${cancelareas})
#set($CORCAN = "true")
#else
#set($CORCAN = "false")
#end
#if(${action}!="CANCON" && ${CORCAN}!="true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
MWS${siteId}
#if(${productClass}=="T")
TEST...MARINE WEATHER STATEMENT...TEST
#else
@ -147,7 +151,7 @@ ${canwarning}
## Removed Strong and Severe Thunderstorm selections and placed logic in the
## wind and hail selections that will change wording for Severe Thunderstorms.
#######################################################################
#if(${action}=="CON" || ${action}=="COR")
#if(${action}=="CON" || (${action}=="COR" && ${CORCAN}=="false"))
#set ($eventType = "THUNDERSTORM")
#if(${list.contains($bullets, "thunderstorm")})
#set ($eventType = "THUNDERSTORM")
@ -479,7 +483,6 @@ REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY
#if(${action}=="CANCON")
${WMOId} ${vtecOffice} 000000 ${BBBId}
MWS${siteId}
#if(${productClass}=="T")
TEST...MARINE WEATHER STATEMENT...TEST
#else
@ -877,6 +880,419 @@ FREQUENT LIGHTNING IS OCCURRING WITH THIS STORM. IF CAUGHT ON THE OPEN WATER ST
#if(${list.contains($bullets, "reportCTA")})
REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY WILL RELAY YOUR REPORT TO THE NATIONAL WEATHER SERVICE OFFICE.
#end
#if (${ctaSelected} == "YES")
&&
#end
#############
## WATCHES ##
#############
#if(${list.contains($includedWatches, "torWatches")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains($includedWatches, "svrWatches")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#elseif(${CORCAN} == "true")
${WMOId} ${vtecOffice} 000000 ${BBBId}
MWS${siteId}
#if(${productClass}=="T")
TEST...MARINE WEATHER STATEMENT...TEST
#else
MARINE WEATHER STATEMENT
#end
NATIONAL WEATHER SERVICE ${officeShort}
#backupText(${backupSite})
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
${ugclinecan}
/${productClass}.COR.${vtecOffice}.MA.W.${oldvtec}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
...THE ${warningType} IS CANCELLED...
THE AFFECTED AREAS WERE...
#foreach (${area} in ${cancelareas})
${area.name}...
#end
######################################################################
## Setup eventType for wording in the End of Warning Statement
######################################################################
#set($stormline = " HAS")
#set($pose = "POSES")
#if(${stormType} == "line")
#set($stormline = "S HAVE")
#set($pose = "POSE")
#end
#set ($eventType = "!**STORMS**! HAVE")
#if(${list.contains($bullets, "event1")})
#set ($eventType = "THUNDERSTORM${stormline}")
#end
#if(${list.contains($bullets, "event3")})
#set ($eventType = "SHOWER${stormline}")
#end
#if(${list.contains($bullets, "event4")})
#set ($eventType = "CLOUD${stormline}")
#end
#if(${list.contains($bullets, "event5")})
#set ($eventType = "FRONT HAS")
#set ($pose = "POSES")
#end
#######################################################################
## Replaced default end of warning wording.
#######################################################################
THE ${eventType} !**WEAKENED/MOVED OUT OF THE AREA**! AND NO LONGER ${pose} A SIGNIFICANT THREAT TO BOATERS.
#############
## WATCHES ##
#############
#if(${list.contains($includedWatches, "torWatches")})
#inserttorwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${list.contains($includedWatches, "svrWatches")})
#insertsvrwatches(${watches}, ${list}, ${secondtimezone}, ${dateUtil}, ${timeFormat})
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. DO NOT TAKE ACTION BASED ON THIS MESSAGE.
#end
#printcoords(${areaPoly}, ${list})
TIME...MOT...LOC ##
${dateUtil.format(${event}, ${timeFormat.time})}Z ##
${mathUtil.round(${movementDirection})}DEG ##
${mathUtil.round(${movementInKnots})}KT ##
#foreach(${eventCoord} in ${eventLocation})
#llFormat(${eventCoord.y}) #llFormat(${eventCoord.x}) ##
#end
$$
${ugcline}
/${productClass}.COR.${vtecOffice}.MA.W.${oldvtec}.000000T0000Z-${dateUtil.format(${expire}, ${timeFormat.ymdthmz}, 15)}/
${dateUtil.format(${now}, ${timeFormat.header}, ${localtimezone})}
#if(${productClass}=="T")
...THIS MESSAGE IS FOR TEST PURPOSES ONLY...
#end
#######################################################################
## List of Event Types. Added several events such as Shower...Cloud and Front.
## Removed Strong and Severe Thunderstorm selections and placed logic in the
## wind and hail selections that will change wording for Severe Thunderstorms.
#######################################################################
#set ($eventType = "THUNDERSTORM")
#if(${list.contains($bullets, "thunderstorm")})
#set ($eventType = "THUNDERSTORM")
#set ($severeType = "STRONG")
#end
#if(${list.contains($bullets, "shower")})
#set ($eventType = "SHOWER")
#end
#if(${list.contains($bullets, "cloud")})
#set ($eventType = "CLOUD")
#end
#if(${list.contains($bullets, "front")})
#set ($eventType = "FRONT")
#end
#if(${list.contains($bullets, "volcano")})
#set ($eventType = "VOLCANO")
#end
#######################################################################
## Added a Threat Section to template that includes Wind...Hail and Waterspout selections.
## Strong Thunderstorm will change to Severe Thunderstorm automatically based on
## selections in Wind...Hail and Waterspout sections.
#######################################################################
#set ($windTag = "<34")
#if(${list.contains($bullets, "34ktWind")})
#set ($windTag = ">34")
#set ($windType = "STRONG WINDS 34 KNOTS OR GREATER")
#end
#if(${list.contains($bullets, "40ktWind")})
#set ($windTag = "40")
#set ($windType = "STRONG WINDS TO 40 KNOTS")
#end
#if(${list.contains($bullets, "40ktplusWind")})
#set ($windTag = "40")
#set ($windType = "STRONG WINDS TO NEARLY 50 KNOTS")
#end
#if(${list.contains($bullets, "50ktWind")})
#set ($windTag = "50")
#set ($windType = "DANGEROUS WINDS IN EXCESS OF 50 KNOTS")
#set ($severeType = "SEVERE")
#end
#if(${list.contains($bullets, "65ktWind")})
#set ($windTag = "65")
#set ($windType = "DANGEROUS CAPSIZING WINDS IN EXCESS OF 65 KNOTS")
#set ($severeType = "SEVERE")
#end
#set ($hailTag = "0.00")
#if(${list.contains($bullets, "smallHail")})
#set ($hailTag = "<.75")
#set ($hailType = "SMALL HAIL")
#end
#if(${list.contains($bullets, "largeHail")})
#set ($hailTag = ">.75")
#set ($hailType = "LARGE HAIL")
#set ($severeType = "SEVERE")
#end
#if(${list.contains($bullets, "destructiveHail")})
#set ($hailTag = ">2.0")
#set ($hailType = "LARGE DESTRUCTIVE HAIL")
#set ($severeType = "SEVERE")
#end
#if(${list.contains($bullets, "sightedSpout")})
#set ($spoutType = "WATERSPOUTS")
#set ($severeType = "SEVERE")
#end
#if(${list.contains($bullets, "possibleSpout")})
#set ($spoutType = "WATERSPOUTS")
#set ($capable = "CAPABLE OF ")
#end
################################################
## Threat section for Volcanic Situations
################################################
#if(${list.contains($bullets, "ashfall")})
#set ($ashfallType = "ASHFALL")
#set ($ashfallPath = "VOLCANIC ASH")
#set ($ctaSelected = "YES")
#set ($ashfallCTA = "ASH IS AN EYE AND RESPIRATORY IRRITANT AND IS ABRASIVE. THOSE WITH RESPIRATORY SENSITIVITIES SHOULD TAKE EXTRA PRECAUTIONS TO MINIMIZE EXPOSURE. PROTECT ELECTRONICS AND COVER AIR INTAKES IF ASHFALL IS EXPECTED OR CONFIRMED. REMOVE ASH FROM SURFACES WITH WATER IF POSSIBLE TO PREVENT EXCESSIVE ACCUMULATION.")
#set ($ashfallInfo = "AN ASHFALL WARNING MEANS THAT THE VOLCANO IS UNDERGOING A MAJOR ERUPTION. IT IS VERY LIKELY THAT MARINERS WILL BE AFFECTED BY VOLCANIC HAZARDS IN THE WARNING AREAS SUCH AS SIGNIFICANT DEBRIS...ASHFALL ONE QUARTER INCH OR GREATER...LAVA...OR LAHAR AND DEBRIS FLOWS.")
#end
#if(${list.contains($bullets, "debrisFlow")})
#set ($debrisflowType = "DEBRIS FLOW")
#set ($debrisflowPath = "DEBRIS FLOW")
#set ($debrisflowInfo = "THE ERUPTION OF THE VOLCANO CAN CAUSE A SUDDEN MELTING OF SNOW AND ICE ON THE MOUNTAIN. THIS WILL RESULT IN A TORRENT OF MUD...ASH...ROCK...AND HOT WATER TO FLOW DOWN THE MOUNTAIN AND INTO THE NEARBY WATERS.")
#end
#######################################################################
## Logic to create the Wind/Hail Tags used by CR.
#######################################################################
#set ($windhailTag = "WIND...HAIL ${windTag}KTS ${hailTag}IN")
#######################################################################
## Logic to put together the threats based on Wind...Hail and Waterspout sections.
#######################################################################
#if(${spoutType} && ${windType} && ${hailType})
#set ($threat = "${spoutType}...${windType} AND ${hailType}")
#elseif(${spoutType} && ${hailType})
#set ($threat = "${spoutType} AND ${hailType}")
#elseif(${spoutType} && ${windType})
#set ($threat = "${spoutType} AND ${windType}")
#elseif(${windType} && ${hailType})
#set ($threat = "${windType} AND ${hailType}")
#elseif(${spoutType})
#set ($threat = "${spoutType}")
#elseif(${windType})
#set ($threat = "${windType}")
#elseif(${hailType})
#set ($threat = "${hailType}")
#else
#set ($threat = "!**YOU DID NOT SELECT ANY THREATS. PLEAST RE-GENERATE THIS WARNING!**!")
#end
#######################################################################
## Logic for Volcanic Threats. If selected this will override any
## other selections for wind/hail/spouts.
#######################################################################
#if(${ashfallType} && ${debrisflowType})
#set ($threat = "${ashfallType} AND ${debrisflowType}")
#set ($volcanoPath = "${ashfallPath} AND ${debrisflowPath}")
#elseif(${ashfallType})
#set ($threat = "${ashfallType}")
#set ($volcanoPath = "${ashfallPath}")
#elseif(${debrisflowType})
#set ($threat = "${debrisflowType}")
#set ($volcanoPath = "${debrisflowPath}")
#else
#end
#######################################################################
## Section to determine Thunderstorm Severity based on Threat Selections.
#######################################################################
#if(${eventType} == "THUNDERSTORM")
#set($thunderstormType = "${severeType} ${eventType}")
#set($eventType = "${thunderstormType}")
#end
#######################################################################
## Section to create line wording based on track type.
#######################################################################
#set($stormline = "A ${eventType}")
#set($pathheader = "${eventType}")
#if(${stormType} == "line")
#set($stormline = "A LINE OF ${eventType}S")
#set($pathheader = "${eventType}S")
#end
#######################################################################
##Corrective coding to prevent the use of "Line of Fronts" in the Product.
#######################################################################
#if(${eventType} == "FRONT")
#set($stormline = "A ${eventType}")
#set($pathheader = "${eventType}")
## #set($stormType = "")
#end
#######################################################################
## Coding for volcanos...this will override all other selections.
#######################################################################
#set($impacted = "LOCATIONS IMPACTED INCLUDE...")
#if(${eventType} == "VOLCANO")
#set($stormline = "!** NAME OF VOLCANO**! ${eventType}")
#set($pathheader = "THE ${volcanoPath}")
## #set($stormType = "")
#set($impacted = "LOCATIONS IMPACTED BY ${volcanoPath} INCLUDE...")
#end
#######################################################################
## Basis section that incorporates line phenomena...capable vs producing
## and threat based on selections above. Added Satellite Imagery to basis.
#######################################################################
#set ($report = "!** YOU DIDN'T SELECT A REPORTER **! ${eventType}")
#if(${list.contains($bullets, "doppler")})
#set ($capable = "CAPABLE OF ")
#set ($report = "NATIONAL WEATHER SERVICE DOPPLER RADAR INDICATED ${stormline}...${capable}PRODUCING ${threat}...")
#end
#if(${list.contains($bullets, "marineSpotter")})
#set ($report = "MARINE WEATHER SPOTTERS REPORTED ${stormline}...${capable}PRODUCING ${threat}...")
#end
#if(${list.contains($bullets, "mariner")})
#set ($report = "A MARINER REPORTED ${stormline}...${capable}PRODUCING ${threat}...")
#end
#if(${list.contains($bullets, "public")})
#set ($report = "THE PUBLIC REPORTED ${stormline}...${capable}PRODUCING ${threat}...")
#end
#if(${list.contains($bullets, "pilot")})
#set ($report = "A PILOT REPORTED ${stormline}...${capable}PRODUCING ${threat}...")
#end
#if(${list.contains($bullets, "satellite")})
#set ($capable = "CAPABLE OF ")
#set ($report = "SATELLITE IMAGERY INDICATED ${stormline}...${capable}PRODUCING ${threat}...")
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE.##
#end
########################################################################
## Altered continuation headline for cleaner wording and to match NWS Directive 10-314
########################################################################
...A${ashCON} ${warningType} REMAINS IN EFFECT #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone})...
FOR THE FOLLOWING AREAS...
#foreach (${area} in ${areas})
${area.name}...
#end
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
AT ${dateUtil.format(${event}, ${timeFormat.clock}, ${localtimezone})}... ${report} LOCATED ##
#handleClosestPoints($list, $closestPoints, $otherClosestPoints, $stormType, "OVER", 4, "NM", true)
#if(${eventType} == "VOLCANO")
.
#elseif($movementSpeed < 3 || ${stationary})
. ${reportType2} NEARLY STATIONARY.
#else
...MOVING #direction(${movementDirectionRounded}) AT ${mathUtil.roundTo5(${movementSpeed})} KNOTS.
#end
${ashfallInfo}
${debrisflowInfo}
#############################################
######## GENERATE ADDITIONAL REPORTS #######
#############################################
#if(${list.contains($bullets, "addlRpt")})
IN ADDITION...AT !**enter time, phenomena**! WAS REPORTED !**enter location**!.
#end
###################################################
######## GENERATE PATHCAST OR CITIES LIST #########
###################################################
#set ($eventType = "${pathheader}")
#set ($warningType = "WARNING")
#if(${list.contains($bullets, "pathcast")})
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#pathCast("${eventType} WILL BE NEAR..." ${eventType} ${pathCast} ${otherPoints} ${areas} ${dateUtil} ${timeFormat} 1)
#elseif(${list.contains($bullets, "listoflocations")})
#if(${productClass}=="T")
THIS IS A TEST MESSAGE. ##
#end
#### THE THIRD ARGUMENT IS A NUMBER SPECIFYING THE NUMBER OF COLUMNS TO OUTPUT THE CITIES LIST IN
#### 0 IS A ... SEPARATED LIST, 1 IS ONE PER LINE, >1 IS A COLUMN FORMAT
#### IF YOU USE SOMETHING OTHER THAN "LOCATIONS IMPACTED INCLUDE" LEAD IN BELOW, MAKE SURE THE
#### ACCOMPANYING XML FILE PARSE STRING IS CHANGED TO MATCH!
#locationsList("${impacted}" "${eventType}" 0 ${locationList} ${otherPoints} ${areas} ${dateUtil} ${timeFormat} 1)
#end
##############################################
###### SPECIAL VENUE/EVENT CASE ##############
##############################################
#if(${list.contains($bullets, "specialEvent")})
#if(${stormType} == "line")
THOSE ATTENDING THE !**event/venue name or location**! ARE IN THE PATH OF THESE STORMS AND SHOULD PREPARE FOR IMMINENT DANGEROUS WEATHER CONDITIONS. SEEK SHELTER NOW.
#else
THOSE ATTENDING THE !**event/venue name or location**! ARE IN THE PATH OF THIS STORM AND SHOULD PREPARE FOR IMMINENT DANGEROUS WEATHER CONDITIONS. SEEK SHELTER NOW.
#end
#end
#####################
## CALL TO ACTIONS ##
#####################
#######################################################################
## Check to see if we've selected any calls to action. In our .cfg file
## we ended each CTA bullet ID with "CTA" for this reason as a 'trip'
#######################################################################
#foreach ($bullet in $bullets)
#if ($bullet.endsWith("CTA"))
#set ($ctaSelected = "YES")
#end
#end
##
#if (${ctaSelected} == "YES")
PRECAUTIONARY/PREPAREDNESS ACTIONS...
#end
##
${ashfallCTA}
#if(${list.contains($bullets, "genericCTA")})
AS THUNDERSTORMS MOVE OVER THE WATER...BOATERS CAN EXPECT GUSTY WIND AND HIGH WAVES. MOVE TO SAFE HARBOR OR STAY CLOSE TO SHORE UNTIL THE STORM PASSES.
#end
#if(${list.contains($bullets, "gustyWindsCTA")})
MARINERS CAN EXPECT GUSTY WINDS...HIGH WAVES...DANGEROUS LIGHTNING...AND HEAVY RAINS. BOATERS SHOULD SEEK SAFE HARBOR IMMEDIATELY...UNTIL THIS STORM PASSES.
#end
#if(${list.contains($bullets, "nonThunderstormCTA")})
MARINERS CAN EXPECT GUSTY WINDS...AND INCREASING WAVES. BOATERS...ESPECIALLY THOSE UNDER SAIL...SHOULD SEEK SAFE HARBOR IMMEDIATELY...UNTIL THE HIGH WINDS SUBSIDE.
#end
#if(${list.contains($bullets, "waterspoutCTA")})
THUNDERSTORMS CAN PRODUCE SUDDEN WATERSPOUTS. WATERSPOUTS CAN EASILY OVERTURN BOATS AND CREATE LOCALLY HAZARDOUS SEAS. SEEK SAFE HARBOR IMMEDIATELY.
#end
#if(${list.contains($bullets, "lightningCTA")})
FREQUENT LIGHTNING IS OCCURRING WITH THIS STORM. IF CAUGHT ON THE OPEN WATER STAY BELOW DECK IF POSSIBLE...KEEP AWAY FROM UNGROUNDED METAL OBJECTS.
#end
#if(${list.contains($bullets, "reportCTA")})
REPORT SEVERE WEATHER TO THE COAST GUARD OR NEAREST LAW ENFORCEMENT AGENCY. THEY WILL RELAY YOUR REPORT TO THE NATIONAL WEATHER SERVICE OFFICE.
#end
#if (${ctaSelected} == "YES")
&&

View file

@ -21,14 +21,14 @@
# it was renamed to avoid a conflict with jep's built-in config module
import types
from java.util import ArrayList,HashMap
from java.util import ArrayList,LinkedHashMap
from java.lang import Integer,Float
from com.vividsolutions.jts.geom import Coordinate
from java.awt import Point
Databases = {}
Projections = {}
DiscreteDef = HashMap() #from parseKeys()
DiscreteDef = LinkedHashMap() #from parseKeys()
# Check a python sequence to see that
# it matches the format.
@ -62,7 +62,7 @@ def check(data, fmt, message, allData = None):
# dictionary check, keys are strings, values/subvalues as specified
def dictCheck(dictionary, value, subvalue, configName):
map = HashMap()
map = LinkedHashMap()
if type(dictionary) == dict:
for k in dictionary.keys():
if type(k) != str:
@ -352,7 +352,7 @@ def parse(site, databases, wxtypes, wxvisibilities, allSites, inProjections):
return models, projections, vis, types, DiscreteDef, allSiteIDs, domain, siteId, timeZone, allOfficeTypes
def d2dParse(d2dmodels):
dict = HashMap()
dict = LinkedHashMap()
for entry in d2dmodels:
if type(entry) is types.TupleType:
d2dModelName, gfeModelName = check(entry, (str, str),
@ -369,8 +369,30 @@ def d2dParse(d2dmodels):
return dict
def netcdfParse(netcdfDirs):
dict = LinkedHashMap()
for entry in netcdfDirs:
if type(entry) is types.TupleType:
direct, modelName = check(entry, (str, str),
"Format error in NETCDFDIRS entry", netcdfDirs)
if direct[-1] == '/':
direct = direct[0:-1]
dict.put(direct, modelName)
elif type(entry) is types.StringType:
direct = entry
if direct[-1] == '/':
direct = direct[0:-1]
dict.put(direct, '')
else:
raise SyntaxError, "Invalid syntax for NETCDFDIRS" + `netcdfDirs`
return dict
def parseSat(satdirs):
rval = HashMap()
rval = LinkedHashMap()
for e in satdirs:
if type(e) is types.TupleType:
direct, name = check(e, (str, str),
@ -411,7 +433,7 @@ def otherParse(serverhost, mhsid, port,
if type(extraWEPrec) != list:
raise TypeError, "ExtraWEPrec not an list: " + `extraWEPrec`
else:
extraWEPrecision = HashMap()
extraWEPrecision = LinkedHashMap()
for e in extraWEPrec:
if type(e) == str:
extraWEPrecision.put(e, Integer(1))

View file

@ -986,6 +986,8 @@ D2DDBVERSIONS = {
"Satellite": 6,
"HPCERP": 5,
"TPCProb": 30,
"CRMTopo": 1,
"NED": 1,
}
#---------------------------------------------------------------------------
@ -1115,8 +1117,6 @@ elif SID in CONUS_EAST_SITES:
('HiResW-NMM-East', 'HIRESWnmm'),
('SPCGuide', 'SPC'),
('ECMWF-HiRes','ECMWFHiRes'),
#(GFESUITE_HOME + '/data/climo/PRISM'),
#(GFESUITE_HOME + '/data/climo/NCDC'),
]
else: #######DCS3501 WEST_CONUS
@ -1166,13 +1166,58 @@ else: #######DCS3501 WEST_CONUS
('HiResW-NMM-West', 'HIRESWnmm'),
('SPCGuide', 'SPC'),
('ECMWF-HiRes','ECMWFHiRes'),
#(GFESUITE_HOME + '/data/climo/PRISM'),
#(GFESUITE_HOME + '/data/climo/NCDC'),
]
if SID in GreatLake_SITES:
D2DMODELS.append(('GRLKwave', 'GLWM'))
#---------------------------------------------------------------------------
#
# Search path for netCDF data files.
# NOTE: This feature was implemented only backward compatibility with existing A1 datasets.
# New datasets should be generated in a from that can be ingested by A2
# It shoudl only be used for static datasets.
# New files will not be recognized without a server restart.
#
#---------------------------------------------------------------------------
# Alaska OCONUS
if SID in ALASKA_SITES:
NETCDFDIRS = []
# Hawaii OCONUS
elif SID == "HFO":
NETCDFDIRS = [('/awips2/edex/data/gfe/topo/NED3ARCSTOPO','CRMTopo'),
('/awips2/edex/data/gfe/topo/NED3ARCSTOPONEW','NED'),
]
# San Juan OCONUS
elif SID == "SJU":
NETCDFDIRS = [('/awips2/edex/data/gfe/topo/NED3ARCSTOPO','CRMTopo'),
('/awips2/edex/data/gfe/topo/NED3ARCSTOPONEW','NED'),
]
# Guam OCONUS
elif SID == "GUM":
NETCDFDIRS = []
#CONUS sites
elif SID in CONUS_EAST_SITES:
NETCDFDIRS = [('/awips2/edex/data/gfe/climo/PRISM'),
('/awips2/edex/data/gfe/climo/NCDC'),
('/awips2/edex/data/gfe/topo/NED3ARCSTOPO','CRMTopo'),
('/awips2/edex/data/gfe/topo/NED3ARCSTOPONEW','NED'),
]
else: #######DCS3501 WEST_CONUS
NETCDFDIRS = [('/awips2/edex/data/gfe/climo/PRISM'),
('/awips2/edex/data/gfe/climo/NCDC'),
('/awips2/edex/data/gfe/topo/NED3ARCSTOPO','CRMTopo'),
('/awips2/edex/data/gfe/topo/NED3ARCSTOPONEW','NED'),
]
#---------------------------------------------------------------------------
#
# Where to find (and what to call) satellite data.
@ -1542,6 +1587,14 @@ if not BASELINE and siteImport('localConfig'):
localRTMAParms = getattr(localConfig, 'parmsRTMA', localRTMAParms)
localNamDNG5Parms = getattr(localConfig, 'parmsNamDNG5', localNamDNG5Parms)
localTPCProbParms = getattr(localConfig, 'parmsTPCProb', localTPCProbParms)
localAKwave10Parms = getattr(localConfig, 'parmsAKwave10', localAKwave10Parms)
localAKwave4Parms = getattr(localConfig, 'parmsAKwave4', localAKwave4Parms)
localEPwave10Parms = getattr(localConfig, 'parmsEPwave10', localEPwave10Parms)
localGlobalWaveParms = getattr(localConfig, 'parmsGlobalWave', localGlobalWaveParms)
localWCwave10Parms = getattr(localConfig, 'parmsWCwave10', localWCwave10Parms)
localWCwave4Parms = getattr(localConfig, 'parmsWCwave4', localWCwave4Parms)
localWNAwave10Parms = getattr(localConfig, 'parmsWNAwave10', localWNAwave10Parms)
localWNAwave4Parms = getattr(localConfig, 'parmsWNAwave4', localWNAwave4Parms)
#note that extraISCparms are not in the standard format. These
#are a list of ([p, p, p, p], officeType)
@ -1832,6 +1885,7 @@ def doIt():
IFPConfigServer.siteID = siteId
IFPConfigServer.timeZone = timeZone
IFPConfigServer.d2dModels = doConfig.d2dParse(D2DMODELS)
IFPConfigServer.netCDFDirs = doConfig.netcdfParse(NETCDFDIRS)
IFPConfigServer.satDirs = doConfig.parseSat(SATDATA)
IFPConfigServer.domain = domain

View file

@ -0,0 +1,243 @@
##
# 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.
##
### MetLib - a library of meteorological methods for GFE
###
### This module contains a variety of python methods intended
### for making meteorological calculations on gridded data.
from numpy import *
import copy
# CenteredDifference - This method performs a centered difference
# of the specificd grid. Edges are calculated using a forward or
# backward difference so that the grid that is returned is the same
# size as the input grids. In general this is a low-level method
# intended to be used by the derivative methods d_dx, d_dy, d_dz and
# d_dt.
#
# Note that this method returns the simple difference along one axis.
# Scaling to the correct grid size is the responsibility of the caller.
def centeredDifference(grid, axis):
## Make sure we have enough dimensions as the axis
if axis >= 0 and axis >= len(grid.shape):
print "Returning None: axis = ", axis, "grid.shape=", grid.shape
return None
elif axis < 0 and abs(axis) > len(grid.shape):
print "Returning None: axis = ", axis, "grid.shape=", grid.shape
return None
# Make a slice list of the appropriate length
sliceList= []
for s in grid.shape:
sliceList.append(slice(None, None, None))
# Define the slices at the specified axis. Terms labelled with
# "1" refer to the middle of the grid, terms with 2 the first edge
# of the grid and terms using "3' the last edge of the grid
t1 = copy.copy(sliceList)
t1[axis] = slice(1, -1, None)
a1 = copy.copy(sliceList)
a1[axis] = slice(2, None, None)
b1 = copy.copy(sliceList)
b1[axis] = slice(0, -2, None)
t2 = copy.copy(sliceList)
t2[axis] = slice(0, 1, None)
a2 = copy.copy(sliceList)
a2[axis] = slice(1, 2, None)
b2 = copy.copy(sliceList)
b2[axis] = t2[axis]
t3 = copy.copy(sliceList)
t3[axis] = slice(-1, None, None)
a3 = copy.copy(sliceList)
a3[axis] = t3[axis]
b3 = copy.copy(sliceList)
b3[axis] = slice(-2, -1, None)
diff = zeros(grid.shape, float64)
# Perform the centered difference
diff[t1] = (grid[a1] - grid[b1]) / 2.0 # middle
diff[t2] = grid[a2] - grid[b2] # first edge
diff[t3] = grid[a3] - grid[b3] # last edge
return diff
# Returns the forward difference derivative
def forwardDifference(grid, axis):
## Make sure we have enough dimensions as the axis
if axis >= 0 and axis >= len(grid.shape):
print "Returning None: axis = ", axis, "grid.shape=", grid.shape
return None
elif axis < 0 and abs(axis) > len(grid.shape):
print "Returning None: axis = ", axis, "grid.shape=", grid.shape
return None
# make a list of "None' slices from which we will copy
sliceList= []
for s in grid.shape:
sliceList.append(slice(None, None, None))
a = copy.copy(sliceList) # forward cell
a[axis] = slice(1, None, None)
b = copy.copy(sliceList) # center cell
b[axis] = slice(0, -1, None)
t1 = copy.copy(sliceList) # main grid target
t1[axis] = slice(0, -1, None)
t2 = copy.copy(sliceList)
t2[axis] = slice(-1, None, None) # last edge
t3 = copy.copy(sliceList) # second-to-last edge
t3[axis] = slice(-2, -1, None)
diff = zeros(grid.shape, float64)
diff[t1] = grid[a] - grid[b]
diff[t2] = diff[t3] # copy second-to-last into last edge
return diff
# Returns a backward difference derivative
def backwardDifference(grid, axis):
## Make sure we have enough dimensions as the axis
if axis >= 0 and axis >= len(grid.shape):
print "Returning None: axis = ", axis, "grid.shape=", grid.shape
return None
elif axis < 0 and abs(axis) > len(grid.shape):
print "Returning None: axis = ", axis, "grid.shape=", grid.shape
return None
# make a list of "None' slices from which we will copy
sliceList= []
for s in grid.shape:
sliceList.append(slice(None, None, None))
a = copy.copy(sliceList) # center cell
a[axis] = slice(1, None, None)
b = copy.copy(sliceList) # backward cell
b[axis] = slice(0, -1, None)
t1 = copy.copy(sliceList) # main grid target
t1[axis] = slice(1, None, None)
t2 = copy.copy(sliceList)
t2[axis] = slice(0, 1, None) # first edge
t3 = copy.copy(sliceList) # second edge
t3[axis] = slice(1, 2, None)
diff = zeros(grid.shape, float64)
diff[t1] = grid[a] - grid[b]
diff[t2] = diff[t3] # copy second-to-last into last edge
return diff
# Returns the derivative along the innermost axis. By convention
# this is the x-axis.
def d_dx(grid):
return centeredDifference(grid, -1)
# Returns the derivative along the second innermost axis. By convention
# this is the y-axis.
def d_dy(grid):
return centeredDifference(grid, -2)
# Returns the derivative along the third innermost axis. By convention
# this is the z-axis. If a 2-dimensional grid is specified, an error
# will be returned from centeredDifference
def d_dz(grid):
return centeredDifference(grid, -3)
# Returns the derivative along the outermost axis. By convention
# this is the time-axis. If a grid of less than 4 dimensions is
# specified, the centered difference method will report an error.
def d_dt(grid):
return centeredDifference(grid, 0)
# Returns the dot product of the specified vectors. Both vector grids
# are assumed to be specified in u, v components.
def dot(vectorGrid1, vectorGrid2):
return vectorGrid1[0] * vectorGrid2[0] + vectorGrid1[1] * vectorGrid2[1]
# Returns the vector gradient of the specified scalar grid.
def gradient(grid):
return (d_dx(grid), d_dy(grid))
# Returns the divergence of the specified Wind grid. Wind is assumed
# to be a vector grid specified in u, v components.
def divergence(Wind):
u, v = Wind
return d_dx(u) + d_dy(v)
# Returns the vorticity of the specified Wind grid. Wind is assumed
# to be a vector grid specified in u, v components.
def vorticity(Wind):
u, v = Wind
return d_dx(v) - d_dy(u)
# Returns the advection of the scalarGrid by the windGrid. The
# windGrid is assumed to be a vector specified in u, v components.
def advection(windGrid, scalarGrid):
u, v = windGrid
return -dot(windGrid, gradient(scalarGrid))
### Utility methods
# Utility methods that uses the specified gridLocation
# to generate and return a grid of latitude and a grid of longitude at
# each grid point. The gridLoc can be obtained with a call to self.getGridLoc()
# in any SmartTool.
def getLatLonGrids(gridLoc):
# Fetch the grids
latLonGrid = gridLoc.getLatLonGrid().__numpy__[0];
latLonGrid = numpy.reshape(latLonGrid, (2,gridLoc.getNy().intValue(),gridLoc.getNx().intValue()), order='F')
return latLonGrid[1], latLonGrid[0]
# Returns a grid of gridSpacing or the distance from one grid cell to
# another in meters. This scalar representation of grid spacing works
# well for conformal projections only. Other projections should use a
# vector grid spacing or a different grid for x grid spacing and y
# grid spacing.
def makeSpacingGrid(gridLoc):
DEG_TO_RAD = 0.017453292
latGrid, lonGrid = getLatLonGrids(gridLoc)
# x and y grid spacing must be calculated using the same direction
# for both.
deltaLon = centeredDifference(lonGrid, axis = -2)
deltaLat = d_dy(latGrid)
dxGrid = abs(cos(latGrid * DEG_TO_RAD) * deltaLon * 111111)
dyGrid = deltaLat * 111111 # meters per degree
# calc the total grid spacing using square root of the sum of the squares.
spacing = sqrt(dxGrid * dxGrid + dyGrid * dyGrid)
return spacing
# Returns a grid of coriolis acceleration based purely on latitude.
def makeCoriolisGrid(latGrid):
DEG_TO_RAD = 0.017453292
latGrid = latGrid * DEG_TO_RAD
f = 2.0 * 0.00007292 * sin(latGrid)
return f

View file

@ -77,4 +77,5 @@ Require-Bundle: com.raytheon.uf.common.activetable;bundle-version="1.12.1174",
com.raytheon.uf.common.alertmonitor;bundle-version="1.12.1174",
com.raytheon.uf.common.hlstopo;bundle-version="1.0.0",
com.raytheon.uf.common.jms;bundle-version="1.12.1174",
com.raytheon.uf.common.plugin.nwsauth;bundle-version="1.12.1174"
com.raytheon.uf.common.plugin.nwsauth;bundle-version="1.12.1174",
com.raytheon.uf.common.tafqueue;bundle-version="1.0.0"

View file

@ -94,5 +94,6 @@ Require-Bundle: com.raytheon.uf.common.dataplugin.acars;bundle-version="1.12.117
com.raytheon.uf.common.dataplugin.poessounding;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.airep;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.pirep;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.obs;bundle-version="1.0.0"
com.raytheon.uf.common.dataplugin.obs;bundle-version="1.0.0",
com.raytheon.edex.plugin.tafqueue;bundle-version="1.0.0"

View file

@ -1,87 +0,0 @@
## Core includes file generated on 2012-01-20 17:08:45 GMT
com.raytheon.edex.rpgenvdata/component-deploy.xml
com.raytheon.uf.common.jms/component-deploy.xml
com.raytheon.uf.edex.database/component-deploy.xml
com.raytheon.uf.common.cache/component-deploy.xml
com.raytheon.uf.edex.pointdata/component-deploy.xml
com.raytheon.uf.edex.esb.camel.launcher/component-deploy.xml
com.raytheon.uf.common.dissemination/component-deploy.xml
com.raytheon.uf.edex.bufrtools/component-deploy.xml
com.raytheon.edex.uengine/component-deploy.xml
com.raytheon.uf.common.pointdata/component-deploy.xml
com.raytheon.uf.common.serialization/component-deploy.xml
com.raytheon.uf.common.datastorage.remote/component-deploy.xml
com.raytheon.uf.common.awipstools/component-deploy.xml
com.raytheon.edex.ingestsrv/component-deploy.xml
com.raytheon.uf.common.alertviz/component-deploy.xml
com.raytheon.uf.common.serialization.comm/component-deploy.xml
com.raytheon.uf.tools.gfesuite.servicebackup/component-deploy.xml
com.raytheon.uf.common.auth/component-deploy.xml
com.raytheon.uf.common.menus/component-deploy.xml
com.raytheon.uf.edex.distribution/component-deploy.xml
com.raytheon.uf.common.hydro/component-deploy.xml
com.raytheon.uf.edex.core/component-deploy.xml
com.raytheon.edex.common/component-deploy.xml
com.raytheon.uf.edex.management/component-deploy.xml
com.raytheon.uf.common.datastorage.hdf5/component-deploy.xml
com.raytheon.uf.edex.cpgsrv/component-deploy.xml
com.raytheon.uf.edex.python.decoder/component-deploy.xml
gov.noaa.nws.ncep.edex.uengine/component-deploy.xml
com.raytheon.uf.common.status/component-deploy.xml
com.raytheon.uf.common.sounding/component-deploy.xml
com.raytheon.edex.autobldsrv/component-deploy.xml
gov.noaa.nws.ncep.edex.ingest.util/component-deploy.xml
com.raytheon.uf.common.climo/component-deploy.xml
com.raytheon.uf.common.localization/component-deploy.xml
gov.noaa.nws.ncep.common/component-deploy.xml
com.raytheon.uf.common.message/component-deploy.xml
com.raytheon.rcm.lib/component-deploy.xml
com.raytheon.uf.common.datastorage/component-deploy.xml
com.raytheon.uf.common.topo/component-deploy.xml
com.raytheon.edex.notifysrv/component-deploy.xml
gov.noaa.nws.ncep.edex.gempak.jna/component-deploy.xml
com.raytheon.edex.utilitysrv/component-deploy.xml
com.raytheon.uf.common.geospatial/component-deploy.xml
com.raytheon.uf.common.python/component-deploy.xml
gov.noaa.nws.ncep.edex.purgeutil/component-deploy.xml
com.raytheon.uf.edex.metartohmdbsrv/component-deploy.xml
com.raytheon.uf.common.time/component-deploy.xml
com.raytheon.uf.common.pypies/component-deploy.xml
com.raytheon.uf.common.monitor/component-deploy.xml
com.raytheon.uf.common.comm/component-deploy.xml
com.raytheon.edex.productsrv/component-deploy.xml
com.raytheon.uf.common.mpe/component-deploy.xml
com.raytheon.edex.adaptersrv/component-deploy.xml
com.raytheon.uf.edex.textdbsrv/component-deploy.xml
com.raytheon.uf.common.util/component-deploy.xml
com.raytheon.uf.edex.dat.utils/component-deploy.xml
com.raytheon.uf.common.ohd/component-deploy.xml
com.raytheon.uf.common.site/component-deploy.xml
gov.noaa.nws.ncep.edex.ingest.grib.util/component-deploy.xml
gov.noaa.nws.ncep.edex.common/component-deploy.xml
com.raytheon.uf.edex.log/component-deploy.xml
com.raytheon.uf.edex.ohd/component-deploy.xml
com.raytheon.uf.edex.awipstools/component-deploy.xml
com.raytheon.uf.edex.esb.camel/component-deploy.xml
com.raytheon.uf.common.dataquery/component-deploy.xml
com.raytheon.uf.edex.decodertools/component-deploy.xml
com.raytheon.uf.edex.topo/component-deploy.xml
com.raytheon.uf.common.alertmonitor/component-deploy.xml
com.raytheon.uf.common.activetable/component-deploy.xml
com.raytheon.uf.edex.alertviz/component-deploy.xml
com.raytheon.uf.common.management/component-deploy.xml
com.raytheon.uf.common.derivparam/component-deploy.xml
com.raytheon.uf.edex.dissemination/component-deploy.xml
com.raytheon.edex.kml/component-deploy.xml
com.raytheon.messaging.mhs/component-deploy.xml
com.raytheon.uf.common.colormap/component-deploy.xml
com.raytheon.uf.common.monitor.cpg/component-deploy.xml
gov.noaa.nws.ncep.common.log/component-deploy.xml
com.raytheon.edex.monitorsrv/component-deploy.xml
com.raytheon.edex.textdb/component-deploy.xml
com.raytheon.uf.edex.purgesrv/component-deploy.xml
com.raytheon.uf.edex.auth/component-deploy.xml
com.raytheon.uf.edex.site/component-deploy.xml
com.raytheon.uf.edex.maintenance/component-deploy.xml
com.raytheon.uf.edex.activetable/component-deploy.xml
com.raytheon.uf.common.hlstopo/component-deploy.xml

View file

@ -1,51 +0,0 @@
## Cots includes file generated on 2012-01-20 17:08:45 GMT
com.sun.jndi.nis/*.jar
net.sf.ehcache/*.jar
javax.persistence/*.jar
org.eclipse.jetty/*.jar
net.sf.cglib/*.jar
org.apache.commons.logging/*.jar
org.apache.commons.codec/*.jar
org.apache.commons.lang/*.jar
org.apache.commons.digester/*.jar
org.dom4j/*.jar
org.apache.tools.bzip2/*.jar
org.slf4j/*.jar
org.springframework/*.jar
uk.ltd.getahead/*.jar
org.objectweb/*.jar
org.apache.activemq/*.jar
org.apache.mina/*.jar
org.postgres/postgis.jar
org.postgres/postgresql-8.3-603.jdbc3.jar
javax.vecmath/*.jar
javax.mail/*.jar
org.apache.commons.configuration/*.jar
org.apache.commons.beanutils/*.jar
com.facebook.thrift/*.jar
org.apache.camel/*.jar
org.apache.commons.pool/*.jar
org.apache.log4j/*.jar
org.jep/*.jar
ncsa.hdf5/jhdf5.jar
com.sun.jna/*.jar
edu.wisc.ssec.mcidas/*.jar
org.apache.commons.management/*.jar
com.opensymphony.ognl/*.jar
javax.jms/*.jar
org.apache.commons.collections/*.jar
org.jboss.cache/*.jar
javax.measure/*.jar
org.apache.http/*.jar
org.apache.commons.cli/*.jar
ucar.nc2/*.jar
org.apache.tomcat.nativ/*.jar
org.hibernate/*.jar
org.apache.velocity/velocity-1.5.jar
org.apache.velocity/velocity-tools-generic-1.3.jar
org.apache.commons.validator/*.jar
com.mchange/*.jar
org.apache.qpid/*.jar
org.geotools/*.jar
javax.media.opengl/gluegen-rt.jar
javax.activation/*.jar

View file

@ -1,154 +0,0 @@
## Plug-in includes file generated on 2012-01-20 17:08:45 GMT
com.raytheon.uf.edex.plugin.satellite.mcidas/component-deploy.xml
com.raytheon.edex.plugin.ldadhydro/component-deploy.xml
com.raytheon.uf.edex.plugin.loctables/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.intlsigmet/component-deploy.xml
com.raytheon.uf.edex.plugin.acars/component-deploy.xml
com.raytheon.uf.edex.plugin.npp.viirs/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.intlsigmet/component-deploy.xml
com.raytheon.edex.plugin.ldadprofiler/component-deploy.xml
com.raytheon.edex.plugin.binlightning/component-deploy.xml
com.raytheon.edex.plugin.textlightning/component-deploy.xml
com.raytheon.uf.edex.plugin.svrwx/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.convsigmet/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.bufrsgwh/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.scd/component-deploy.xml
com.raytheon.edex.plugin.shef/component-deploy.xml
com.raytheon.uf.common.dataplugin.cwa/component-deploy.xml
com.raytheon.uf.common.dataplugin.level/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.airmet/component-deploy.xml
com.raytheon.uf.edex.plugin.mesowest/component-deploy.xml
com.raytheon.uf.common.dataplugin.ldadmesonet/component-deploy.xml
com.raytheon.uf.common.dataplugin.gfe/component-deploy.xml
com.raytheon.edex.plugin.radar/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.pafm/component-deploy.xml
com.raytheon.uf.edex.plugin.tcs/component-deploy.xml
com.raytheon.uf.common.dataplugin.binlightning/component-deploy.xml
com.raytheon.edex.plugin.airep/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.aww/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.airmet/component-deploy.xml
com.raytheon.uf.common.dataplugin.bufrquikscat/component-deploy.xml
com.raytheon.uf.common.dataplugin.preciprate/component-deploy.xml
com.raytheon.uf.edex.plugin.level.handler/component-deploy.xml
com.raytheon.uf.common.dataplugin.bufrsigwx/component-deploy.xml
com.raytheon.uf.common.dataplugin.ffmp/component-deploy.xml
com.raytheon.uf.common.dataplugin.cwat/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.atcf/component-deploy.xml
com.raytheon.edex.plugin.ldad/component-deploy.xml
com.raytheon.uf.edex.plugin.manualIngest/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.bufrsgwhv/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.ncccfp/component-deploy.xml
com.raytheon.uf.common.dataplugin.radar/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.nctext/component-deploy.xml
com.raytheon.uf.edex.plugin.cwa/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.tcm/component-deploy.xml
com.raytheon.edex.plugin.grib/component-deploy.xml
com.raytheon.edex.plugin.warning/component-deploy.xml
com.raytheon.edex.plugin.profiler/component-deploy.xml
com.raytheon.uf.common.dataplugin.scan/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.aww/component-deploy.xml
com.raytheon.edex.plugin.pirep/component-deploy.xml
com.raytheon.uf.common.dataplugin.bufrua/component-deploy.xml
com.raytheon.uf.common.dataplugin.obs/component-deploy.xml
com.raytheon.uf.common.dataplugin.goessounding/component-deploy.xml
com.raytheon.uf.common.dataplugin.bufrssmi/component-deploy.xml
com.raytheon.edex.plugin.bufrua/component-deploy.xml
com.raytheon.uf.common.plugin.nwsauth/component-deploy.xml
com.raytheon.edex.plugin.goessounding/component-deploy.xml
com.raytheon.uf.common.dataplugin.fog/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.wcp/component-deploy.xml
com.raytheon.edex.plugin.sfcobs/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.bufrsgwh/component-deploy.xml
com.raytheon.edex.plugin.poessounding/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.ncscat/component-deploy.xml
com.raytheon.uf.common.dataplugin.warning/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.ffg/component-deploy.xml
com.raytheon.uf.edex.plugin.bufrhdw/component-deploy.xml
com.raytheon.uf.common.dataplugin.bufrascat/component-deploy.xml
com.raytheon.uf.common.dataplugin.shef/component-deploy.xml
com.raytheon.edex.plugin.ccfp/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.bufrssha/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.ffg/component-deploy.xml
com.raytheon.uf.common.dataplugin.vil/component-deploy.xml
com.raytheon.edex.plugin.ldadmanual/component-deploy.xml
com.raytheon.uf.edex.plugin.bufrquikscat/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/component-deploy.xml
com.raytheon.uf.edex.plugin.vil/component-deploy.xml
com.raytheon.uf.common.dataplugin.tcg/component-deploy.xml
com.raytheon.uf.common.dataplugin.lsr/component-deploy.xml
com.raytheon.edex.plugin.redbook/component-deploy.xml
com.raytheon.edex.plugin.obs/component-deploy.xml
com.raytheon.uf.edex.plugin.nwsauth/component-deploy.xml
com.raytheon.uf.common.dataplugin.sfcobs/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.h5scd/component-deploy.xml
com.raytheon.uf.common.dataplugin.tcs/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.ncccfp/component-deploy.xml
com.raytheon.edex.plugin.bufrmos/component-deploy.xml
com.raytheon.uf.edex.plugin.ffmp/component-deploy.xml
com.raytheon.uf.edex.plugin.scan.common/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.mcidas/component-deploy.xml
com.raytheon.uf.common.dataplugin/component-deploy.xml
com.raytheon.uf.edex.plugin.fssobs/component-deploy.xml
com.raytheon.uf.common.dataplugin.profiler/component-deploy.xml
com.raytheon.uf.common.dataplugin.text/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.ncgrib/component-deploy.xml
com.raytheon.uf.common.dataplugin.satellite/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.mcidas/component-deploy.xml
com.raytheon.uf.edex.plugin.lsr/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.uair/component-deploy.xml
com.raytheon.uf.edex.plugin.cwat/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.idft/component-deploy.xml
com.raytheon.uf.common.dataplugin.ldadhydro/component-deploy.xml
com.raytheon.uf.common.dataplugin.grib/component-deploy.xml
com.raytheon.uf.common.dataplugin.acars/component-deploy.xml
com.raytheon.uf.edex.plugin.scan/component-deploy.xml
com.raytheon.uf.edex.plugin.bufrncwf/component-deploy.xml
com.raytheon.uf.common.dataplugin.pirep/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.convsigmet/component-deploy.xml
com.raytheon.uf.edex.plugin.fog/component-deploy.xml
com.raytheon.uf.common.dataplugin.airep/component-deploy.xml
com.raytheon.edex.plugin.modelsounding/component-deploy.xml
com.raytheon.edex.plugin.taf/component-deploy.xml
com.raytheon.uf.edex.plugin.preciprate/component-deploy.xml
com.raytheon.uf.common.dataplugin.npp.viirs/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.nonconvsigmet/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.idft/component-deploy.xml
com.raytheon.uf.edex.plugin.bufrascat/component-deploy.xml
com.raytheon.uf.common.dataplugin.vaa/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.uair/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.atcf/component-deploy.xml
com.raytheon.uf.common.dataplugin.svrwx/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.pafm/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.h5uair/component-deploy.xml
com.raytheon.uf.common.dataplugin.qc/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.ncgrib/component-deploy.xml
com.raytheon.uf.common.dataplugin.qpf/component-deploy.xml
com.raytheon.uf.common.dataplugin.bufrhdw/component-deploy.xml
com.raytheon.edex.plugin.gfe/component-deploy.xml
com.raytheon.uf.edex.plugin.qc/component-deploy.xml
com.raytheon.uf.common.dataplugin.fssobs/component-deploy.xml
com.raytheon.uf.common.dataplugin.bufrncwf/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.ncscat/component-deploy.xml
com.raytheon.uf.edex.plugin.level/component-deploy.xml
com.raytheon.uf.edex.plugin.bufrmthdw/component-deploy.xml
com.raytheon.uf.common.dataplugin.acarssounding/component-deploy.xml
com.raytheon.edex.plugin.text/component-deploy.xml
com.raytheon.uf.edex.plugin.tcg/component-deploy.xml
com.raytheon.uf.edex.plugin.qpf/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.mosaic/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.bufrsgwhv/component-deploy.xml
com.raytheon.uf.edex.plugin.bufrsigwx/component-deploy.xml
com.raytheon.uf.edex.plugin.ldadmesonet/component-deploy.xml
com.raytheon.uf.common.dataplugin.bufrmthdw/component-deploy.xml
com.raytheon.uf.edex.plugin.acarssounding/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.tcm/component-deploy.xml
com.raytheon.edex.plugin.satellite/component-deploy.xml
com.raytheon.edex.plugin.recco/component-deploy.xml
com.raytheon.uf.edex.plugin.vaa/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.h5scd/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.scd/component-deploy.xml
gov.noaa.nws.ncep.edex.plugin.wcp/component-deploy.xml
com.raytheon.uf.common.dataplugin.poessounding/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.bufrssha/component-deploy.xml
com.raytheon.uf.edex.plugin.bufrssmi/component-deploy.xml
gov.noaa.nws.ncep.common.dataplugin.h5uair/component-deploy.xml

View file

@ -252,6 +252,19 @@
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.edex.plugin.tafqueue"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.tafqueue"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.edex.plugin.text"
@ -1387,13 +1400,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.climo"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.awipstools"
download-size="0"
@ -1603,13 +1609,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.hlstopo"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="gov.noaa.nws.ncep.common.dataplugin.atcf"
download-size="0"

View file

@ -25,7 +25,7 @@
<parameter name="relFreqPrecip" numDims="1" type="INT" />
<parameter name="proj_hour" numDims="1" type="INT" />
<parameter name="maxTempClim" numDims="1" type="FLOAT" />
<parameter name="minTemp24Hour" numDims="1" type="FLOAT" />
<parameter name="POP24hr" numDims="1" type="INT" />
<parameter name="maxTemp24Hour" numDims="1" type="FLOAT" />
<parameter name="minTemp24Hour" numDims="1" type="FLOAT" unit="K"/>
<parameter name="POP24hr" numDims="1" type="INT"/>
<parameter name="maxTemp24Hour" numDims="1" type="FLOAT" unit="K" />
</pointDataDescription>

View file

@ -25,16 +25,15 @@ Require-Bundle: com.raytheon.uf.common.dataplugin.gfe;bundle-version="1.12.1174"
com.raytheon.uf.common.datastorage.hdf5;bundle-version="1.11.24",
ncsa.hdf5;bundle-version="2.4.0",
com.raytheon.uf.edex.topo,
com.raytheon.uf.common.climo;bundle-version="1.0.0",
com.raytheon.edex.common,
com.raytheon.uf.common.hlstopo;bundle-version="1.0.0",
org.apache.commons.beanutils;bundle-version="1.8.3",
com.raytheon.uf.common.dataplugin.satellite;bundle-version="1.0.0",
com.raytheon.edex.plugin.satellite;bundle-version="1.12.1174",
com.raytheon.uf.edex.auth;bundle-version="1.12.1174",
com.raytheon.uf.common.auth;bundle-version="1.12.1174",
com.raytheon.uf.common.plugin.nwsauth;bundle-version="1.12.1174",
com.raytheon.uf.common.site;bundle-version="1.12.1174"
com.raytheon.uf.common.site;bundle-version="1.12.1174",
ucar.nc2;bundle-version="1.0.0"
Export-Package: com.raytheon.edex.plugin.gfe,
com.raytheon.edex.plugin.gfe.config,
com.raytheon.edex.plugin.gfe.db.dao,

View file

@ -36,10 +36,9 @@ import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException;
import com.raytheon.edex.plugin.gfe.isc.IRTManager;
import com.raytheon.edex.plugin.gfe.reference.MapManager;
import com.raytheon.edex.plugin.gfe.server.GridParmManager;
import com.raytheon.edex.plugin.gfe.server.database.ClimoDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.HLSTopoDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.NetCDFDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.TopoDatabaseManager;
import com.raytheon.edex.plugin.gfe.smartinit.SmartInitRecord;
import com.raytheon.edex.site.SiteUtil;
@ -296,16 +295,20 @@ public class GFESiteActivation implements ISiteActivationListener {
statusHandler.handle(Priority.EVENTA,
"TopoDatabaseManager initializing...");
TopoDatabaseManager.initializeTopoDatabase(siteID);
statusHandler.handle(Priority.EVENTA,
"ClimoDatabaseManager initializing...");
ClimoDatabaseManager.initializeClimoDatabase(siteID);
statusHandler.handle(Priority.EVENTA,
"HLSDatabaseManager initializing...");
HLSTopoDatabaseManager.initializeHLSTopoDatabase(siteID);
statusHandler.handle(Priority.EVENTA,
"D2DSatDatabaseManager initializing...");
// statusHandler.handle(Priority.EVENTA,
// "ClimoDatabaseManager initializing...");
// ClimoDatabaseManager.initializeClimoDatabase(siteID);
// statusHandler.handle(Priority.EVENTA,
// "HLSDatabaseManager initializing...");
// HLSTopoDatabaseManager.initializeHLSTopoDatabase(siteID);
// statusHandler.handle(Priority.EVENTA,
// "D2DSatDatabaseManager initializing...");
D2DSatDatabaseManager.initializeD2DSatDatabase(siteID, config);
statusHandler.handle(Priority.EVENTA,
"NetCDFDatabaseManager initializing...");
NetCDFDatabaseManager.initializeNetCDFDatabases(config);
statusHandler.handle(Priority.EVENTA, "MapManager initializing...");
// should be cluster locked
new MapManager(config);
@ -518,9 +521,11 @@ public class GFESiteActivation implements ISiteActivationListener {
}
TopoDatabaseManager.removeTopoDatabase(siteID);
for (String source : ClimoDatabaseManager.getClimoSources()) {
ClimoDatabaseManager.removeClimoDatabase(siteID, source);
}
// for (String source : ClimoDatabaseManager.getClimoSources()) {
// ClimoDatabaseManager.removeClimoDatabase(siteID, source);
// }
NetCDFDatabaseManager.removeDatabases(siteID);
D2DSatDatabaseManager.removeSatDatabase(siteID);
D2DParmIdCache.getInstance().removeSiteDbs(siteID);

View file

@ -137,6 +137,8 @@ public class IFPServerConfig {
private GridLocation _domain;
private Map<String, String> _netCDFDirs;
private Map<String, String> _satDirs;
private int _tableFetchTime;
@ -432,6 +434,7 @@ public class IFPServerConfig {
_tableFetchTime = config.tableFetchTime;
_satDirs = config.satDirs;
_netCDFDirs = config.netCDFDirs;
_prdDir = config.prdDir;
_logFilePurgeAfter = config.logFilePurgeAfter;
_initMethods = config.initMethods;
@ -761,6 +764,10 @@ public class IFPServerConfig {
return _satDirs;
}
public Map<String, String> netCDFDirs() {
return _netCDFDirs;
}
public GridLocation dbDomain() {
return _domain;
}

View file

@ -61,6 +61,8 @@ public class SimpleServerConfig {
public Map<String, String> d2dModels;
public Map<String, String> netCDFDirs;
public Map<String, String> satDirs;
public boolean allowTopoBelowZero;

View file

@ -53,6 +53,7 @@ import com.raytheon.edex.plugin.gfe.config.IFPServerConfig;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfigManager;
import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException;
import com.raytheon.edex.plugin.gfe.server.GridParmManager;
import com.raytheon.edex.plugin.gfe.server.database.D2DGridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
import com.raytheon.edex.plugin.gfe.util.GridTranslator;
import com.raytheon.edex.plugin.gfe.util.SendNotifications;
@ -616,31 +617,40 @@ public class GFEDao extends DefaultPluginDao {
public GribRecord getD2DGrid(ParmID id, TimeRange timeRange,
GridParmInfo info) throws DataAccessLayerException {
List<GribRecord> records = queryByD2DParmId(id);
List<TimeRange> gribTimes = new ArrayList<TimeRange>();
for (GribRecord record : records) {
gribTimes.add(record.getDataTime().getValidPeriod());
}
if (isMos(id)) {
for (int i = 0; i < records.size(); i++) {
TimeRange gribTime = records.get(i).getDataTime().getValidPeriod();
TimeRange time = info.getTimeConstraints().constraintTime(
records.get(i).getDataTime().getValidPeriod().getEnd());
if (timeRange.getEnd().equals(time.getEnd())
|| !info.getTimeConstraints().anyConstraints()) {
gribTime.getStart());
try {
if (D2DGridDatabase.isNonAccumDuration(id, gribTimes)
&& !isMos(id)) {
if (timeRange.getStart().equals(gribTime.getEnd())
|| timeRange.equals(gribTime)) {
GribRecord retVal = records.get(i);
retVal.setPluginName("grib");
return retVal;
}
}
} else {
for (int i = 0; i < records.size(); i++) {
TimeRange time = info.getTimeConstraints().constraintTime(
records.get(i).getDataTime().getValidPeriod()
.getStart());
if (timeRange.getStart().equals(time.getStart())
|| !info.getTimeConstraints().anyConstraints()) {
if ((timeRange.getStart().equals(time.getStart()) || !info
.getTimeConstraints().anyConstraints())) {
GribRecord retVal = records.get(i);
retVal.setPluginName("grib");
return retVal;
}
}
} catch (GfeConfigurationException e) {
throw new DataAccessLayerException(
"Error getting configuration for "
+ id.getDbId().getSiteId(), e);
}
}
// }
return null;
}
@ -804,7 +814,7 @@ public class GFEDao extends DefaultPluginDao {
for (TimeRange tr : uTimeList) {
if (vTimeList.contains(tr)) {
timeList.add(tr);
timeList.add(new TimeRange(tr.getStart(), tr.getStart()));
}
}
@ -816,7 +826,7 @@ public class GFEDao extends DefaultPluginDao {
for (TimeRange tr : sTimeList) {
if (!timeList.contains(tr) && dTimeList.contains(tr)) {
timeList.add(tr);
timeList.add(new TimeRange(tr.getStart(), tr.getStart()));
}
}
@ -829,17 +839,13 @@ public class GFEDao extends DefaultPluginDao {
} else {
List<DataTime> results = executeD2DParmQuery(id);
for (DataTime o : results) {
TimeRange tr = o.getValidPeriod();
if (tr.getDuration() == 0) {
tr = new TimeRange(tr.getStart(), 3600 * 1000);
} else if (isMos(id)) {
tr = new TimeRange(tr.getEnd(), o.getValidPeriod()
.getDuration());
if (isMos(id)) {
timeList.add(new TimeRange(o.getValidPeriod().getStart(),
3600 * 1000));
} else {
tr = new TimeRange(tr.getStart(), o.getValidPeriod()
.getDuration());
timeList.add(o.getValidPeriod());
}
timeList.add(tr);
}
}
@ -1049,7 +1055,7 @@ public class GFEDao extends DefaultPluginDao {
}
}
private boolean isMos(ParmID id) {
public static boolean isMos(ParmID id) {
return id.getDbId().getModelName().equals("MOSGuide")
&& (id.getParmName().startsWith("mxt") || id.getParmName()
.startsWith("mnt"));

View file

@ -22,6 +22,7 @@ package com.raytheon.edex.plugin.gfe.isc;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -214,12 +215,9 @@ public class IscSendQueue {
JobSetQueueKey key = new JobSetQueueKey(job.getParmID(),
IscSendState.PENDING);
List<IscSendRecord> pending = jobSet.get(key);
boolean found = false;
if (pending != null) {
found = mergeTime(pending, job.getTimeRange());
}
if (!found) {
mergeTime(pending, job);
} else {
addToJobSetQueue(job);
}
}
@ -227,20 +225,35 @@ public class IscSendQueue {
}
}
private boolean mergeTime(List<IscSendRecord> pending,
TimeRange replacementTR) {
for (IscSendRecord record : pending) {
TimeRange origTimeRange = record.getTimeRange();
if (replacementTR.overlaps(origTimeRange)
|| replacementTR.isAdjacentTo(origTimeRange)) {
TimeRange combinedTR = replacementTR.join(origTimeRange);
record.setTimeRange(combinedTR);
record.setInsertTime(new Date());
return true;
}
}
private void mergeTime(List<IscSendRecord> pending, IscSendRecord toMerge) {
// insert the time range and sort by time range
pending.add(toMerge);
Collections.sort(pending, new Comparator<IscSendRecord>() {
return false;
@Override
public int compare(IscSendRecord o1, IscSendRecord o2) {
return o1.getTimeRange().compareTo(o2.getTimeRange());
}
});
// Now combine time ranges if we can
int i = 0;
while (i <= pending.size() - 2) {
TimeRange time = pending.get(i).getTimeRange();
TimeRange time1 = pending.get(i + 1).getTimeRange();
if ((time.overlaps(time1)) || (time.isAdjacentTo(time1))) {
// combine the time ranges
TimeRange combinedTR = time.join(time1);
pending.get(i).setTimeRange(combinedTR);
pending.remove(i + 1);
// we don't increment i, because we want to check the new one
// next
} else {
// nothing to do but increment i
i++;
}
}
}
private void removeTime(List<IscSendRecord> records, TimeRange replacementTR) {
@ -459,68 +472,84 @@ public class IscSendQueue {
mergeCrit.add(Restrictions.allEq(critMap));
List<IscSendRecord> possibleMerges = mergeCrit.list();
for (IscSendRecord rec : possibleMerges) {
boolean continueMerging = true;
boolean merged = false;
while (continueMerging) {
continueMerging = false;
for (int i = possibleMerges.size() - 1; i >= 0; i--) {
TimeRange trToMerge = record.getTimeRange();
TimeRange trExisting = rec.getTimeRange();
if (trToMerge.isAdjacentTo(trExisting)
|| trToMerge.overlaps(trExisting)) {
IscSendRecord oldRecord = (IscSendRecord) s.get(
IscSendRecord.class, rec.getKey(), LockOptions.UPGRADE);
if (oldRecord != null) {
TimeRange trExisting = possibleMerges.get(i).getTimeRange();
if ((trToMerge.isAdjacentTo(trExisting))
|| (trToMerge.overlaps(trExisting))) {
TimeRange combinedTR = trToMerge.join(trExisting);
record.setTimeRange(combinedTR);
// delete old record from DB and this internal list as its
// time range is now merged into our new record
IscSendRecord recordToDelete = (IscSendRecord) s
.get(IscSendRecord.class, possibleMerges.get(i)
.getKey(), LockOptions.UPGRADE);
if (recordToDelete != null) {
try {
s.delete(oldRecord);
IscSendRecord newRecord = oldRecord.clone();
TimeRange mergedTR = trExisting.combineWith(trToMerge);
newRecord.setTimeRange(mergedTR);
newRecord.setInsertTime(record.getInsertTime());
// ensure we have not created a duplicate record by
// merging the time ranges
Criteria dupeCrit = s
.createCriteria(IscSendRecord.class);
Map<String, Object> dupeCritMap = new HashMap<String, Object>(
5);
dupeCritMap.put("parmID", record.getParmID());
dupeCritMap.put("state", record.getState());
dupeCritMap.put("xmlDest", record.getXmlDest());
dupeCritMap.put("timeRange.start", record
.getTimeRange().getStart());
dupeCritMap.put("timeRange.end", record.getTimeRange()
.getEnd());
dupeCrit.add(Restrictions.allEq(critMap));
List<IscSendRecord> dupes = dupeCrit.list();
boolean foundDupe = false;
for (IscSendRecord dupe : dupes) {
IscSendRecord dupeRecord = (IscSendRecord) s.get(
IscSendRecord.class, dupe.getKey(),
LockOptions.UPGRADE);
if (dupeRecord != null) {
Date newInsertTime = newRecord.getInsertTime();
if (dupeRecord.getInsertTime().compareTo(
newInsertTime) < 0) {
dupeRecord.setInsertTime(newInsertTime);
}
s.update(dupeRecord);
foundDupe = true;
}
}
if (!foundDupe) {
s.save(newRecord);
}
s.delete(recordToDelete);
possibleMerges.remove(i);
merged = true;
continueMerging = true;
} catch (Exception e) {
handler.handle(Priority.WARN,
"IscSendRecord merge failed.", e);
return false;
}
return true;
}
}
}
}
return false;
// ensure we haven't created a dupe record and save to the DB
if (merged) {
List<IscSendRecord> dupes = Collections.emptyList();
try {
Criteria dupeCrit = s.createCriteria(IscSendRecord.class);
Map<String, Object> dupeCritMap = new HashMap<String, Object>(5);
dupeCritMap.put("parmID", record.getParmID());
dupeCritMap.put("state", record.getState());
dupeCritMap.put("xmlDest", record.getXmlDest());
dupeCritMap.put("timeRange.start", record.getTimeRange()
.getStart());
dupeCritMap
.put("timeRange.end", record.getTimeRange().getEnd());
dupeCrit.add(Restrictions.allEq(dupeCritMap));
dupes = dupeCrit.list();
} catch (Exception e) {
handler.handle(Priority.WARN,
"Failed to retrieve possible duplicate records.", e);
}
try {
// because of how our unique constraints are defined, there can
// only ever be one possible match to a record
if (dupes.isEmpty()) {
s.save(record);
} else {
IscSendRecord dupeRecord = (IscSendRecord) s.get(
IscSendRecord.class, dupes.get(0).getKey(),
LockOptions.UPGRADE);
if (dupeRecord != null) {
Date newInsertTime = record.getInsertTime();
if (dupeRecord.getInsertTime().compareTo(newInsertTime) < 0) {
dupeRecord.setInsertTime(newInsertTime);
}
s.update(dupeRecord);
}
}
} catch (Exception e) {
handler.handle(Priority.WARN, "Failed to save merged record.",
e);
merged = false;
}
}
return merged;
}
@SuppressWarnings("unchecked")

View file

@ -107,24 +107,13 @@ public class IscSendRecord implements IPersistableDataObject, Serializable,
}
public IscSendRecord(ParmID parmId, TimeRange sendTR, boolean sendNow) {
this.parmID = parmId;
this.timeRange = sendTR;
this.xmlDest = "";
IscSendState state = (sendNow ? IscSendState.QUEUED
: IscSendState.PENDING);
this.state = state;
this.insertTime = new Date();
this(parmId, sendTR, "", sendNow);
}
public IscSendRecord(ParmID parmId, TimeRange sendTR, String xmlDest,
boolean sendNow) {
this.parmID = parmId;
this.timeRange = sendTR;
this.xmlDest = xmlDest;
IscSendState state = (sendNow ? IscSendState.QUEUED
: IscSendState.PENDING);
this.state = state;
this.insertTime = new Date();
this(parmId, sendTR, xmlDest, (sendNow ? IscSendState.QUEUED
: IscSendState.PENDING));
}
public IscSendRecord(ParmID parmId, TimeRange sendTR, String xmlDest,

View file

@ -107,7 +107,7 @@ public class SendIscTransactions {
if (record != null
&& record.getInsertTime().getTime() < timeOutCheck) {
handler.info("Running IscSendJob "
+ record.getKey()
+ record.toString()
+ " timed out. Rerunning IscSendJob.");
record.setInsertTime(new Date());
sess.update(record);

View file

@ -36,13 +36,12 @@ import com.raytheon.edex.plugin.gfe.cache.d2dparms.D2DParmIdCache;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfig;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfigManager;
import com.raytheon.edex.plugin.gfe.db.dao.GFEDao;
import com.raytheon.edex.plugin.gfe.server.database.ClimoDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.D2DGridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabase;
import com.raytheon.edex.plugin.gfe.server.database.D2DSatDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.HLSTopoDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.NetCDFDatabaseManager;
import com.raytheon.edex.plugin.gfe.server.database.TopoDatabaseManager;
import com.raytheon.edex.plugin.gfe.util.SendNotifications;
import com.raytheon.edex.util.Util;
@ -767,8 +766,6 @@ public class GridParmManager {
List<DatabaseID> gfeDbs = gfeDao.getDatabaseInventory();
List<DatabaseID> singletons = null;
List<DatabaseID> d2dDbs = null;
List<DatabaseID> climoDbs = null;
List<DatabaseID> hlsTopoDbs = null;
d2dDbs = D2DParmIdCache.getInstance().getDatabaseIDs();
@ -803,11 +800,7 @@ public class GridParmManager {
DatabaseID topoDbId = TopoDatabaseManager.getTopoDbId(siteID);
databases.add(topoDbId);
climoDbs = ClimoDatabaseManager.getClimoDatabases(siteID);
databases.addAll(climoDbs);
hlsTopoDbs = HLSTopoDatabaseManager.getHLSTopoDatabases(siteID);
databases.addAll(hlsTopoDbs);
databases.addAll(NetCDFDatabaseManager.getDatabaseIds(siteID));
sr.setPayload(databases);
return sr;
@ -1133,30 +1126,11 @@ public class GridParmManager {
if ("D2D".equals(dbType)) {
if (modelName.equals("Satellite")) {
db = D2DSatDatabaseManager.getSatDatabase(dbId.getSiteId());
} else if (modelName.contains("Climo")) {
// Check for climo types
String climoModel = modelName.replace("Climo", "");
for (String source : ClimoDatabaseManager.getClimoSources()) {
DatabaseID climoDbId = ClimoDatabaseManager
.getClimoDbId(siteId, source);
String climoDbType = climoDbId.getDbType();
if (climoDbType.equals(dbType)
&& source.equals(climoModel)) {
db = ClimoDatabaseManager.getClimoDatabase(siteId,
source);
break;
}
}
} else if (HLSTopoDatabaseManager.getHLSTopoSources().contains(
modelName)) {
// check for hlsTopo
GridDatabase hlsTopoDb = HLSTopoDatabaseManager
.getHLSTopoDatabase(siteId, modelName);
if (hlsTopoDb != null
&& dbType.equals(hlsTopoDb.getDbId().getDbType())) {
db = hlsTopoDb;
}
} else {
db = NetCDFDatabaseManager.getDb(dbId);
}
if (db == null) {
IFPServerConfig serverConfig = IFPServerConfigManager
.getServerConfig(siteId);
db = new D2DGridDatabase(serverConfig, dbId);

View file

@ -1,435 +0,0 @@
/**
* 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.edex.plugin.gfe.server.database;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import javax.measure.converter.UnitConverter;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import org.geotools.coverage.grid.GridGeometry2D;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfigManager;
import com.raytheon.uf.common.climo.ClimoQuery;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory.OriginType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.TimeConstraints;
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerMsg;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.dataplugin.gfe.util.GfeUtil;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.message.WsId;
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.common.time.TimeRange;
/**
* A complete encapsulation of the Climo data
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 19, 2008 #1160 randerso Initial creation
* Jul 10, 2009 #2590 njensen Support for multiple sites
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class ClimoDatabase extends IFPGridDatabase {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(ClimoDatabase.class);
private Set<ParmID> parmIds;
private Map<ParmID, GridParmInfo> gpiMap;
private GridLocation gloc;
protected ClimoDatabase(String siteID, String source) throws GfeException {
this.dbId = ClimoDatabaseManager.getClimoDbId(siteID, source);
this.gridConfig = null;
this.gloc = IFPServerConfigManager.getServerConfig(siteID).dbDomain();
ParmID mntParm = new ParmID("mnt", dbId, "SFC");
ParmID mxtParm = new ParmID("mxt", dbId, "SFC");
ParmID tpParm = new ParmID("tp", dbId, "SFC");
parmIds = new TreeSet<ParmID>();
parmIds.add(mntParm);
parmIds.add(mxtParm);
parmIds.add(tpParm);
gpiMap = new HashMap<ParmID, GridParmInfo>(8);
GridParmInfo gpi;
gpi = new GridParmInfo(mntParm, gloc, GridType.SCALAR, "K",
"Minimum Temperature", 0.0f, 10000.0f, 1, false,
new TimeConstraints(3600, 3600, 0), false);
gpiMap.put(mntParm, gpi);
gpi = new GridParmInfo(mxtParm, gloc, GridType.SCALAR, "K",
"Maximum Temperature", 0.0f, 10000.0f, 1, false,
new TimeConstraints(3600, 3600, 0), false);
gpiMap.put(mxtParm, gpi);
gpi = new GridParmInfo(tpParm, gloc, GridType.SCALAR, "mm",
"Total Precipitation", 0.0f, 10000.0f, 1, false,
new TimeConstraints(3600, 3600, 0), false);
gpiMap.put(tpParm, gpi);
for (ParmID parmId : parmIds) {
try {
IDataStore dataStore = getDataStore(parmId);
IDataRecord dr = dataStore.retrieve(GRID_PARM_INFO_GRP,
parmId.getCompositeName(), Request.ALL);
gpi = populateGpi(dr.getDataAttributes());
if (!gpi.getGridLoc().equals(gloc)) {
dataStore.delete(GRID_PARM_INFO_GRP + "/"
+ parmId.getCompositeName());
dataStore.delete(GfeUtil.getHDF5Group(parmId));
throw new Exception("Grid spacing has changed");
}
} catch (Exception e) {
String s = e.getMessage();
String message;
Priority priority;
Exception ee = null;
if (s.contains(this.dbId + ".h5 does not exist")) {
statusHandler.handle(Priority.INFO, this.dbId
+ ".h5 does not exist, creating...");
priority = Priority.INFO;
message = "No data found for " + parmId + ", creating...";
} else if (s.contains("No group " + GRID_PARM_INFO_GRP
+ " found")) {
priority = Priority.INFO;
message = "No data found for " + parmId + ", creating...";
} else if (s.contains("Name doesn't exist")) {
priority = Priority.INFO;
message = "No data found for " + parmId + ", creating...";
} else if (s.contains("Grid spacing has changed")) {
priority = Priority.INFO;
message = "Grid spacing has changed, re-initializaing "
+ parmId + "...";
} else {
priority = Priority.PROBLEM;
message = "Problem accessing " + parmId
+ " re-initializing...";
ee = e;
}
statusHandler.handle(priority, message, ee);
ServerResponse<?> sr = saveGridData(parmId,
TimeRange.allTimes(), new ArrayList<GFERecord>(),
new WsId(null, "initialization", "ClimoDatabase"));
if (!sr.isOkay()) {
StringBuilder tmp = new StringBuilder(200);
tmp.append("Error occurred saving climo parm:");
for (ServerMsg msg : sr.getMessages()) {
tmp.append("\n");
tmp.append(msg.getMessage());
}
statusHandler.handle(Priority.ERROR, tmp.toString());
}
}
}
}
@Override
public void updateDbs() {
// no op
}
/**
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#getGridParmInfo(com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID)
*/
@Override
public ServerResponse<GridParmInfo> getGridParmInfo(ParmID id) {
ServerResponse<GridParmInfo> sr = new ServerResponse<GridParmInfo>();
GridParmInfo gpi = gpiMap.get(id);
if (gpi == null) {
String msg = "Parm '" + (id == null ? id : id.getParmId())
+ "' is not in the Climo database";
sr.addMessage(msg);
} else {
// Give users a copy so they can't alter the one in the map
gpi = gpi.clone();
sr.setPayload(gpi);
}
return sr;
}
/**
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#getParmList()
*/
@Override
public ServerResponse<List<ParmID>> getParmList() {
// Copy the parm ids so user can't alter the originals
List<ParmID> rtnParmIds = new ArrayList<ParmID>();
for (ParmID parmId : parmIds) {
ParmID pidCopy = new ParmID(parmId.getParmName(), parmId.getDbId(),
parmId.getParmLevel());
rtnParmIds.add(pidCopy);
}
ServerResponse<List<ParmID>> sr = new ServerResponse<List<ParmID>>();
sr.setPayload(rtnParmIds);
return sr;
}
/**
*
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#dbSizeStats
* ()
*/
@Override
public void dbSizeStats() {
// do nothing
}
/**
* This method always throws an UnsupportedOperationException.
*
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#deleteDb()
* @throws UnsupportedOperationException
*/
@Override
public void deleteDb() {
throw new UnsupportedOperationException("Cannot delete Climo databases");
}
/**
* This method is a no-op.
*
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#dumpStatistics
* ()
*/
@Override
public void dumpStatistics() {
// do nothing
}
/**
*
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#getGridHistory
* (com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID,
* java.util.List)
*/
@Override
public ServerResponse<Map<TimeRange, List<GridDataHistory>>> getGridHistory(
ParmID id, List<TimeRange> timeRanges) {
ServerResponse<Map<TimeRange, List<GridDataHistory>>> sr = new ServerResponse<Map<TimeRange, List<GridDataHistory>>>();
if (parmIds.contains(id)) {
ServerResponse<List<TimeRange>> invsr = getGridInventory(id);
if (invsr.isOkay()) {
Map<TimeRange, List<GridDataHistory>> histMap = new HashMap<TimeRange, List<GridDataHistory>>();
List<TimeRange> inventory = invsr.getPayload();
for (TimeRange tr : timeRanges) {
if (inventory.contains(tr)) {
GridDataHistory gdh = new GridDataHistory(
OriginType.INITIALIZED, id, tr);
List<GridDataHistory> gdhRecords = histMap.get(tr);
if (gdhRecords == null) {
gdhRecords = new ArrayList<GridDataHistory>();
histMap.put(tr, gdhRecords);
}
gdhRecords.add(gdh);
} else {
// TODO: error for non-matching TR?
}
}
sr.setPayload(histMap);
} else {
sr.addMessages(invsr);
sr.addMessage("Unable to get grid inventory for: " + id);
}
} else {
sr.addMessage("Unknown ParmID: " + id);
}
return sr;
}
/**
*
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#getGridInventory
* (com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID)
*/
@Override
public ServerResponse<List<TimeRange>> getGridInventory(ParmID pid) {
ServerResponse<List<TimeRange>> sr = new ServerResponse<List<TimeRange>>();
List<TimeRange> trs = new ArrayList<TimeRange>();
sr.setPayload(trs);
if (parmIds.contains(pid)) {
ClimoQuery climoQuery = ClimoQuery.getInstance("gfe");
trs.addAll(climoQuery.getInventory(pid.getParmName(), pid.getDbId()
.getModelName()));
}
return sr;
}
/**
*
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#saveGridData
* (com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID,
* com.raytheon.uf.common.time.TimeRange, java.util.List,
* com.raytheon.uf.common.message.WsId)
*/
@Override
public ServerResponse<?> saveGridData(ParmID pid,
TimeRange originalTimeRange, List<GFERecord> records,
WsId requesterId) {
ServerResponse<?> sr = new ServerResponse<String>();
final long milliSecInLeapYear = 366L * 24 * 60 * 60 * 1000;
GridParmInfo gpi = gpiMap.get(pid);
if (gpi == null) {
sr.addMessage("Unknown parm '" + pid + "'");
} else if (!originalTimeRange.isValid()) {
sr.addMessage("Invalid timerange '" + originalTimeRange + "'");
} else if ((!originalTimeRange.equals(TimeRange.allTimes()))
&& (originalTimeRange.getStart().getTime() < 0L || originalTimeRange
.getEnd().getTime() >= milliSecInLeapYear)) {
sr.addMessage("Disallowed timerange '" + originalTimeRange + "'");
} else {
if (records.size() == 0) {
GridGeometry2D geom = MapUtil.getGridGeometry(gloc);
Unit<?> unit = gpi.getUnitObject();
UnitConverter cvt = null;
// tp is stored in millimeters, tmin and tmax in kelvin
if ("tp".equals(pid.getParmName())) {
cvt = SI.MILLIMETER.getConverterTo(unit);
} else {
cvt = SI.KELVIN.getConverterTo(unit);
}
String parmName = pid.getParmName();
String modelName = pid.getDbId().getModelName();
ClimoQuery query = ClimoQuery.getInstance("gfe");
List<TimeRange> times = query.getInventory(parmName, modelName);
float[] climate = null;
if (times == null) {
sr.addMessage("Climo CONUS data is missing");
} else {
records = new ArrayList<GFERecord>(times.size());
for (TimeRange timeRange : times) {
climate = null;
// Generate an initial data grid from the CONUS HDF5
try {
climate = query.getClimate(geom, timeRange,
parmName, modelName);
} catch (Exception e) {
sr.addMessage(e.getMessage());
sr.addMessage("Error generating local climo data");
return sr;
}
if (climate != null) {
for (int i = 0; i < climate.length; i++) {
climate[i] = (float) cvt.convert(climate[i]);
}
GFERecord record = new GFERecord(pid, timeRange);
record.setGridInfo(gpi);
FloatDataRecord fdr = new FloatDataRecord("Data",
record.getDataTime().getValidPeriod()
.toString(), climate, 2,
new long[] { gloc.getNx(), gloc.getNy() });
record.setMessageData(fdr);
records.add(record);
}
}
try {
saveGridParmInfo(gpi);
saveGridsToHdf5(records);
} catch (GfeException e) {
sr.addMessage(e.getMessage());
sr.addMessage("Error saving climo data to HDF5");
return sr;
}
}
}
}
return sr;
}
/*
* (non-Javadoc)
*
* @seecom.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#
* updateGridHistory(java.util.List, java.util.List)
*/
@Override
public ServerResponse<?> updateGridHistory(ParmID parmId,
Map<TimeRange, List<GridDataHistory>> history) {
ServerResponse<?> sr = new ServerResponse<String>();
sr.addMessage("Can't update Grid History on Climo Database");
return sr;
}
/**
* Add grid parm info to the hdf5 file we are creating. This method should
* only be called when first creating the file; it doesn't check whether the
* record already exists, because it "knows" it does not.
*
* @throws GfeException
* if any i/o, thrift, or hdf5 operation fails.
*/
protected void saveGridParmInfo(GridParmInfo gpi) throws GfeException {
File gpiFile = GfeUtil.getHDF5File(gfeBaseDataDir, this.dbId);
IDataStore ds = null;
try {
ds = DataStoreFactory.getDataStore(gpiFile);
String parmNameAndLevel = gpi.getParmID().getCompositeName();
ByteDataRecord br = new ByteDataRecord(parmNameAndLevel,
GRID_PARM_INFO_GRP, new byte[1]);
br.setDataAttributes(getGpiAsMap(gpi));
ds.addDataRecord(br);
ds.store();
} catch (Exception e) {
throw new GfeException("", e);
}
}
}

View file

@ -1,123 +0,0 @@
/**
* 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.edex.plugin.gfe.server.database;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID.DataType;
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
/**
* Climo database manager. Based heavily on TopoDatabaseManager.
*
* @author wldougher
*
*/
public class ClimoDatabaseManager {
private static Map<String, ClimoDatabase> climoDbMap = new HashMap<String, ClimoDatabase>();
/**
* Initialize the climo database for the given site ID.
*
* @param siteID
* The site for which the climo database needs to be initialized.
* @throws GfeException
*/
public static void initializeClimoDatabase(String siteID)
throws GfeException {
for (String source : getClimoSources()) {
ClimoDatabase climo = new ClimoDatabase(siteID, source);
climoDbMap.put(siteID + " " + source, climo);
}
}
/**
* Return the climo database associated with the specified site ID and data
* source.
*
* @param siteID
* the site ID whose climo database is to be retrieved.
* @param source
* the database source ("PRISM", for example)
* @return The climo database associated with siteID, or null if the climo
* database for that site has not been initialized.
*/
public static ClimoDatabase getClimoDatabase(String siteID, String source) {
return climoDbMap.get(siteID + " " + source);
}
/**
* Remove the climo database for siteID. After calling this method, calls to
* getClimoDatabase for the site will return null until the climo database
* for the site is re-initialized.
*
* @param siteID
* The site whose climo database should be removed from the
* manager.
*/
public static void removeClimoDatabase(String siteID, String source) {
climoDbMap.remove(siteID + " " + source);
}
/**
* Get a database ID for climo database for siteID and source.
*
* @param siteID
* The site for which to obtain a climo database ID.
* @param source
* The data source for which to obtain a climo database ID.
* @return a DatabaseID for the climo database
* @throws GfeConfigurationException
* if the database ID cannot be created.
*/
public static DatabaseID getClimoDbId(String siteID, String source) {
return new DatabaseID(siteID, DataType.GRID, "D2D", source + "Climo");
}
/**
* @return
*/
public static List<String> getClimoSources() {
// TODO: read from properties file?
List<String> sources = Arrays.asList(new String[] { "PRISM", "NCDC" });
return sources;
}
/**
* @param siteID
* @return
*/
public static List<DatabaseID> getClimoDatabases(String siteID) {
List<DatabaseID> dbs = new ArrayList<DatabaseID>();
for (String source : getClimoSources()) {
dbs.add(getClimoDbId(siteID, source));
}
return dbs;
}
}

View file

@ -36,11 +36,14 @@ import javax.measure.unit.Unit;
import com.raytheon.edex.plugin.gfe.cache.d2dparms.D2DParmIdCache;
import com.raytheon.edex.plugin.gfe.cache.gridlocations.GridLocationCache;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfig;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfigManager;
import com.raytheon.edex.plugin.gfe.db.dao.GFEDao;
import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException;
import com.raytheon.edex.plugin.grib.dao.GribDao;
import com.raytheon.edex.plugin.grib.spatial.GribSpatialCache;
import com.raytheon.edex.plugin.grib.util.GribParamInfoLookup;
import com.raytheon.edex.plugin.grib.util.ParameterInfo;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
import com.raytheon.uf.common.dataplugin.gfe.RemapGrid;
@ -80,6 +83,7 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
* 06/17/08 #940 bphillip Implemented GFE Locking
* 07/23/09 2342 ryu Check for null gridConfig in getGridParmInfo
* 03/02/12 DR14651 ryu change time independency of staticTopo, staticCoriolis, staticSpacing
* 05/04/12 #574 dgilling Implement missing methods from GridDatabase.
*
* </pre>
*
@ -408,11 +412,6 @@ public class D2DGridDatabase extends VGridDatabase {
return sr;
}
@Override
public void dbSizeStats() {
}
/**
* Gets a grid slice based on Parm information provided
*
@ -736,16 +735,23 @@ public class D2DGridDatabase extends VGridDatabase {
&& (parmName.equals("staticTopo")
|| parmName.equals("staticSpacing") || parmName
.equals("staticCoriolis"))) {
TimeRange ntr = inventory.get(0).combineWith(
inventory.get(inventory.size() - 1));
TimeRange ntr = new TimeRange(
inventory.get(0).getStart().getTime(), inventory
.get(inventory.size() - 1).getEnd().getTime()
+ Util.MILLI_PER_HOUR);
inventory.clear();
inventory.add(ntr);
} else {
List<TimeRange> newInventory = new ArrayList<TimeRange>(
inventory.size());
for (TimeRange tr : inventory) {
if (isNonAccumDuration(id, inventory) && tr.isValid()
&& !GFEDao.isMos(id)) {
newInventory.add(tc.constraintTime(tr.getEnd()));
} else {
newInventory.add(tc.constraintTime(tr.getStart()));
}
}
inventory = newInventory;
}
@ -823,4 +829,35 @@ public class D2DGridDatabase extends VGridDatabase {
return validTimes;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.edex.plugin.gfe.server.database.GridDatabase#deleteDb()
*/
@Override
public void deleteDb() {
// no-op
}
public static boolean isNonAccumDuration(ParmID id, List<TimeRange> times)
throws GfeConfigurationException {
boolean isAccum = false;
try {
isAccum = IFPServerConfigManager
.getServerConfig(id.getDbId().getSiteId())
.accumulativeD2DElements(id.getDbId().getModelName())
.contains(id.getParmName());
} catch (GfeConfigurationException e) {
throw e;
}
boolean isDuration = false;
for (TimeRange time : times) {
if (time.getDuration() > 0) {
isDuration = true;
break;
}
}
return !isAccum && isDuration;
}
}

View file

@ -52,6 +52,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 16, 2011 bphillip Initial creation
* May 04, 2012 #574 dgilling Add unimplemented methods from GridDatabase.
*
* </pre>
*
@ -188,11 +189,6 @@ public class D2DSatDatabase extends VGridDatabase {
return null;
}
@Override
public void dbSizeStats() {
// no op
}
@Override
public void updateDbs() {
// no op
@ -217,4 +213,14 @@ public class D2DSatDatabase extends VGridDatabase {
return times;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.edex.plugin.gfe.server.database.GridDatabase#deleteDb()
*/
@Override
public void deleteDb() {
// no-op
}
}

View file

@ -70,6 +70,7 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
* 04/08/08 #875 bphillip Initial Creation
* 06/17/08 #940 bphillip Implemented GFE Locking
* 06/19/08 njensen Added retrieval of discrete
* 05/04/12 #574 dgilling Update class to better match AWIPS1.
*
* </pre>
*
@ -286,6 +287,8 @@ public abstract class GridDatabase {
return valid;
}
public abstract void deleteDb();
/**
* Returns the list of ParmIDs that are contained in this database.
*
@ -358,8 +361,6 @@ public abstract class GridDatabase {
public abstract String getProjectionId();
public abstract void dbSizeStats();
public ModelState modelState() {
throw new UnsupportedOperationException("Not implemented for class "
+ this.getClass().getName());

View file

@ -1,479 +0,0 @@
/**
* 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.edex.plugin.gfe.server.database;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import javax.measure.converter.UnitConverter;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import com.raytheon.edex.plugin.gfe.config.IFPServerConfigManager;
import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory.OriginType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.TimeConstraints;
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerMsg;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.dataplugin.gfe.server.notify.GridUpdateNotification;
import com.raytheon.uf.common.dataplugin.gfe.util.GfeUtil;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.hlstopo.HLSTopoQuery;
import com.raytheon.uf.common.message.WsId;
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.common.time.TimeRange;
import com.raytheon.uf.edex.database.DataAccessLayerException;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 15, 2011 dgilling Initial creation
*
* </pre>
*
* @author dgilling
* @version 1.0
*/
public class HLSTopoDatabase extends IFPGridDatabase {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(HLSTopoDatabase.class);
private Set<ParmID> parmIds;
private Map<ParmID, GridParmInfo> gpiMap;
private GridLocation gloc;
/**
* @param siteID
* @param source
* @throws GfeException
*/
protected HLSTopoDatabase(String siteID, String source) throws GfeException {
this.dbId = HLSTopoDatabaseManager.getHLSTopoDbId(siteID, source);
this.gridConfig = null;
this.gloc = IFPServerConfigManager.getServerConfig(siteID).dbDomain();
ParmID minTopoParm = new ParmID("minTopo", dbId, "SFC");
ParmID maxTopoParm = new ParmID("maxTopo", dbId, "SFC");
ParmID avgTopoParm = new ParmID("avgTopo", dbId, "SFC");
parmIds = new TreeSet<ParmID>();
parmIds.add(minTopoParm);
parmIds.add(maxTopoParm);
parmIds.add(avgTopoParm);
gpiMap = new HashMap<ParmID, GridParmInfo>();
GridParmInfo gpi;
gpi = new GridParmInfo(minTopoParm, gloc, GridType.SCALAR, "m",
"Minimum Topo", -5000.0f, 5000.0f, 1, false,
new TimeConstraints(), false);
gpiMap.put(minTopoParm, gpi);
gpi = new GridParmInfo(maxTopoParm, gloc, GridType.SCALAR, "m",
"Maximum Topo", -5000.0f, 5000.0f, 1, false,
new TimeConstraints(), false);
gpiMap.put(maxTopoParm, gpi);
gpi = new GridParmInfo(avgTopoParm, gloc, GridType.SCALAR, "m",
"Average Topo", -5000.0f, 5000.0f, 1, false,
new TimeConstraints(), false);
gpiMap.put(avgTopoParm, gpi);
TimeRange allTimes = TimeRange.allTimes();
for (ParmID parmId : parmIds) {
gpi = gpiMap.get(parmId);
IDataStore dataStore = getDataStore(parmId);
String group = null;
try {
group = GfeUtil.getHDF5Group(parmId, allTimes);
IDataRecord[] dr = dataStore.retrieve(group);
FloatDataRecord fdr = (FloatDataRecord) dr[0];
float[] values = fdr.getFloatData();
long[] sizes = fdr.getSizes();
if (sizes[0] != gpi.getGridLoc().getNx()
|| sizes[1] != gpi.getGridLoc().getNy()) {
dataStore.delete(GfeUtil.getHDF5Group(parmId, allTimes));
throw new Exception("");
}
float min = Float.MAX_VALUE;
float max = -Float.MAX_VALUE;
for (float f : values) {
min = Math.min(f, min);
max = Math.max(f, max);
}
gpi.setMinValue((float) Math.floor(min));
gpi.setMaxValue((float) Math.ceil(max));
} catch (Exception e) {
String s = e.getMessage();
String message;
Priority priority;
Exception ee = null;
if (s.contains(this.dbId + ".h5 does not exist")) {
statusHandler.handle(Priority.INFO, this.dbId
+ ".h5 does not exist, creating...");
priority = Priority.INFO;
message = "No data found for " + parmId + ", creating...";
} else if (s.contains("No group " + group + " found")) {
priority = Priority.INFO;
message = "No data found for " + parmId + ", creating...";
} else if (s.contains("Name doesn't exist")) {
priority = Priority.INFO;
message = "No data found for " + parmId + ", creating...";
} else if (s.contains("Grid spacing has changed")) {
priority = Priority.INFO;
message = "Grid spacing has changed, re-initializaing "
+ parmId + "...";
} else {
priority = Priority.PROBLEM;
message = "Problem accessing " + parmId
+ " re-initializing...";
ee = e;
}
statusHandler.handle(priority, message, ee);
ServerResponse<?> sr = saveGridData(parmId, allTimes,
new ArrayList<GFERecord>(), new WsId(null,
"initialization", "HLSTopoDatabase"));
if (!sr.isOkay()) {
StringBuilder tmp = new StringBuilder();
ArrayList<ServerMsg> messages = sr.getMessages();
String sep = "";
for (ServerMsg msg : messages) {
tmp.append(sep).append(msg);
sep = "\n";
}
throw new GfeConfigurationException(tmp.toString(), e);
}
}
}
}
@Override
public void updateDbs() {
// no op
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#dbSizeStats
* ()
*/
@Override
public void dbSizeStats() {
return; // do nothing
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#deleteDb()
*/
@Override
public void deleteDb() {
throw new UnsupportedOperationException(
"Cannot delete HLS topo databases.");
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#dumpStatistics
* ()
*/
@Override
public void dumpStatistics() {
return; // do nothing
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#getParmList
* ()
*/
@Override
public ServerResponse<List<ParmID>> getParmList() {
// Copy the parm ids so user can't alter the originals
List<ParmID> rtnParmIds = new ArrayList<ParmID>();
for (ParmID parmId : parmIds) {
ParmID pidCopy = new ParmID(parmId.getParmName(), parmId.getDbId(),
parmId.getParmLevel());
rtnParmIds.add(pidCopy);
}
ServerResponse<List<ParmID>> sr = new ServerResponse<List<ParmID>>();
sr.setPayload(rtnParmIds);
return sr;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#getGridInventory
* (com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID)
*/
@Override
public ServerResponse<List<TimeRange>> getGridInventory(ParmID id) {
ServerResponse<List<TimeRange>> sr = new ServerResponse<List<TimeRange>>();
List<TimeRange> trs = new ArrayList<TimeRange>();
sr.setPayload(trs);
if (parmIds.contains(id)) {
trs.add(TimeRange.allTimes());
}
return sr;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#getGridHistory
* (com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID, java.util.List)
*/
@Override
public ServerResponse<Map<TimeRange, List<GridDataHistory>>> getGridHistory(
ParmID id, List<TimeRange> trs) {
ServerResponse<Map<TimeRange, List<GridDataHistory>>> sr = new ServerResponse<Map<TimeRange, List<GridDataHistory>>>();
if (parmIds.contains(id)) {
ServerResponse<List<TimeRange>> invsr = getGridInventory(id);
if (invsr.isOkay()) {
Map<TimeRange, List<GridDataHistory>> histMap = new HashMap<TimeRange, List<GridDataHistory>>();
List<TimeRange> inventory = invsr.getPayload();
for (TimeRange tr : trs) {
if (inventory.contains(tr)) {
GridDataHistory gdh = new GridDataHistory(
OriginType.INITIALIZED, id, tr);
List<GridDataHistory> gdhSet = histMap.get(tr);
if (gdhSet == null) {
gdhSet = new ArrayList<GridDataHistory>();
histMap.put(tr, gdhSet);
}
gdhSet.add(gdh);
} else {
// TODO: error for non-matching TR?
}
}
sr.setPayload(histMap);
} else {
sr.addMessages(invsr);
sr.addMessage("Unable to get grid inventory for: " + id);
}
} else {
sr.addMessage("Unknown ParmID: " + id);
}
return sr;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#getGridParmInfo
* (com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID)
*/
@Override
public ServerResponse<GridParmInfo> getGridParmInfo(ParmID id) {
ServerResponse<GridParmInfo> sr = new ServerResponse<GridParmInfo>();
GridParmInfo gpi = gpiMap.get(id);
if (gpi == null) {
String msg = "Parm '" + (id == null ? id : id.getParmId())
+ "' is not in the HLS topo database";
sr.addMessage(msg);
} else {
// Give users a copy so they can't alter the one in the map
gpi = gpi.clone();
sr.setPayload(gpi);
}
return sr;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#saveGridData
* (com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID,
* com.raytheon.uf.common.time.TimeRange, java.util.List,
* com.raytheon.uf.common.message.WsId)
*/
@Override
public ServerResponse<?> saveGridData(ParmID id,
TimeRange originalTimeRange, List<GFERecord> records,
WsId requesterId) {
GridParmInfo gpi = gpiMap.get(id);
String modelName = id.getDbId().getModelName();
if (records.size() == 0) {
float[] heights = new float[0];
try {
heights = HLSTopoQuery.getInstance(modelName).getHeight(
MapUtil.getGridGeometry(gloc), id.getParmName(),
modelName);
} catch (DataAccessLayerException e) {
ServerResponse<?> sr = new ServerResponse<String>();
sr.addMessage("Error generating HLS Topo data");
sr.addMessage(e.getMessage());
for (StackTraceElement element : e.getStackTrace()) {
sr.addMessage(element.toString());
}
return sr;
}
// Convert to unit (probably SI.METER too),
// get max and min values for site
Unit<?> unit = gpi.getUnitObject();
UnitConverter cvt = SI.METER.getConverterTo(unit);
float min = Float.MAX_VALUE;
float max = -Float.MAX_VALUE;
for (int i = 0; i < heights.length; i++) {
if (!Float.isNaN(heights[i])) {
heights[i] = (float) cvt.convert(heights[i]);
min = Math.min(heights[i], min);
max = Math.max(heights[i], max);
}
}
// Store the max and min in gpi.
// NOTE: gpi is still in dbMap, too.
// Technically, we _should_ save it back...
gpi.setMinValue((float) Math.floor(min));
gpi.setMaxValue((float) Math.ceil(max));
GFERecord record = new GFERecord(id, TimeRange.allTimes());
record.setGridInfo(gpi);
FloatDataRecord fdr = new FloatDataRecord("Data", record
.getDataTime().getValidPeriod().toString(), heights, 2,
new long[] { gloc.getNx(), gloc.getNy() });
record.setMessageData(fdr);
records.add(record);
}
// Store the gpi into the datastore
try {
saveGridParmInfo(gpi);
} catch (Exception e) {
ServerResponse<String> sr = new ServerResponse<String>();
sr.setPayload(e.toString());
sr.addMessage(e.getLocalizedMessage());
sr.addMessage("Error saving GridParmInfo for "
+ gpi.getDescriptiveName());
return sr;
}
ServerResponse<?> sr = new ServerResponse<String>();
try {
saveGridsToHdf5(records);
ServerResponse<Map<TimeRange, List<GridDataHistory>>> sr1 = getGridHistory(
id, Arrays.asList(TimeRange.allTimes()));
Map<TimeRange, List<GridDataHistory>> histories = sr1.getPayload();
sr.addNotifications(new GridUpdateNotification(id,
originalTimeRange, histories, requesterId, id.getDbId()
.getSiteId()));
} catch (GfeException e) {
sr.addMessage("Error saving hlsTopo data to HDF5");
return sr;
}
return sr;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.edex.plugin.gfe.server.database.IFPGridDatabase#
* updateGridHistory
* (com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID, java.util.List,
* java.util.List)
*/
@Override
public ServerResponse<?> updateGridHistory(ParmID parmId,
Map<TimeRange, List<GridDataHistory>> history) {
ServerResponse<?> sr = new ServerResponse<String>();
sr.addMessage("Can't update Grid History on HLS Topo Database");
return sr;
}
/**
* Add grid parm info to the hdf5 file we are creating. This method should
* only be called when first creating the file; it doesn't check whether the
* record already exists, because it "knows" it does not.
*
* @throws GfeException
* if any i/o, thrift, or hdf5 operation fails.
*/
protected void saveGridParmInfo(GridParmInfo gpi) throws GfeException {
File gpiFile = GfeUtil.getHDF5File(gfeBaseDataDir, this.dbId);
IDataStore ds = null;
try {
ds = DataStoreFactory.getDataStore(gpiFile);
String parmNameAndLevel = gpi.getParmID().getCompositeName();
ByteDataRecord br = new ByteDataRecord(parmNameAndLevel,
GRID_PARM_INFO_GRP, new byte[1]);
br.setDataAttributes(getGpiAsMap(gpi));
ds.addDataRecord(br);
ds.store();
} catch (Exception e) {
throw new GfeException("", e);
}
}
}

View file

@ -1,146 +0,0 @@
/**
* 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.edex.plugin.gfe.server.database;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.raytheon.edex.plugin.gfe.exception.GfeConfigurationException;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID.DataType;
import com.raytheon.uf.common.dataplugin.gfe.exception.GfeException;
/**
* TODO Add Description
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 15, 2011 dgilling Initial creation
*
* </pre>
*
* @author dgilling
* @version 1.0
*/
public class HLSTopoDatabaseManager {
private static Map<String, HLSTopoDatabase> hlsTopoDbMap = new HashMap<String, HLSTopoDatabase>();
/**
* A private constructor so that Java does not attempt to create one for us.
* As this class should not be instantiated, do not attempt to ever call
* this constructor; it will simply throw an AssertionError.
*
*/
private HLSTopoDatabaseManager() {
throw new AssertionError();
}
/**
* Initialized the HLS topo database for the given site ID.
*
* @param siteID
* The site for which the HLS topo database needs to be
* initialized.
* @throws GfeException
*/
public static void initializeHLSTopoDatabase(String siteID)
throws GfeException {
for (String source : getHLSTopoSources()) {
HLSTopoDatabase database = new HLSTopoDatabase(siteID, source);
hlsTopoDbMap.put(siteID + " " + source, database);
}
}
/**
* Return the HLS topo database associated with the specified site ID and
* data source.
*
* @param siteID
* the site ID whose HLS topo database is to be retrieved.
* @param source
* the database source ("NED", for example)
* @return The HLSTopo database associated with siteID, or null if the HLS
* topo database for that site has not been initialized.
*/
public static HLSTopoDatabase getHLSTopoDatabase(String siteID,
String source) {
return hlsTopoDbMap.get(siteID + " " + source);
}
/**
* Remove the HLS topo database for siteID. After calling this method, calls
* to getHLSTopoDatabase for the site will return null until the HLS topo
* database for the site is re-initialized.
*
* @param siteID
* The site whose HLS topo database should be removed from the
* manager.
*/
public static void removeHLSTopoDatabase(String siteID, String source) {
hlsTopoDbMap.remove(siteID + " " + source);
}
/**
* Get a database ID for the HLS topo database for the specified siteID and
* source.
*
* @param siteID
* The site for which to obtain a HLS topo database ID.
* @param source
* The data source for which to obtain a HLS topo database ID.
* @return a DatabaseID for the HLS topo database
* @throws GfeConfigurationException
* if the database ID cannot be created.
*/
public static DatabaseID getHLSTopoDbId(String siteID, String source) {
return new DatabaseID(siteID, DataType.GRID, "D2D", source);
}
/**
* @return
*/
public static List<String> getHLSTopoSources() {
// TODO: read from properties file?
List<String> sources = Arrays.asList(new String[] { "CRMTopo", "NED" });
return sources;
}
/**
* @param siteID
* @return
*/
public static List<DatabaseID> getHLSTopoDatabases(String siteID) {
List<DatabaseID> dbs = new ArrayList<DatabaseID>();
for (String source : getHLSTopoSources()) {
dbs.add(getHLSTopoDbId(siteID, source));
}
return dbs;
}
}

View file

@ -99,6 +99,7 @@ import com.vividsolutions.jts.io.WKTReader;
* 04/08/08 #875 bphillip Initial Creation
* 06/17/08 #940 bphillip Implemented GFE Locking
* 06/18/08 njensen Added discrete/wx to getGridData()
* 05/04/12 #574 dgilling Restructure class to better match AWIPS1.
*
* </pre>
*
@ -1151,25 +1152,9 @@ public class IFPGridDatabase extends GridDatabase {
}
@Override
public void dbSizeStats() {
}
public void deleteDb() {
// TODO Auto-generated method stub
}
public void dumpStatistics() {
// TODO Auto-generated method stub
}
@Override
public String getProjectionId() {
// TODO Auto-generated method stub
return null;
return this.gridConfig.projectionData().getProjectionID();
}
@Override
@ -2334,4 +2319,14 @@ public class IFPGridDatabase extends GridDatabase {
psis.add(psi);
storeGridParmInfo(gpis, psis, storeOp);
}
/*
* (non-Javadoc)
*
* @see com.raytheon.edex.plugin.gfe.server.database.GridDatabase#deleteDb()
*/
@Override
public void deleteDb() {
// Auto-generated method stub
}
}

Some files were not shown because too many files have changed in this diff Show more