13.4.1-11 baseline

Former-commit-id: c0376ce9ed [formerly 2edee36158 [formerly e414ae01ab52b3940647e46e22bba3b89790c142]]
Former-commit-id: 2edee36158
Former-commit-id: d6319a2ca6
This commit is contained in:
Steve Harris 2013-05-21 09:19:25 -04:00
parent 294c127b0a
commit 65d8f51034
31 changed files with 729 additions and 449 deletions

View file

@ -267,8 +267,7 @@
id="com.raytheon.uf.common.dataplugin.radar" id="com.raytheon.uf.common.dataplugin.radar"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.edex.decodertools" id="com.raytheon.uf.edex.decodertools"
@ -302,8 +301,7 @@
id="com.raytheon.uf.common.dataaccess" id="com.raytheon.uf.common.dataaccess"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.image" id="com.raytheon.uf.common.image"

View file

@ -109,8 +109,7 @@
id="com.raytheon.uf.common.dataplugin.grid" id="com.raytheon.uf.common.dataplugin.grid"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.dataplugin.grib" id="com.raytheon.uf.common.dataplugin.grib"
@ -192,8 +191,7 @@
id="com.raytheon.uf.common.dataplugin.maps" id="com.raytheon.uf.common.dataplugin.maps"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.viz.core.maps" id="com.raytheon.uf.viz.core.maps"

View file

@ -52,8 +52,7 @@
id="com.raytheon.uf.common.dataplugin.ffmp" id="com.raytheon.uf.common.dataplugin.ffmp"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.viz.monitor.ffmp" id="com.raytheon.uf.viz.monitor.ffmp"

View file

@ -54,8 +54,7 @@
id="com.raytheon.uf.common.datadelivery.request" id="com.raytheon.uf.common.datadelivery.request"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.datadelivery.event" id="com.raytheon.uf.common.datadelivery.event"
@ -68,8 +67,7 @@
id="com.raytheon.uf.common.registry.ebxml" id="com.raytheon.uf.common.registry.ebxml"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.registry.event" id="com.raytheon.uf.common.registry.event"
@ -82,8 +80,7 @@
id="com.raytheon.uf.common.useradmin" id="com.raytheon.uf.common.useradmin"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.viz.useradmin" id="com.raytheon.uf.viz.useradmin"
@ -103,8 +100,7 @@
id="com.raytheon.uf.common.datadelivery.service" id="com.raytheon.uf.common.datadelivery.service"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.uf.common.stats" id="com.raytheon.uf.common.stats"

View file

@ -19,10 +19,123 @@
further_licensing_information. further_licensing_information.
--> -->
<DerivedParameter abbreviation="CapeStk" name="Cape Stack"> <DerivedParameter abbreviation="CapeStk" name="Cape Stack">
<!-- For Composite Agl levels it is better to explicitly list the levels
to Union to avoid pulling in extra levels, specifically levels defined at
kft heights. -->
<Method name="Union" levels="0-1kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
</Method>
<Method name="Union" levels="0-1.5kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
</Method>
<Method name="Union" levels="0-2kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
<Field abbreviation="cCape" level="2kmAgl" />
</Method>
<Method name="Union" levels="0-2.5kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
<Field abbreviation="cCape" level="2kmAgl" />
<Field abbreviation="cCape" level="2.5kmAgl" />
</Method>
<Method name="Union" levels="0-3kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
<Field abbreviation="cCape" level="2kmAgl" />
<Field abbreviation="cCape" level="2.5kmAgl" />
<Field abbreviation="cCape" level="3kmAgl" />
</Method>
<Method name="Union" levels="0-4kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
<Field abbreviation="cCape" level="2kmAgl" />
<Field abbreviation="cCape" level="2.5kmAgl" />
<Field abbreviation="cCape" level="3kmAgl" />
<Field abbreviation="cCape" level="3.5kmAgl" />
<Field abbreviation="cCape" level="4kmAgl" />
</Method>
<Method name="Union" levels="0-5kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
<Field abbreviation="cCape" level="2kmAgl" />
<Field abbreviation="cCape" level="2.5kmAgl" />
<Field abbreviation="cCape" level="3kmAgl" />
<Field abbreviation="cCape" level="3.5kmAgl" />
<Field abbreviation="cCape" level="4kmAgl" />
<Field abbreviation="cCape" level="4.5kmAgl" />
<Field abbreviation="cCape" level="5kmAgl" />
</Method>
<Method name="Union" levels="0-6kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
<Field abbreviation="cCape" level="2kmAgl" />
<Field abbreviation="cCape" level="2.5kmAgl" />
<Field abbreviation="cCape" level="3kmAgl" />
<Field abbreviation="cCape" level="3.5kmAgl" />
<Field abbreviation="cCape" level="4kmAgl" />
<Field abbreviation="cCape" level="4.5kmAgl" />
<Field abbreviation="cCape" level="5kmAgl" />
<Field abbreviation="cCape" level="5.5kmAgl" />
<Field abbreviation="cCape" level="6kmAgl" />
</Method>
<Method name="Union" levels="0-8kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
<Field abbreviation="cCape" level="2kmAgl" />
<Field abbreviation="cCape" level="2.5kmAgl" />
<Field abbreviation="cCape" level="3kmAgl" />
<Field abbreviation="cCape" level="3.5kmAgl" />
<Field abbreviation="cCape" level="4kmAgl" />
<Field abbreviation="cCape" level="4.5kmAgl" />
<Field abbreviation="cCape" level="5kmAgl" />
<Field abbreviation="cCape" level="5.5kmAgl" />
<Field abbreviation="cCape" level="6kmAgl" />
<Field abbreviation="cCape" level="7kmAgl" />
<Field abbreviation="cCape" level="8kmAgl" />
</Method>
<Method name="Union" levels="0-10kmAgl">
<Field abbreviation="cCape" level="0kmAgl" />
<Field abbreviation="cCape" level="0.5kmAgl" />
<Field abbreviation="cCape" level="1kmAgl" />
<Field abbreviation="cCape" level="1.5kmAgl" />
<Field abbreviation="cCape" level="2kmAgl" />
<Field abbreviation="cCape" level="2.5kmAgl" />
<Field abbreviation="cCape" level="3kmAgl" />
<Field abbreviation="cCape" level="3.5kmAgl" />
<Field abbreviation="cCape" level="4kmAgl" />
<Field abbreviation="cCape" level="4.5kmAgl" />
<Field abbreviation="cCape" level="5kmAgl" />
<Field abbreviation="cCape" level="5.5kmAgl" />
<Field abbreviation="cCape" level="6kmAgl" />
<Field abbreviation="cCape" level="7kmAgl" />
<Field abbreviation="cCape" level="8kmAgl" />
<Field abbreviation="cCape" level="9kmAgl" />
<Field abbreviation="cCape" level="10kmAgl" />
</Method>
<Method name="Union" levels="C,FHAG"> <Method name="Union" levels="C,FHAG">
<Field abbreviation="cCape"/> <Field abbreviation="cCape" />
</Method> </Method>
<Method name="Union" levels="C,MB"> <Method name="Union" levels="C,MB">
<Field abbreviation="cCape"/> <Field abbreviation="cCape" />
</Method> </Method>
</DerivedParameter> </DerivedParameter>

View file

@ -43,6 +43,7 @@ import com.raytheon.uf.common.monitor.xml.SourceXML;
* Jul 20, 2011 mpduff Initial creation * Jul 20, 2011 mpduff Initial creation
* 01/14/13 1569 dhladky changed arraylist to list * 01/14/13 1569 dhladky changed arraylist to list
* 04/15/13 1890 dhladky Changed COUNTY to use constant * 04/15/13 1890 dhladky Changed COUNTY to use constant
* 05/10/13 1919 mpduff If there are forced pfafs then the aggregate is forced.
* *
* </pre> * </pre>
* *
@ -57,7 +58,7 @@ public class FFFGForceUtil {
private List<Long> pfafList = new ArrayList<Long>(); private List<Long> pfafList = new ArrayList<Long>();
private FFMPResource resource; private final FFMPResource resource;
private String domain = "NA"; private String domain = "NA";
@ -65,7 +66,7 @@ public class FFFGForceUtil {
private SourceXML sourceXML2 = null; private SourceXML sourceXML2 = null;
private FFMPGuidanceInterpolation interp; private final FFMPGuidanceInterpolation interp;
private double src1Hr = -999; private double src1Hr = -999;
@ -212,6 +213,8 @@ public class FFFGForceUtil {
} }
} }
} }
} else if (!forcedPfafList.isEmpty()) {
forced = true;
} }
} }
} }
@ -244,26 +247,25 @@ public class FFFGForceUtil {
return forcedList; return forcedList;
} }
public float getAvgForcedValue(List<Long> pfafList, public float getAvgForcedValue(List<Long> pfafList, List<Long> forcedPfafs,
List<Long> forcedPfafs, FFMPGuidanceInterpolation interpolation, long expiration,
FFMPGuidanceInterpolation interpolation, FFMPTemplates templates) {
long expiration, FFMPTemplates templates) {
float tvalue = 0.0f; float tvalue = 0.0f;
float value; float value;
int i = 0; int i = 0;
if (interpolation.isInterpolate() == false) { if (interpolation.isInterpolate() == false) {
FFFGDataMgr dman = FFFGDataMgr.getInstance(); FFFGDataMgr dman = FFFGDataMgr.getInstance();
for (long pfaf: forcedPfafs) { for (long pfaf : forcedPfafs) {
long countyFips = templates.getCountyFipsByPfaf(pfaf); long countyFips = templates.getCountyFipsByPfaf(pfaf);
templates.getCountyFipsByPfaf(pfaf); templates.getCountyFipsByPfaf(pfaf);
value = dman.adjustValue(Float.NaN, interpolation.getStandardSource(), pfaf, value = dman.adjustValue(Float.NaN,
countyFips); interpolation.getStandardSource(), pfaf, countyFips);
tvalue += value; tvalue += value;
i++; i++;
} }
return tvalue/i; return tvalue / i;
} }
return Float.NaN; return Float.NaN;
@ -307,7 +309,8 @@ public class FFFGForceUtil {
} }
/** /**
* @param sliderTime the sliderTime to set * @param sliderTime
* the sliderTime to set
*/ */
public void setSliderTime(double sliderTime) { public void setSliderTime(double sliderTime) {
this.sliderTime = sliderTime; this.sliderTime = sliderTime;

View file

@ -77,7 +77,8 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData;
* Apr 15, 2013 1911 dhladky Fixed forced FFG for centered aggregates. * Apr 15, 2013 1911 dhladky Fixed forced FFG for centered aggregates.
* Apr 24, 2013 1946 mpduff Fixed FFFG value for ALL when an aggregate is forced * Apr 24, 2013 1946 mpduff Fixed FFFG value for ALL when an aggregate is forced
* Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP. * Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP.
* May 7, 2013 1986 njensen Removed unnecessary sort * May 07, 2013 1986 njensen Removed unnecessary sort
* May 10, 2013 1919 mpduff Fixed problem with VGBs
* *
* </pre> * </pre>
* *
@ -352,7 +353,6 @@ public class FFMPDataGenerator {
String lid = vgBasin.getLid(); String lid = vgBasin.getLid();
if (lid != null) { if (lid != null) {
StringBuilder sb = new StringBuilder(lid); StringBuilder sb = new StringBuilder(lid);
// in this special case it is actually the LID // in this special case it is actually the LID
trd.setPfaf(lid); trd.setPfaf(lid);
@ -409,21 +409,18 @@ public class FFMPDataGenerator {
for (String guidType : guidBasins.keySet()) { for (String guidType : guidBasins.keySet()) {
guidance = Float.NaN; guidance = Float.NaN;
FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(sliderTime);
FFMPTableCellData guidCellData = getGuidanceCellData( FFMPTableCellData guidCellData = getGuidanceCellData(
cBasin, domain, guidType, parentBasinPfaf); cBasin, domain, guidType, parentBasinPfaf);
if (guidCellData == null) { if (guidCellData == null) {
guidCellData = new FFMPTableCellData( // check for forcing even if no data are available
FIELDS.GUIDANCE, Float.NaN); guidance = getForcedAvg(domain, cBasin, guidType);
} else {
guidance = guidCellData.getValueAsFloat();
} }
trd.setTableCellData(i + 4, guidCellData); trd.setTableCellData(i + 4, guidCellData);
float ratioValue = Float.NaN; float ratioValue = Float.NaN;
float diffValue = Float.NaN; float diffValue = Float.NaN;
// If guidance is NaN then it cannot be > 0 // If guidance is NaN then it cannot be > 0
if (!qpe.isNaN() && (guidance > 0.0f)) { if (!qpe.isNaN() && (guidance > 0.0f)) {
ratioValue = FFMPUtils.getRatioValue(qpe, guidance); ratioValue = FFMPUtils.getRatioValue(qpe, guidance);
@ -433,7 +430,6 @@ public class FFMPDataGenerator {
FIELDS.RATIO, ratioValue)); FIELDS.RATIO, ratioValue));
trd.setTableCellData(i + 6, new FFMPTableCellData( trd.setTableCellData(i + 6, new FFMPTableCellData(
FIELDS.DIFF, diffValue)); FIELDS.DIFF, diffValue));
i += 3; i += 3;
} }
} else { } else {
@ -441,7 +437,6 @@ public class FFMPDataGenerator {
} }
tData.addDataRow(trd); tData.addDataRow(trd);
} }
} else { } else {
displayName = getDisplayName(cBasin); displayName = getDisplayName(cBasin);
@ -497,15 +492,12 @@ public class FFMPDataGenerator {
guidance = Float.NaN; guidance = Float.NaN;
FFFGForceUtil forceUtil = forceUtils.get(guidType); FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(sliderTime); forceUtil.setSliderTime(sliderTime);
FFMPTableCellData guidCellData = getGuidanceCellData( FFMPTableCellData guidCellData = getGuidanceCellData(
cBasin, domain, guidType, cBasinPfaf); cBasin, domain, guidType, cBasinPfaf);
if (guidCellData == null) { if (guidCellData == null) {
// check for forcing even if no data are available // check for forcing even if no data are available
guidance = getForcedAvg(forceUtil, domain, cBasin, guidance = getForcedAvg(domain, cBasin, guidType);
guidType);
boolean forced = !guidance.isNaN();
guidCellData = new FFMPTableCellData(
FIELDS.GUIDANCE, guidance, forced);
} else { } else {
guidance = guidCellData.getValueAsFloat(); guidance = guidCellData.getValueAsFloat();
} }
@ -554,6 +546,7 @@ public class FFMPDataGenerator {
boolean forced = false; boolean forced = false;
Float guidance = Float.NaN; Float guidance = Float.NaN;
FFFGForceUtil forceUtil = forceUtils.get(guidType); FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(sliderTime);
// If aggregate, get basins within the aggregate // If aggregate, get basins within the aggregate
if (cBasin.getAggregated()) { if (cBasin.getAggregated()) {
@ -569,6 +562,9 @@ public class FFMPDataGenerator {
siteKey, domain, huc); siteKey, domain, huc);
pfafList.add(ft.getAggregatedPfaf(cBasinPfaf, siteKey, huc)); pfafList.add(ft.getAggregatedPfaf(cBasinPfaf, siteKey, huc));
} }
} else {
pfafList = new ArrayList<Long>();
pfafList.add(cBasinPfaf);
} }
if (FFFGDataMgr.getInstance().isForcingConfigured()) { if (FFFGDataMgr.getInstance().isForcingConfigured()) {
@ -581,17 +577,19 @@ public class FFMPDataGenerator {
forced = forceUtil.isForced(); forced = forceUtil.isForced();
} }
if (!forcedPfafs.isEmpty() || !pfafList.isEmpty() if (!forcedPfafs.isEmpty() || forced || !pfafList.isEmpty()) {
&& centeredAggregationKey == null) { // Recalculate guidance using the forced value(s)
FFMPBasinData basinData = guidRecords.get(guidType).getBasinData( guidance = guidRecords
ALL); .get(guidType)
guidance = basinData.getAverageGuidanceValue(pfafList, resource .getBasinData(ALL)
.getGuidanceInterpolators().get(guidType), guidance, .getAverageGuidanceValue(pfafList,
forcedPfafs, resource.getGuidSourceExpiration(guidType)); resource.getGuidanceInterpolators().get(guidType),
forced = !forcedPfafs.isEmpty(); guidance, forcedPfafs,
resource.getGuidSourceExpiration(guidType));
} else { } else {
guidance = resource.getGuidanceValue(ffmpGuidBasin, paintRefTime, guidance = resource.getGuidanceValue(ffmpGuidBasin, paintRefTime,
guidType); guidType);
if (guidance < 0.0f) { if (guidance < 0.0f) {
guidance = Float.NaN; guidance = Float.NaN;
} }
@ -600,8 +598,9 @@ public class FFMPDataGenerator {
return new FFMPTableCellData(FIELDS.GUIDANCE, guidance, forced); return new FFMPTableCellData(FIELDS.GUIDANCE, guidance, forced);
} }
private float getForcedAvg(FFFGForceUtil forceUtil, String domain, private float getForcedAvg(String domain, FFMPBasin cBasin, String guidType) {
FFMPBasin cBasin, String guidType) { FFFGForceUtil forceUtil = forceUtils.get(guidType);
forceUtil.setSliderTime(sliderTime);
FFFGDataMgr fdm = FFFGDataMgr.getInstance(); FFFGDataMgr fdm = FFFGDataMgr.getInstance();
List<Long> forcedPfafs; List<Long> forcedPfafs;
List<Long> pfafList = new ArrayList<Long>(); List<Long> pfafList = new ArrayList<Long>();
@ -641,12 +640,6 @@ public class FFMPDataGenerator {
guidance = forceUtil.getAvgForcedValue(pfafList, forcedPfafs, guidance = forceUtil.getAvgForcedValue(pfafList, forcedPfafs,
resource.getGuidanceInterpolators().get(guidType), resource.getGuidanceInterpolators().get(guidType),
resource.getGuidSourceExpiration(guidType), ft); resource.getGuidSourceExpiration(guidType), ft);
// } else if (forcedPfafs.size() > 1) {
// guidance = forceUtil.getAvgForcedValue(pfafList,
// forcedPfafs,
// resource.getGuidanceInterpolators().get(guidType),
// resource.getGuidSourceExpiration(), ft);
// forced = true;
} }
} else { } else {
// TODO Calculate a max value // TODO Calculate a max value

View file

@ -35,8 +35,7 @@
id="com.raytheon.uf.common.dataplugin.gfe" id="com.raytheon.uf.common.dataplugin.gfe"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.viz.ghg" id="com.raytheon.viz.ghg"

View file

@ -70,8 +70,7 @@
id="com.raytheon.uf.common.hydro" id="com.raytheon.uf.common.hydro"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
<plugin <plugin
id="com.raytheon.viz.mpe" id="com.raytheon.viz.mpe"

View file

@ -35,7 +35,6 @@
id="com.raytheon.uf.common.dataplugin.satellite" id="com.raytheon.uf.common.dataplugin.satellite"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"/>
unpack="false"/>
</feature> </feature>

View file

@ -150,7 +150,7 @@ import com.vividsolutions.jts.io.WKTReader;
* Feb 15, 2013 1607 jsanchez Added two variables corEventTime and corCreateTime. * Feb 15, 2013 1607 jsanchez Added two variables corEventTime and corCreateTime.
* Feb 15, 2013 15820 Qinglu Lin Added createOfficeTimezoneMap() and added logic so that localtimezone * Feb 15, 2013 15820 Qinglu Lin Added createOfficeTimezoneMap() and added logic so that localtimezone
* and secondtimezone can get correct values when warning area covers two time zones. * and secondtimezone can get correct values when warning area covers two time zones.
* * May 10, 2013 1951 rjpeter Updated ugcZones references
* </pre> * </pre>
* *
* @author njensen * @author njensen
@ -239,7 +239,7 @@ public class TemplateRunner {
WKTReader wkt = new WKTReader(); WKTReader wkt = new WKTReader();
DataTime[] datatimes = warngenLayer.getDescriptor().getFramesInfo() DataTime[] datatimes = warngenLayer.getDescriptor().getFramesInfo()
.getFrameTimes(); .getFrameTimes();
Date eventTime = datatimes != null && datatimes.length > 0 ? datatimes[datatimes.length - 1] Date eventTime = (datatimes != null) && (datatimes.length > 0) ? datatimes[datatimes.length - 1]
.getRefTimeAsCalendar().getTime() : startTime; .getRefTimeAsCalendar().getTime() : startTime;
Date simulatedTime = SimulatedTime.getSystemTime().getTime(); Date simulatedTime = SimulatedTime.getSystemTime().getTime();
WarngenConfiguration config = warngenLayer.getConfiguration(); WarngenConfiguration config = warngenLayer.getConfiguration();
@ -319,7 +319,7 @@ public class TemplateRunner {
Map<String, Double> intersectSize = new HashMap<String, Double>(); Map<String, Double> intersectSize = new HashMap<String, Double>();
String[] oneLetterTZ; String[] oneLetterTZ;
double minSize = 1.0E-3d; double minSize = 1.0E-3d;
if (areas != null && areas.length > 0) { if ((areas != null) && (areas.length > 0)) {
Set<String> timeZones = new HashSet<String>(); Set<String> timeZones = new HashSet<String>();
for (AffectedAreas area : areas) { for (AffectedAreas area : areas) {
if (area.getTimezone() != null) { if (area.getTimezone() != null) {
@ -347,9 +347,11 @@ public class TemplateRunner {
n2 = 0; n2 = 0;
size = 0.0d; size = 0.0d;
totalSize = 0.0d; totalSize = 0.0d;
if (timezoneGeom != null && warningArea != null) { if ((timezoneGeom != null)
if (intersectSize.get(oneLetterTZ[i]) != null) && (warningArea != null)) {
if (intersectSize.get(oneLetterTZ[i]) != null) {
continue; continue;
}
poly1 = new Polygon[warningArea poly1 = new Polygon[warningArea
.getNumGeometries()]; .getNumGeometries()];
n1 = warningArea.getNumGeometries(); n1 = warningArea.getNumGeometries();
@ -369,19 +371,22 @@ public class TemplateRunner {
for (Polygon p2 : poly2) { for (Polygon p2 : poly2) {
size = p1.intersection(p2) size = p1.intersection(p2)
.getArea(); .getArea();
if (size > 0.0) if (size > 0.0) {
totalSize += size; totalSize += size;
} }
if (totalSize > minSize) }
if (totalSize > minSize) {
break; // save time when the size of break; // save time when the size of
// poly1 or poly2 is large // poly1 or poly2 is large
} }
}
intersectSize intersectSize
.put(oneLetterTZ[i], totalSize); .put(oneLetterTZ[i], totalSize);
} else } else {
throw new VizException( throw new VizException(
"Either timezoneGeom or/and warningArea is null. " "Either timezoneGeom or/and warningArea is null. "
+ "Timezone cannot be determined."); + "Timezone cannot be determined.");
}
System.out System.out
.println("Time to do size computation = " .println("Time to do size computation = "
+ (System.currentTimeMillis() - t0)); + (System.currentTimeMillis() - t0));
@ -393,19 +398,20 @@ public class TemplateRunner {
// area is very small, // area is very small,
// use the timezone of larger intersection size. // use the timezone of larger intersection size.
if (timeZones.size() == 0) { if (timeZones.size() == 0) {
if (intersectSize.size() > 1) if (intersectSize.size() > 1) {
if (intersectSize.get(oneLetterTZ[0]) > intersectSize if (intersectSize.get(oneLetterTZ[0]) > intersectSize
.get(oneLetterTZ[1])) { .get(oneLetterTZ[1])) {
timeZones.add(oneLetterTZ[0]); timeZones.add(oneLetterTZ[0]);
} else { } else {
timeZones.add(oneLetterTZ[1]); timeZones.add(oneLetterTZ[1]);
} }
else } else {
throw new VizException( throw new VizException(
"The size of intersectSize is less than 1, " "The size of intersectSize is less than 1, "
+ "timezone cannot be determined."); + "timezone cannot be determined.");
} }
} }
}
} else { } else {
throw new VizException( throw new VizException(
"Calling to area.getTimezone() returns null."); "Calling to area.getTimezone() returns null.");
@ -414,16 +420,17 @@ public class TemplateRunner {
Map<String, String> officeCityTimezone = createOfficeTimezoneMap(); Map<String, String> officeCityTimezone = createOfficeTimezoneMap();
String cityTimezone = null; String cityTimezone = null;
if (officeCityTimezone != null) if (officeCityTimezone != null) {
cityTimezone = officeCityTimezone.get(warngenLayer cityTimezone = officeCityTimezone.get(warngenLayer
.getLocalizedSite()); .getLocalizedSite());
}
Iterator<String> iterator = timeZones.iterator(); Iterator<String> iterator = timeZones.iterator();
if (timeZones.size() > 1 && cityTimezone != null) { if ((timeZones.size() > 1) && (cityTimezone != null)) {
String timezone; String timezone;
while (iterator.hasNext()) { while (iterator.hasNext()) {
timezone = iterator.next(); timezone = iterator.next();
if (timezone.equals(cityTimezone) if (timezone.equals(cityTimezone)
&& context.get("localtimezone") == null) { && (context.get("localtimezone") == null)) {
context.put("localtimezone", timezone); context.put("localtimezone", timezone);
} else if (context.get("secondtimezone") == null) { } else if (context.get("secondtimezone") == null) {
context.put("secondtimezone", timezone); context.put("secondtimezone", timezone);
@ -441,7 +448,7 @@ public class TemplateRunner {
} }
// CAN and EXP products follow different rules as followups // CAN and EXP products follow different rules as followups
if (!(selectedAction == WarningAction.CAN || selectedAction == WarningAction.EXP)) { if (!((selectedAction == WarningAction.CAN) || (selectedAction == WarningAction.EXP))) {
wx = new Wx(config, stormTrackState, wx = new Wx(config, stormTrackState,
warngenLayer.getStormLocations(stormTrackState), warngenLayer.getStormLocations(stormTrackState),
startTime.getTime(), DateUtil.roundDateTo15(endTime) startTime.getTime(), DateUtil.roundDateTo15(endTime)
@ -463,10 +470,11 @@ public class TemplateRunner {
context.put("duration", duration); context.put("duration", duration);
context.put("event", eventTime); context.put("event", eventTime);
if (selectedAction == WarningAction.COR) if (selectedAction == WarningAction.COR) {
context.put("TMLtime", eventTime); context.put("TMLtime", eventTime);
else } else {
context.put("TMLtime", simulatedTime); context.put("TMLtime", simulatedTime);
}
context.put("ugcline", context.put("ugcline",
FipsUtil.getUgcLine(areas, wx.getEndTime(), 15)); FipsUtil.getUgcLine(areas, wx.getEndTime(), 15));
context.put("areaPoly", GisUtil.convertCoords(warngenLayer context.put("areaPoly", GisUtil.convertCoords(warngenLayer
@ -550,7 +558,7 @@ public class TemplateRunner {
canOrExpCal.add(Calendar.MILLISECOND, 1); canOrExpCal.add(Calendar.MILLISECOND, 1);
context.put( context.put(
"ugcline", "ugcline",
FipsUtil.getUgcLine(oldWarn.getUgczones(), FipsUtil.getUgcLine(oldWarn.getUgcZones(),
canOrExpCal.getTime(), 0)); canOrExpCal.getTime(), 0));
String oldGeom = oldWarn.getGeometry().toString(); String oldGeom = oldWarn.getGeometry().toString();
context.put("areaPoly", GisUtil.convertCoords(wkt.read(oldGeom) context.put("areaPoly", GisUtil.convertCoords(wkt.read(oldGeom)
@ -605,7 +613,7 @@ public class TemplateRunner {
context.put("includedWatches", config.getIncludedWatches()); context.put("includedWatches", config.getIncludedWatches());
// Additional Information for Followup Products // Additional Information for Followup Products
if (etn != null && etn.length() > 0) { if ((etn != null) && (etn.length() > 0)) {
AbstractWarningRecord oldWarn = null; AbstractWarningRecord oldWarn = null;
// COR product - What are we correcting? // COR product - What are we correcting?
@ -618,7 +626,7 @@ public class TemplateRunner {
CurrentWarnings cw = CurrentWarnings.getInstance(threeLetterSiteId); CurrentWarnings cw = CurrentWarnings.getInstance(threeLetterSiteId);
if (selectedAction == WarningAction.COR && !allowsNewProduct) { if ((selectedAction == WarningAction.COR) && !allowsNewProduct) {
oldWarn = cw.getFollowUpByTracking(etn, phenSig, oldWarn = cw.getFollowUpByTracking(etn, phenSig,
new WarningAction[] { WarningAction.CON, new WarningAction[] { WarningAction.CON,
WarningAction.COR }); WarningAction.COR });
@ -627,8 +635,8 @@ public class TemplateRunner {
} }
// Hydro product // Hydro product
if (oldWarn.getFloodSeverity() != null if ((oldWarn.getFloodSeverity() != null)
&& oldWarn.getFloodSeverity().length() >= 1) { && (oldWarn.getFloodSeverity().length() >= 1)) {
context.put("floodseverity", oldWarn.getFloodSeverity()); context.put("floodseverity", oldWarn.getFloodSeverity());
context.put("floodic", oldWarn.getImmediateCause()); context.put("floodic", oldWarn.getImmediateCause());
} }
@ -651,8 +659,9 @@ public class TemplateRunner {
context.put("now", new Date(wwaMNDTime)); context.put("now", new Date(wwaMNDTime));
// original warning's 'now' time used in MND header // original warning's 'now' time used in MND header
context.put("corCreateTime", new Date(wwaMNDTime)); context.put("corCreateTime", new Date(wwaMNDTime));
} else } else {
context.put("now", simulatedTime); context.put("now", simulatedTime);
}
context.put("event", oldWarn.getIssueTime().getTime()); context.put("event", oldWarn.getIssueTime().getTime());
// original warning's 'event' time, which should match the storm // original warning's 'event' time, which should match the storm
// track // track
@ -721,9 +730,10 @@ public class TemplateRunner {
} }
} }
} }
if (untilIndex < 0 || atIndex < 0 || elipsisIndex < 0) if ((untilIndex < 0) || (atIndex < 0) || (elipsisIndex < 0)) {
throw new VizException("Cannot find * AT line."); throw new VizException("Cannot find * AT line.");
} }
}
Calendar cal = oldWarn.getEndTime(); Calendar cal = oldWarn.getEndTime();
cal.add(Calendar.MILLISECOND, 1); cal.add(Calendar.MILLISECOND, 1);
@ -779,18 +789,18 @@ public class TemplateRunner {
oldWarn.getGeometry(), removedAreas, oldWarn.getGeometry(), removedAreas,
threeLetterSiteId); threeLetterSiteId);
for (int i = 0; i < cancelareas.length; i++) { for (int i = 0; i < cancelareas.length; i++) {
for (int j = 0; j < areas.length; j++) { for (AffectedAreas area : areas) {
if (cancelareas[i] != null if ((cancelareas[i] != null)
&& cancelareas[i].getFips().equals( && cancelareas[i].getFips().equals(
areas[j].getFips())) { area.getFips())) {
cancelareas[i] = null; cancelareas[i] = null;
} }
} }
} }
ArrayList<AffectedAreas> al = new ArrayList<AffectedAreas>(); ArrayList<AffectedAreas> al = new ArrayList<AffectedAreas>();
for (int i = 0; i < cancelareas.length; i++) { for (AffectedAreas cancelarea : cancelareas) {
if (cancelareas[i] != null) { if (cancelarea != null) {
al.add(cancelareas[i]); al.add(cancelarea);
} }
} }
context.put("cancel" context.put("cancel"
@ -970,7 +980,7 @@ public class TemplateRunner {
WatchUtil rval = null; WatchUtil rval = null;
String[] includedWatches = config.getIncludedWatches(); String[] includedWatches = config.getIncludedWatches();
if (includedWatches != null && includedWatches.length > 0) { if ((includedWatches != null) && (includedWatches.length > 0)) {
String phensigList = null; String phensigList = null;
for (String includedWatch : includedWatches) { for (String includedWatch : includedWatches) {
if (includedWatch.equalsIgnoreCase("torWatches")) { if (includedWatch.equalsIgnoreCase("torWatches")) {
@ -1110,7 +1120,7 @@ public class TemplateRunner {
} }
GeospatialData[] geoData = warngenLayer.getGeodataFeatures( GeospatialData[] geoData = warngenLayer.getGeodataFeatures(
asc.getAreaSource(), warngenLayer.getLocalizedSite()); asc.getAreaSource(), warngenLayer.getLocalizedSite());
if (geoData == null || geoData.length == 0) { if ((geoData == null) || (geoData.length == 0)) {
statusHandler.handle(Priority.ERROR, statusHandler.handle(Priority.ERROR,
"Cannot process watches: cannot get geospatial data"); "Cannot process watches: cannot get geospatial data");
return rval; return rval;
@ -1143,8 +1153,9 @@ public class TemplateRunner {
} }
// TODO: Building geometry just to perform this test is probably // TODO: Building geometry just to perform this test is probably
// inefficient with the post-DR-15430 logic... // inefficient with the post-DR-15430 logic...
if (!ar.getGeometry().isEmpty()) if (!ar.getGeometry().isEmpty()) {
work.valid = true; work.valid = true;
}
/* /*
* TODO: Currently adding all zones to the list even if they are not * TODO: Currently adding all zones to the list even if they are not
@ -1159,11 +1170,13 @@ public class TemplateRunner {
* If none of the areas in the watch were neer our warning polygon, * If none of the areas in the watch were neer our warning polygon,
* do not included it. * do not included it.
*/ */
if (!work.valid) if (!work.valid) {
continue; continue;
if (determineAffectedPortions(work.ugcZone, asc, geoData, work.waw)) }
if (determineAffectedPortions(work.ugcZone, asc, geoData, work.waw)) {
rval.addWaw(work.waw); rval.addWaw(work.waw);
} }
}
return rval; return rval;
} }
@ -1190,8 +1203,8 @@ public class TemplateRunner {
Entry<String, String[]> e = null; Entry<String, String[]> e = null;
// Either zero or more than one sates/counties would be wrong // Either zero or more than one sates/counties would be wrong
if (parsed.size() != 1 if ((parsed.size() != 1)
|| (e = parsed.entrySet().iterator().next()).getValue().length != 1) { || ((e = parsed.entrySet().iterator().next()).getValue().length != 1)) {
statusHandler.handle(Priority.ERROR, statusHandler.handle(Priority.ERROR,
"Invalid ugczone in active table entry: " + ugc); "Invalid ugczone in active table entry: " + ugc);
continue; continue;
@ -1206,17 +1219,19 @@ public class TemplateRunner {
"Error generating included watches.", exc); "Error generating included watches.", exc);
return false; return false;
} }
if (feArea == NOT_IN_CWA) if (feArea == NOT_IN_CWA) {
continue; continue;
}
Set<String> feAreas = map.get(stateAbbrev); Set<String> feAreas = map.get(stateAbbrev);
if (feAreas == null) { if (feAreas == null) {
feAreas = new HashSet<String>(); feAreas = new HashSet<String>();
map.put(stateAbbrev, feAreas); map.put(stateAbbrev, feAreas);
} }
if (feArea != null) if (feArea != null) {
feAreas.add(feArea); feAreas.add(feArea);
} }
}
ArrayList<Portion> portions = new ArrayList<Portion>(map.size()); ArrayList<Portion> portions = new ArrayList<Portion>(map.size());
for (Entry<String, Set<String>> e : map.entrySet()) { for (Entry<String, Set<String>> e : map.entrySet()) {
@ -1265,48 +1280,55 @@ public class TemplateRunner {
if ("pa".equals(part)) { if ("pa".equals(part)) {
pa = 1; pa = 1;
continue; continue;
} else if ("nn".equals(part)) } else if ("nn".equals(part)) {
nnn = nn = 1; nnn = nn = 1;
else if ("ss".equals(part)) } else if ("ss".equals(part)) {
sss = ss = 1; sss = ss = 1;
else if ("ee".equals(part)) } else if ("ee".equals(part)) {
eee = ee = 1; eee = ee = 1;
else if ("ww".equals(part)) } else if ("ww".equals(part)) {
www = ww = 1; www = ww = 1;
else if ("nw".equals(part)) } else if ("nw".equals(part)) {
nnn = www = nw = 1; nnn = www = nw = 1;
else if ("nc".equals(part)) } else if ("nc".equals(part)) {
nnn = nc = 1; nnn = nc = 1;
else if ("ne".equals(part)) } else if ("ne".equals(part)) {
nnn = eee = ne = 1; nnn = eee = ne = 1;
else if ("wc".equals(part)) } else if ("wc".equals(part)) {
www = wc = 1; www = wc = 1;
else if ("cc".equals(part)) { } else if ("cc".equals(part)) {
cc = 1; cc = 1;
continue; continue;
} else if ("ec".equals(part)) } else if ("ec".equals(part)) {
eee = ec = 1; eee = ec = 1;
else if ("sw".equals(part)) } else if ("sw".equals(part)) {
sss = www = sw = 1; sss = www = sw = 1;
else if ("sc".equals(part)) } else if ("sc".equals(part)) {
sss = sc = 1; sss = sc = 1;
else if ("se".equals(part)) } else if ("se".equals(part)) {
sss = eee = se = 1; sss = eee = se = 1;
}
partAbrev = part; partAbrev = part;
} }
// decide how to describe these subareas. // decide how to describe these subareas.
if (ne > 0 && nw > 0) if ((ne > 0) && (nw > 0)) {
nn = 1; nn = 1;
if (se > 0 && sw > 0) }
if ((se > 0) && (sw > 0)) {
ss = 1; ss = 1;
if (se > 0 && ne > 0) }
if ((se > 0) && (ne > 0)) {
ee = 1; ee = 1;
if (sw > 0 && nw > 0) }
if ((sw > 0) && (nw > 0)) {
ww = 1; ww = 1;
if (nnn > 0 && sss > 0 && eee > 0 && www > 0) }
if ((nnn > 0) && (sss > 0) && (eee > 0) && (www > 0)) {
return abrev; return abrev;
if (nn > 0 && ss > 0 || ee > 0 && ww > 0) }
if (((nn > 0) && (ss > 0)) || ((ee > 0) && (ww > 0))) {
return abrev; return abrev;
}
if (nnn + sss + eee + www == 3) { if (nnn + sss + eee + www == 3) {
if (www == 0) { if (www == 0) {
abrev = "e"; abrev = "e";
@ -1319,11 +1341,11 @@ public class TemplateRunner {
} }
return abrev; return abrev;
} }
if (nnn == sss && eee == www || cc == m) { if (((nnn == sss) && (eee == www)) || (cc == m)) {
abrev = "c"; abrev = "c";
return abrev; return abrev;
} }
if (pa != 0 && cc == 0) { if ((pa != 0) && (cc == 0)) {
abrev = "pa"; abrev = "pa";
if (--m <= 0) { if (--m <= 0) {
return abrev; return abrev;
@ -1346,9 +1368,10 @@ public class TemplateRunner {
private static String getStateName(String key, AreaSourceConfiguration asc, private static String getStateName(String key, AreaSourceConfiguration asc,
GeospatialData[] geoData) { GeospatialData[] geoData) {
for (GeospatialData g : geoData) { for (GeospatialData g : geoData) {
if (key.equals((String) g.attributes.get("STATE"))) if (key.equals(g.attributes.get("STATE"))) {
return (String) g.parent.attributes.get("NAME"); return (String) g.parent.attributes.get("NAME");
} }
}
return null; return null;
} }
@ -1367,11 +1390,12 @@ public class TemplateRunner {
private static String getFeArea(String stateAbbrev, String ugc, private static String getFeArea(String stateAbbrev, String ugc,
AreaSourceConfiguration asc, GeospatialData[] geoData) { AreaSourceConfiguration asc, GeospatialData[] geoData) {
for (GeospatialData g : geoData) { for (GeospatialData g : geoData) {
if (stateAbbrev.equals((String) g.attributes.get("STATE")) if (stateAbbrev.equals(g.attributes.get("STATE"))
&& ((String) g.attributes.get(asc.getFipsField())) && ((String) g.attributes.get(asc.getFipsField()))
.endsWith(ugc)) .endsWith(ugc)) {
return (String) g.attributes.get(asc.getFeAreaField()); return (String) g.attributes.get(asc.getFeAreaField());
} }
}
// TODO: Is this the correct way to determine if the county is in the // TODO: Is this the correct way to determine if the county is in the
// CWA? // CWA?

View file

@ -33,7 +33,6 @@ import java.util.Set;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord; import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.UGCZone;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord; import com.raytheon.uf.common.dataplugin.warning.WarningRecord;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataplugin.warning.util.AnnotationUtil; import com.raytheon.uf.common.dataplugin.warning.util.AnnotationUtil;
@ -69,7 +68,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Feb 12, 2013 1500 mschenke Refactored to not request full records and only request full * Feb 12, 2013 1500 mschenke Refactored to not request full records and only request full
* record when actually retrieving for use * record when actually retrieving for use
* Apr 22, 2013 jsanchez Set the issue time for follow up warnings. * Apr 22, 2013 jsanchez Set the issue time for follow up warnings.
* * May 10, 2013 1951 rjpeter Updated ugcZones references
* </pre> * </pre>
* *
* @author mschenke * @author mschenke
@ -104,17 +103,21 @@ public class CurrentWarnings {
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (this == obj) if (this == obj) {
return true; return true;
if (obj == null) }
if (obj == null) {
return false; return false;
if (getClass() != obj.getClass()) }
if (getClass() != obj.getClass()) {
return false; return false;
}
WarningKey other = (WarningKey) obj; WarningKey other = (WarningKey) obj;
if (etn.equals(other.etn) == false) if (etn.equals(other.etn) == false) {
return false; return false;
else if (phensig.equals(other.phensig) == false) } else if (phensig.equals(other.phensig) == false) {
return false; return false;
}
return true; return true;
} }
@ -180,11 +183,11 @@ public class CurrentWarnings {
return warnings; return warnings;
} }
private String officeId; private final String officeId;
private Map<String, AbstractWarningRecord> recordsMap = new HashMap<String, AbstractWarningRecord>(); private final Map<String, AbstractWarningRecord> recordsMap = new HashMap<String, AbstractWarningRecord>();
private Map<WarningKey, List<AbstractWarningRecord>> warningMap = new HashMap<WarningKey, List<AbstractWarningRecord>>() { private final Map<WarningKey, List<AbstractWarningRecord>> warningMap = new HashMap<WarningKey, List<AbstractWarningRecord>>() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -231,7 +234,7 @@ public class CurrentWarnings {
for (WarningKey key : keys) { for (WarningKey key : keys) {
AbstractWarningRecord tmp = getNewestByTracking(key.etn, AbstractWarningRecord tmp = getNewestByTracking(key.etn,
key.phensig); key.phensig);
if (tmp != null && rval.contains(tmp) == false) { if ((tmp != null) && (rval.contains(tmp) == false)) {
rval.add(tmp); rval.add(tmp);
} }
} }
@ -263,11 +266,12 @@ public class CurrentWarnings {
end.add(Calendar.MINUTE, 10); end.add(Calendar.MINUTE, 10);
TimeRange t = new TimeRange(warning.getStartTime().getTime(), TimeRange t = new TimeRange(warning.getStartTime().getTime(),
end.getTime()); end.getTime());
if ((action == WarningAction.NEW || action == WarningAction.CON || action == WarningAction.EXT) if (((action == WarningAction.NEW)
|| (action == WarningAction.CON) || (action == WarningAction.EXT))
&& t.contains(current.getTime())) { && t.contains(current.getTime())) {
rval.add(warning); rval.add(warning);
} else if (action == WarningAction.CAN } else if ((action == WarningAction.CAN)
|| action == WarningAction.EXP) { || (action == WarningAction.EXP)) {
rval.clear(); rval.clear();
return rval; return rval;
} }
@ -316,7 +320,7 @@ public class CurrentWarnings {
// rval.setAct("CON"); // rval.setAct("CON");
rval.setGeometry(warning.getGeometry()); rval.setGeometry(warning.getGeometry());
rval.setCountyheader(warning.getCountyheader()); rval.setCountyheader(warning.getCountyheader());
rval.setUgczones(warning.getUgczones()); rval.setUgcZones(warning.getUgcZones());
rval.setLoc(warning.getLoc()); rval.setLoc(warning.getLoc());
rval.setRawmessage(warning.getRawmessage()); rval.setRawmessage(warning.getRawmessage());
rval.setIssueTime(warning.getInsertTime()); rval.setIssueTime(warning.getInsertTime());
@ -325,37 +329,20 @@ public class CurrentWarnings {
} }
// If warning was canceled (CAN) or has expired (EXP), check if // If warning was canceled (CAN) or has expired (EXP), check if
// county // county headers match. If so, rval = null. Otherwise check to
// headers match. If so, rval = null. Otherwise check to see if // see if rval has any UGCZones that the warning does not have.
// rval // If there
// has // are no new UGCZones, set rval to null.
// any UGCZones that the warning does. If there are matching
// UGCZones,
// set rval to null
for (AbstractWarningRecord warning : warnings) { for (AbstractWarningRecord warning : warnings) {
WarningAction action = getAction(warning.getAct()); WarningAction action = getAction(warning.getAct());
if (action == WarningAction.CAN if ((action == WarningAction.CAN)
|| action == WarningAction.EXP) { || (action == WarningAction.EXP)) {
if (rval != null if ((rval != null)
&& warning.getCountyheader().equals( && (warning.getCountyheader().equals(
rval.getCountyheader())) { rval.getCountyheader()) || !warning
.getUgcZones().containsAll(
rval.getUgcZones()))) {
rval = null; rval = null;
} else if (rval != null) {
boolean rv = true;
for (UGCZone a : rval.getUgczones()) {
boolean rv2 = false;
for (UGCZone b : warning.getUgczones()) {
if (a.toString().equals(b.toString())) {
rv2 = true;
}
}
if (rv2 == false) {
rv = false;
}
}
if (rv == true) {
rval = null;
}
} }
} }
} }
@ -429,7 +416,7 @@ public class CurrentWarnings {
for (AbstractWarningRecord warning : warnings) { for (AbstractWarningRecord warning : warnings) {
WarningAction action = getAction(warning.getAct()); WarningAction action = getAction(warning.getAct());
if (t.contains(warning.getIssueTime().getTime()) if (t.contains(warning.getIssueTime().getTime())
&& action == WarningAction.CAN) { && (action == WarningAction.CAN)) {
cancelProd = warning; cancelProd = warning;
} }
if (action == WarningAction.NEW) { if (action == WarningAction.NEW) {
@ -442,13 +429,13 @@ public class CurrentWarnings {
// //
for (AbstractWarningRecord rec : conProds) { for (AbstractWarningRecord rec : conProds) {
if (FipsUtil.containsSameCountiesOrZones(rec.getUgczones(), if (FipsUtil.containsSameCountiesOrZones(rec.getUgcZones(),
cancelProd.getUgczones())) { cancelProd.getUgcZones())) {
conMatchesCan = true; conMatchesCan = true;
} }
} }
if (cancelProd.getUgczones().size() == newProd.getUgczones() if (cancelProd.getUgcZones().size() == newProd.getUgcZones()
.size()) { .size()) {
// Change nothing // Change nothing
rval = cancelProd; rval = cancelProd;

View file

@ -32,9 +32,6 @@ import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.raytheon.uf.common.dataplugin.warning.UGCZone;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.viz.warngen.gis.AffectedAreas; import com.raytheon.viz.warngen.gis.AffectedAreas;
import com.raytheon.viz.warngen.gis.AffectedAreasComparator; import com.raytheon.viz.warngen.gis.AffectedAreasComparator;
import com.raytheon.viz.warnings.DateUtil; import com.raytheon.viz.warnings.DateUtil;
@ -50,8 +47,8 @@ import com.raytheon.viz.warnings.DateUtil;
* May 6, 2008 bwoodle Initial creation * May 6, 2008 bwoodle Initial creation
* Dec 28 2012 DR15599 mgamazaychikov Updated method getListCounties to fix the problem * Dec 28 2012 DR15599 mgamazaychikov Updated method getListCounties to fix the problem
* with generated list of counties. * with generated list of counties.
* Apr 25,2013 1877 jsanchez Sorted the UGC line for cancellations. * Apr 25, 2013 1877 jsanchez Sorted the UGC line for cancellations.
* * May 10, 2013 1951 rjpeter Updated ugcZones references
* </pre> * </pre>
* *
* @author bwoodle * @author bwoodle
@ -59,9 +56,6 @@ import com.raytheon.viz.warnings.DateUtil;
*/ */
public class FipsUtil { public class FipsUtil {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FipsUtil.class);
private static final Map<String, String> fipsToState; private static final Map<String, String> fipsToState;
private static String[][] abbrlist = new String[][] { { "02", "AK" }, private static String[][] abbrlist = new String[][] { { "02", "AK" },
@ -126,7 +120,7 @@ public class FipsUtil {
for (AffectedAreas area : sortedAreas) { for (AffectedAreas area : sortedAreas) {
String ugc = getUgc(area); String ugc = getUgc(area);
if (ugc != null && countiesOrZones.contains(ugc) == false) { if ((ugc != null) && (countiesOrZones.contains(ugc) == false)) {
countiesOrZones.add(ugc); countiesOrZones.add(ugc);
} }
} }
@ -159,15 +153,14 @@ public class FipsUtil {
* @param endtime * @param endtime
* @return * @return
*/ */
public static String getUgcLine(Set<UGCZone> ugcs, Date endtime, public static String getUgcLine(Set<String> ugcs, Date endtime, int interval) {
int interval) {
StringBuffer rval = new StringBuffer(); StringBuffer rval = new StringBuffer();
ArrayList<String> countiesOrZones = new ArrayList<String>(); ArrayList<String> countiesOrZones = new ArrayList<String>();
DateUtil du = new DateUtil(); DateUtil du = new DateUtil();
for (UGCZone ugc : ugcs) { for (String ugc : ugcs) {
if (countiesOrZones.contains(ugc.toString()) == false) { if (countiesOrZones.contains(ugc) == false) {
countiesOrZones.add(ugc.toString()); countiesOrZones.add(ugc);
} }
} }
@ -425,33 +418,15 @@ public class FipsUtil {
return fipsToState.get(statefips); return fipsToState.get(statefips);
} }
public static boolean containsSameCountiesOrZones(Set<UGCZone> a, public static boolean containsSameCountiesOrZones(Set<String> a,
Set<UGCZone> b) { Set<String> b) {
boolean rval = true; boolean rval = a.size() == b.size();
if (rval) {
// Check one way... // Check one way...
for (UGCZone z1 : a) { rval = a.containsAll(b);
boolean containsThisItem = false; if (rval) {
for (UGCZone z2 : b) {
if (z1.toString().equals(z2.toString())) {
containsThisItem = true;
}
}
if (!containsThisItem) {
rval = false;
}
}
// Check the other way... // Check the other way...
for (UGCZone z2 : a) { rval = b.containsAll(a);
boolean containsThisItem = false;
for (UGCZone z1 : b) {
if (z1.toString().equals(z2.toString())) {
containsThisItem = true;
}
}
if (!containsThisItem) {
rval = false;
} }
} }

View file

@ -1,3 +1,22 @@
/**
* 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.warnings.rsc; package com.raytheon.viz.warnings.rsc;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -27,7 +46,21 @@ import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKBReader; import com.vividsolutions.jts.io.WKBReader;
import com.vividsolutions.jts.io.WKTReader; import com.vividsolutions.jts.io.WKTReader;
/**
* CWASPSResource
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 10, 2013 1951 rjpeter Initial history entry, updated ugcZones references
* </pre>
*
* @author rjpeter
* @version 1.0
*/
public class CWASPSResource extends WatchesResource { public class CWASPSResource extends WatchesResource {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
@ -57,9 +90,9 @@ public class CWASPSResource extends WatchesResource {
String zoneList = ""; String zoneList = "";
List<String> queries = new ArrayList<String>(); List<String> queries = new ArrayList<String>();
for (String ugc : record.getUgcsString()) { for (String ugc : record.getUgcZones()) {
if (ugc.charAt(2) == 'Z' if ((ugc.charAt(2) == 'Z')
&& marinezones.contains(ugc.substring(0, 2))) { && marinezones.contains(ugc.substring(0, 2))) {
if (marinezoneList.length() > 0) { if (marinezoneList.length() > 0) {
marinezoneList += ","; marinezoneList += ",";
@ -97,8 +130,8 @@ public class CWASPSResource extends WatchesResource {
try { try {
List<Object[]> result = DirectDbQuery.executeQuery(sql, "maps", List<Object[]> result = DirectDbQuery.executeQuery(sql, "maps",
QueryLanguage.SQL); QueryLanguage.SQL);
if (result != null && result.size() > 0 if ((result != null) && (result.size() > 0)
&& result.get(0)[0] != null) { && (result.get(0)[0] != null)) {
for (Object[] obj : result) { for (Object[] obj : result) {
if (obj[0] != null) { if (obj[0] != null) {
WKBReader wkbReader = new WKBReader(); WKBReader wkbReader = new WKBReader();
@ -153,14 +186,15 @@ public class CWASPSResource extends WatchesResource {
// if the shape was in the shadedShape map then create a shaded // if the shape was in the shadedShape map then create a shaded
// shape // shape
isShaded = true; isShaded = true;
} else if (entry.wireframeShape == null && record.getGeometry() == null) { } else if ((entry.wireframeShape == null)
&& (record.getGeometry() == null)) {
// if it is not in the wireframeShape map and the geometry is null // if it is not in the wireframeShape map and the geometry is null
// then create a shaded shape // then create a shaded shape
isShaded = true; isShaded = true;
} }
if (isShaded) { if (isShaded) {
if (record.getUgczones().size() > 0) { if (!record.getUgcZones().isEmpty()) {
// if the geometry is null get a geometry based on the county // if the geometry is null get a geometry based on the county
// list // list
if (record.getGeometry() == null) { if (record.getGeometry() == null) {

View file

@ -15,7 +15,6 @@ import java.util.TimerTask;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.UGCZone;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType; import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
@ -49,7 +48,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class. * Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class.
* May 06, 2013 1930 bsteffen Check for null in WatchesResource. * May 06, 2013 1930 bsteffen Check for null in WatchesResource.
* * May 10, 2013 1951 rjpeter Updated ugcZones references
* </pre> * </pre>
* *
* @author jsanchez * @author jsanchez
@ -158,9 +157,9 @@ public class WatchesResource extends AbstractWWAResource {
} }
} }
} else if (type == ChangeType.CAPABILITY) { } else if (type == ChangeType.CAPABILITY) {
if (color != null if ((color != null)
&& color.equals(getCapability((ColorableCapability.class)) && (color.equals(getCapability((ColorableCapability.class))
.getColor()) == false) { .getColor()) == false)) {
color = getCapability((ColorableCapability.class)).getColor(); color = getCapability((ColorableCapability.class)).getColor();
for (String dataUri : entryMap.keySet()) { for (String dataUri : entryMap.keySet()) {
@ -185,9 +184,9 @@ public class WatchesResource extends AbstractWWAResource {
AbstractWarningRecord record) throws VizException { AbstractWarningRecord record) throws VizException {
Geometry geo; Geometry geo;
if (record.getUgczones().size() > 0) { if (!record.getUgcZones().isEmpty()) {
setGeometry(record); setGeometry(record);
if (record.getGeometry() != null && record.getPhen() != null) { if ((record.getGeometry() != null) && (record.getPhen() != null)) {
IShadedShape ss = target.createShadedShape(false, IShadedShape ss = target.createShadedShape(false,
descriptor.getGridGeometry(), false); descriptor.getGridGeometry(), false);
geo = (Geometry) record.getGeometry().clone(); geo = (Geometry) record.getGeometry().clone();
@ -219,11 +218,11 @@ public class WatchesResource extends AbstractWWAResource {
WarningAction watchact = WarningAction.valueOf(watchrec WarningAction watchact = WarningAction.valueOf(watchrec
.getAct()); .getAct());
int watchSize = watchrec.getUgczones().size(); int watchSize = watchrec.getUgcZones().size();
if (watchact != WarningAction.NEW) { if (watchact != WarningAction.NEW) {
AbstractWarningRecord createShape = null; AbstractWarningRecord createShape = null;
if (watchact == null || watchact.toString() == null) { if ((watchact == null) || (watchact.toString() == null)) {
createShape = watchrec; createShape = watchrec;
} }
for (String entryKey : entryMap.keySet()) { for (String entryKey : entryMap.keySet()) {
@ -233,27 +232,27 @@ public class WatchesResource extends AbstractWWAResource {
// checks for any possible null pointer exceptions in // checks for any possible null pointer exceptions in
// the following block of code, since there is the // the following block of code, since there is the
// possibility of null values // possibility of null values
if (rec.getPhensig() != null if ((rec.getPhensig() != null)
&& watchrec.getPhensig() != null && (watchrec.getPhensig() != null)
&& rec.getOfficeid() != null && (rec.getOfficeid() != null)
&& watchrec.getOfficeid() != null && (watchrec.getOfficeid() != null)
&& rec.getUgczones() != null && (rec.getUgcZones() != null)
&& rec.getStartTime() != null && (rec.getStartTime() != null)
&& watchrec.getStartTime() != null) { && (watchrec.getStartTime() != null)) {
if (rec.getPhensig().equals(watchrec.getPhensig()) if (rec.getPhensig().equals(watchrec.getPhensig())
&& rec.getOfficeid().equals( && rec.getOfficeid().equals(
watchrec.getOfficeid()) watchrec.getOfficeid())
&& rec.getEtn().equals(watchrec.getEtn())) { && rec.getEtn().equals(watchrec.getEtn())) {
int recSize = rec.getUgczones().size(); int recSize = rec.getUgcZones().size();
if (!entry.partialCancel) { if (!entry.partialCancel) {
if (watchact == WarningAction.EXP if ((watchact == WarningAction.EXP)
|| watchact == WarningAction.CAN) { || (watchact == WarningAction.CAN)) {
entry.partialCancel = true; entry.partialCancel = true;
entry.record entry.record
.setEndTime((Calendar) watchrec .setEndTime((Calendar) watchrec
.getStartTime().clone()); .getStartTime().clone());
} else if (watchact == WarningAction.CON } else if ((watchact == WarningAction.CON)
&& recSize > watchSize && (recSize > watchSize)
&& watchrec.getStartTime().after( && watchrec.getStartTime().after(
rec.getStartTime())) { rec.getStartTime())) {
entry.partialCancel = true; entry.partialCancel = true;
@ -270,7 +269,7 @@ public class WatchesResource extends AbstractWWAResource {
if (createShape != null) { if (createShape != null) {
WarningEntry entry = entryMap.get(createShape WarningEntry entry = entryMap.get(createShape
.getDataURI()); .getDataURI());
if (entry != null && entry.shadedShape != null) { if ((entry != null) && (entry.shadedShape != null)) {
entry.shadedShape.dispose(); entry.shadedShape.dispose();
} }
initShape(target, createShape); initShape(target, createShape);
@ -289,7 +288,7 @@ public class WatchesResource extends AbstractWWAResource {
List<String> marinezone = new ArrayList<String>(); List<String> marinezone = new ArrayList<String>();
List<Geometry> geometries = new ArrayList<Geometry>(); List<Geometry> geometries = new ArrayList<Geometry>();
for (String ugc : record.getUgcsString()) { for (String ugc : record.getUgcZones()) {
Geometry geom = null; Geometry geom = null;
WeakReference<Geometry> geomRef = geometryMap.get(ugc); WeakReference<Geometry> geomRef = geometryMap.get(ugc);
if (geomRef != null) { if (geomRef != null) {
@ -383,10 +382,9 @@ public class WatchesResource extends AbstractWWAResource {
AbstractWarningRecord watch = watches.get(key); AbstractWarningRecord watch = watches.get(key);
if (watch == null) { if (watch == null) {
watch = watchrec; watch = watchrec;
} else if (watchrec.getUgczones() != null) { } else if (watchrec.getUgcZones() != null) {
Set<UGCZone> ugcZones = watch.getUgczones(); Set<String> ugcZones = watch.getUgcZones();
ugcZones.addAll(watchrec.getUgczones()); ugcZones.addAll(watchrec.getUgcZones());
watch.setUgczones(ugcZones);
} }
watches.put(key, watch); watches.put(key, watch);
} }
@ -410,7 +408,7 @@ public class WatchesResource extends AbstractWWAResource {
long now = SimulatedTime.getSystemTime().getTime().getTime(); long now = SimulatedTime.getSystemTime().getTime().getTime();
long endTime = rec.getEndTime().getTimeInMillis(); long endTime = rec.getEndTime().getTimeInMillis();
synchronized (expTaskSet) { synchronized (expTaskSet) {
if (endTime > now && !expTaskSet.contains(new Long(endTime))) { if ((endTime > now) && !expTaskSet.contains(new Long(endTime))) {
WarningExpirationTask task = new WarningExpirationTask(this); WarningExpirationTask task = new WarningExpirationTask(this);
timer.schedule(task, rec.getEndTime().getTime()); timer.schedule(task, rec.getEndTime().getTime());
expTaskSet.add(new Long(endTime)); expTaskSet.add(new Long(endTime));
@ -429,7 +427,7 @@ public class WatchesResource extends AbstractWWAResource {
Long time = new Long(triggerTime); Long time = new Long(triggerTime);
// remove the instance of the trigger time from the map // remove the instance of the trigger time from the map
synchronized (expTaskSet) { synchronized (expTaskSet) {
if (expTaskSet != null && expTaskSet.contains(time)) { if ((expTaskSet != null) && expTaskSet.contains(time)) {
expTaskSet.remove(time); expTaskSet.remove(time);
} }
} }

View file

@ -0,0 +1,53 @@
-- called by updateWarningTables.sh to alter the warning and practicewarning tables
-- and to create indexes and sequences for the activetable tables
DROP SEQUENCE IF EXISTS practice_activetableseq;
DROP SEQUENCE IF EXISTS activetableseq;
DROP INDEX IF EXISTS activetable_officeid_phensig_idx;
DROP INDEX IF EXISTS practice_activetable_officeid_phensig_idx
DROP INDEX IF EXISTS practicewarning_office_phensig_index
DROP INDEX IF EXISTS warning_office_phensig_index
ALTER TABLE warning DROP COLUMN IF EXISTS ugczones;
ALTER TABLE practicewarning DROP COLUMN IF EXISTS ugczones;
CREATE INDEX activetable_officeid_phensig_idx
ON activetable
USING btree
(officeid COLLATE pg_catalog."default", phensig COLLATE pg_catalog."default");
CREATE INDEX practice_activetable_officeid_phensig_idx
ON practice_activetable
USING btree
(officeid COLLATE pg_catalog."default", phensig COLLATE pg_catalog."default");
CREATE SEQUENCE activetableseq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE activetableseq
OWNER TO awips;
CREATE SEQUENCE practice_activetableseq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE practice_activetableseq
OWNER TO awips;
CREATE INDEX practicewarning_office_phensig_index
ON practicewarning
USING btree
(officeid COLLATE pg_catalog."default", phensig COLLATE pg_catalog."default");
CREATE INDEX warning_office_phensig_index
ON warning
USING btree
(officeid COLLATE pg_catalog."default", phensig COLLATE pg_catalog."default");
ALTER TABLE warning ADD COLUMN ugczones text;
ALTER TABLE practicewarning ADD COLUMN ugczones text;

View file

@ -0,0 +1,37 @@
# Called by updateWarningTables.sh to parse the ugc zones in table updates
import sys
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import ParmID
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID
table = sys.argv[1]
fileName = sys.argv[2]
f = open(fileName, 'r')
ugcZonesUpdateFile = open(table + 'UgcZonesUpdates.sql', 'w')
prevParentId = None
parentId = None
ugcZones = None
for line in f:
# break line by columns
columns=line.split('|')
if len(columns) > 1:
parentId=columns[0].strip()
ugcZone=columns[1].strip()
if parentId == prevParentId:
ugcZones.append(ugcZone)
else:
if ugcZones is not None:
zoneStr = ", ".join(ugcZones)
ugcZonesUpdateFile.write("UPDATE " + table + " SET ugczones = '" + zoneStr + "' WHERE id = " + prevParentId + ";\n")
ugcZones = [ugcZone]
prevParentId = parentId
if ugcZones is not None:
zoneStr = ", ".join(ugcZones)
ugcZonesUpdateFile.write("UPDATE " + table + " SET ugczones = '" + zoneStr + "' WHERE id = " + prevParentId + ";\n")
f.close()
ugcZonesUpdateFile.close()

View file

@ -0,0 +1,75 @@
#!/bin/bash
# Main script for updating warning database structure
PSQL="/awips2/psql/bin/psql"
PYTHON="/awips2/python/bin/python"
SQL_SCRIPT="alterWarningTables.sql"
# ensure that the sql script is present
if [ ! -f ${SQL_SCRIPT} ]; then
echo "ERROR: the required sql script - ${SQL_SCRIPT} was not found."
echo "FATAL: the update has failed!"
exit 1
fi
echo "Adding ugczones column to warning tables"
${PSQL} -U awips -d metadata -f ${SQL_SCRIPT}
if [ $? -ne 0 ]; then
echo "FATAL: the update has failed!"
exit 1
fi
TABLES="practicewarning warning"
for table in $TABLES
do
echo
echo "Querying for $table ugc zones"
RETRIEVE_UGC_ZONES_SQL="SELECT parentwarning, zone FROM warning_ugczone where parentwarning in (select id from $table) order by parentwarning, key"
_ugc_zone_txt="${table}UgcZones.txt"
${PSQL} -U awips -d metadata -c "${RETRIEVE_UGC_ZONES_SQL}" -t -o ${_ugc_zone_txt}
if [ $? -ne 0 ]; then
echo "ERROR: Failed to retrieve the ugc zones for $table table."
echo "FATAL: The update has failed."
exit 1
fi
echo
echo "Parsing ugc zones for insertion into $table table"
PYTHON_PARSE_SCRIPT="parseUgcZones.py"
if [ ! -f ${PYTHON_PARSE_SCRIPT} ]; then
echo "ERROR: the required python script - ${PYTHON_PARSE_SCRIPT} was not found."
echo "FATAL: the update has failed!"
exit 1
fi
${PYTHON} ${PYTHON_PARSE_SCRIPT} ${table} ${_ugc_zone_txt}
if [ $? -ne 0 ]; then
echo "ERROR: Failed to parse ugc zones."
echo "FATAL: The update has failed."
exit 1
fi
echo
echo "Adding ugc zones to $table table"
# ${table}UgcZonesUpdates.sql generated from parseParmIds.py
${PSQL} -U awips -d metadata -q -f ${table}UgcZonesUpdates.sql
if [ $? -ne 0 ]; then
echo "ERROR: Failed to add ugc zones."
echo "FATAL: The update has failed."
exit 1
fi
done
#remove warning_ugczone
echo
echo "Dropping warning_ugczone table"
DROP_TABLE_SQL="DROP TABLE warning_ugczone"
${PSQL} -U awips -d metadata -c "${DROP_TABLE_SQL}"
echo
echo "Running full vacuum for warning"
${PSQL} -U awips -d metadata -c "VACUUM FULL VERBOSE ANALYZE warning"

View file

@ -798,7 +798,7 @@ usage: VTECDecoder -f productfilename -d -a activeTableName
template['pil'] = self._remapPil(template['phen'], template['pil'] = self._remapPil(template['phen'],
template['sig'], self._productPil) template['sig'], self._productPil)
template['ugcs'] = ugcs template['ugcZoneList'] = ", ".join(ugcs)
state = ugcstring[0:2] state = ugcstring[0:2]
if REGIONS.has_key(state): if REGIONS.has_key(state):
template['region'] = REGIONS[state] template['region'] = REGIONS[state]

View file

@ -24,12 +24,12 @@ import java.util.Calendar;
import java.util.List; import java.util.List;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Inheritance; import javax.persistence.Inheritance;
import javax.persistence.InheritanceType; import javax.persistence.InheritanceType;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient; import javax.persistence.Transient;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
@ -52,21 +52,22 @@ import com.vividsolutions.jts.geom.Geometry;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Mar 24, 2009 njensen Initial creation * Mar 24, 2009 njensen Initial creation
* Feb 26, 2013 1447 dgilling Implement equals(). * Feb 26, 2013 1447 dgilling Implement equals().
* * May 10, 2013 1951 rjpeter Added own id sequence tagging
* </pre> * </pre>
* *
* @author njensen * @author njensen
* @version 1.0 * @version 1.0
*/ */
@MappedSuperclass
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@DynamicSerialize @DynamicSerialize
public abstract class ActiveTableRecord extends PersistableDataObject { public abstract class ActiveTableRecord extends PersistableDataObject {
protected static final long serialVersionUID = 1L; protected static final long serialVersionUID = 1L;
@GeneratedValue(strategy = GenerationType.AUTO) protected static final String ID_GEN = "idgen";
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = ID_GEN)
@Id @Id
protected int id; protected int id;
@ -1079,7 +1080,7 @@ public abstract class ActiveTableRecord extends PersistableDataObject {
atr.setWmoid(wr.getWmoid()); atr.setWmoid(wr.getWmoid());
atr.setXxxid(wr.getXxxid()); atr.setXxxid(wr.getXxxid());
for (String ugc : wr.getUgcsString()) { for (String ugc : wr.getUgcZones()) {
ActiveTableRecord ugcRecord = (ActiveTableRecord) atr.clone(); ActiveTableRecord ugcRecord = (ActiveTableRecord) atr.clone();
ugcRecord.setUgcZone(ugc); ugcRecord.setUgcZone(ugc);
list.add(ugcRecord); list.add(ugcRecord);

View file

@ -20,12 +20,15 @@
package com.raytheon.uf.common.activetable; package com.raytheon.uf.common.activetable;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import org.hibernate.annotations.Index;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
/** /**
* TODO Add Description * Operational Active Table, separated so that practice and operational data go to separate tables.
* *
* <pre> * <pre>
* *
@ -33,7 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 10, 2010 njensen Initial creation * Feb 10, 2010 njensen Initial creation
* * May 10, 2013 1951 rjpeter Added own id sequence tagging and new index.
* </pre> * </pre>
* *
* @author njensen * @author njensen
@ -41,8 +44,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
*/ */
@Entity @Entity
@SequenceGenerator(initialValue = 1, name = ActiveTableRecord.ID_GEN, sequenceName = "activetableseq")
@Table(name = "activetable") @Table(name = "activetable")
@DynamicSerialize @DynamicSerialize
@org.hibernate.annotations.Table(appliesTo = "activetable", indexes = { @Index(name = "activetable_officeid_phensig_idx", columnNames = {
"officeid", "phensig" }) })
public class OperationalActiveTableRecord extends ActiveTableRecord implements public class OperationalActiveTableRecord extends ActiveTableRecord implements
Cloneable { Cloneable {

View file

@ -20,12 +20,15 @@
package com.raytheon.uf.common.activetable; package com.raytheon.uf.common.activetable;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import org.hibernate.annotations.Index;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
/** /**
* TODO Add Description * Practice Active Table, separated so that practice and operational data go to separate tables.
* *
* <pre> * <pre>
* *
@ -33,7 +36,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Feb 10, 2010 njensen Initial creation * Feb 10, 2010 njensen Initial creation
* * May 10, 2013 1951 rjpeter Added own id sequence tagging and new index.
* </pre> * </pre>
* *
* @author njensen * @author njensen
@ -41,8 +44,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
*/ */
@Entity @Entity
@SequenceGenerator(initialValue = 1, name = ActiveTableRecord.ID_GEN, sequenceName = "practice_activetableseq")
@Table(name = "practice_activetable") @Table(name = "practice_activetable")
@DynamicSerialize @DynamicSerialize
@org.hibernate.annotations.Table(appliesTo = "practice_activetable", indexes = { @Index(name = "practice_activetable_officeid_phensig_idx", columnNames = {
"officeid", "phensig" }) })
public class PracticeActiveTableRecord extends ActiveTableRecord implements public class PracticeActiveTableRecord extends ActiveTableRecord implements
Cloneable { Cloneable {

View file

@ -49,7 +49,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* 06/22/09 2152 D. Hladky Initial release * 06/22/09 2152 D. Hladky Initial release
* 01/27/13 1478 D. Hladky Added support for write of aggregate record cache * 01/27/13 1478 D. Hladky Added support for write of aggregate record cache
* 01/27/13 1569 D. Hladky Added support for write of aggregate record cache * 01/27/13 1569 D. Hladky Added support for write of aggregate record cache
* Apr 16, 2013 1912 bsteffen Initial bulk hdf5 access for ffmp * 04/16/13 1912 bsteffen Initial bulk hdf5 access for ffmp
* 05/09/13 1919 mpduff Use parent pfaf instead of lookupId.
* *
* </pre> * </pre>
* *
@ -58,10 +59,6 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
*/ */
@DynamicSerialize @DynamicSerialize
public class FFMPBasinData implements ISerializableObject { public class FFMPBasinData implements ISerializableObject {
/**
*
*/
private static final long serialVersionUID = 8162247989509750715L; private static final long serialVersionUID = 8162247989509750715L;
public static final double GUIDANCE_MISSING = -999999.0; public static final double GUIDANCE_MISSING = -999999.0;
@ -76,12 +73,12 @@ public class FFMPBasinData implements ISerializableObject {
/** /**
* Pending load tasks that need to be run to fully populate basins * Pending load tasks that need to be run to fully populate basins
*/ */
private List<LoadTask> tasks = new ArrayList<LoadTask>(); private final List<LoadTask> tasks = new ArrayList<LoadTask>();
/** /**
* Cache of basins in order for easy population from Load Tasks. * Cache of basins in order for easy population from Load Tasks.
*/ */
private Map<String, FFMPBasin[]> orderedBasinsCache = new HashMap<String, FFMPBasin[]>(); private final Map<String, FFMPBasin[]> orderedBasinsCache = new HashMap<String, FFMPBasin[]>();
/** /**
* Public one arg constructor * Public one arg constructor
@ -690,7 +687,7 @@ public class FFMPBasinData implements ISerializableObject {
FFMPBasin basin = this.basins.get(fvgbmd.getLookupId()); FFMPBasin basin = this.basins.get(fvgbmd.getLookupId());
if (basin == null) { if (basin == null) {
basin = new FFMPVirtualGageBasin(fvgbmd.getLid(), basin = new FFMPVirtualGageBasin(fvgbmd.getLid(),
fvgbmd.getLookupId(), false); fvgbmd.getParentPfaf(), false);
this.basins.put(fvgbmd.getLookupId(), basin); this.basins.put(fvgbmd.getLookupId(), basin);
} }
basins[j++] = basin; basins[j++] = basin;
@ -702,6 +699,9 @@ public class FFMPBasinData implements ISerializableObject {
} }
} }
/**
* Load now.
*/
public void loadNow() { public void loadNow() {
synchronized (tasks) { synchronized (tasks) {
if (!tasks.isEmpty()) { if (!tasks.isEmpty()) {
@ -728,6 +728,9 @@ public class FFMPBasinData implements ISerializableObject {
this.date = date; this.date = date;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public void process(FloatDataRecord record) { public void process(FloatDataRecord record) {
float[] values = record.getFloatData(); float[] values = record.getFloatData();
@ -736,6 +739,9 @@ public class FFMPBasinData implements ISerializableObject {
} }
} }
/**
* Apply the value to the basin/
*/
protected void applyValue(FFMPBasin basin, float value) { protected void applyValue(FFMPBasin basin, float value) {
if (basin.contains(date)) { if (basin.contains(date)) {
float curval = basin.getValue(date); float curval = basin.getValue(date);

View file

@ -1,4 +1,4 @@
com.raytheon.uf.common.dataplugin.warning.UGCZone com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord
com.raytheon.uf.common.dataplugin.warning.WarningRecord com.raytheon.uf.common.dataplugin.warning.WarningRecord
com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord
com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration

View file

@ -20,39 +20,29 @@
package com.raytheon.uf.common.dataplugin.warning; package com.raytheon.uf.common.dataplugin.warning;
import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.HashSet; import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.regex.Pattern;
import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance; import javax.persistence.Inheritance;
import javax.persistence.InheritanceType; import javax.persistence.InheritanceType;
import javax.persistence.OneToMany; import javax.persistence.MappedSuperclass;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Transient; import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.IDecoderGettable;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.serialization.adapters.GeometryAdapter;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
/** /**
*
* Warning Record * Warning Record
* *
* <pre> * <pre>
@ -61,202 +51,171 @@ import com.vividsolutions.jts.geom.Geometry;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 03/12/2007 1003 bwoodle initial creation * 03/12/2007 1003 bwoodle initial creation
* 04/12/2013 1857 bgonzale Added SequenceGenerator annotation. * 04/12/2013 1857 bgonzale Added SequenceGenerator annotation.
* * 05/02/2013 1949 rjpeter Moved ugcZones to be a column inside table.
* </pre> * </pre>
* *
* @author bwoodle * @author bwoodle
* @version 1 * @version 1
*/ */
@Entity @MappedSuperclass
@SequenceGenerator(name = PluginDataObject.ID_GEN) @SequenceGenerator(name = PluginDataObject.ID_GEN)
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize @DynamicSerialize
public abstract class AbstractWarningRecord extends PluginDataObject { public abstract class AbstractWarningRecord extends PluginDataObject {
private static final Pattern ugcSplitter = Pattern.compile(", ");
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@DataURI(position = 1) @DataURI(position = 1)
@Column(length = 32) @Column(length = 32)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String wmoid; private String wmoid;
@DataURI(position = 2) @DataURI(position = 2)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String pil; private String pil;
@DataURI(position = 3) @DataURI(position = 3)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String xxxid; private String xxxid;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String countyheader; private String countyheader;
@XmlElement @Column(name = "ugczones", columnDefinition = "text")
@DynamicSerializeElement @DynamicSerializeElement
@OneToMany(cascade = CascadeType.ALL, mappedBy = "parentWarning", fetch = FetchType.EAGER) protected String ugcZoneList;
protected Set<UGCZone> ugczones = new HashSet<UGCZone>();
@Transient
protected Set<String> ugcZones;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String vtecstr; private String vtecstr;
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String productClass; private String productClass;
@DataURI(position = 4) @DataURI(position = 4)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String act; private String act;
@Column(length = 8) @Column(length = 8)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
@Index(name = "query_index", columnNames = { "officeid", "phensig" })
private String officeid; private String officeid;
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String phen; private String phen;
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String sig; private String sig;
@DataURI(position = 5) @DataURI(position = 5)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String etn; private String etn;
/** vtec start time */ /** vtec start time */
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
@Column
private Calendar startTime; private Calendar startTime;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar endTime; private Calendar endTime;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar issueTime; private Calendar issueTime;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar purgeTime; private Calendar purgeTime;
@Column(length = 8) @Column(length = 8)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private boolean ufn; private boolean ufn;
@Column(name = "geometry", columnDefinition = "geometry") @Column(name = "geometry", columnDefinition = "geometry")
@Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType") @Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType")
@XmlJavaTypeAdapter(value = GeometryAdapter.class)
@DynamicSerializeElement @DynamicSerializeElement
private Geometry geometry; private Geometry geometry;
@Transient @Transient
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String forecaster = ""; private String forecaster = "";
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Integer motdir; private Integer motdir;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Integer motspd; private Integer motspd;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String loc; private String loc;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String rawmessage; private String rawmessage;
@DataURI(position = 6) @DataURI(position = 6)
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private int seg; private int seg;
@DataURI(position = 7) @DataURI(position = 7)
@Column(length = 4) @Column(length = 4)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String phensig; private String phensig;
@Transient @Transient
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String region; private String region;
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String overviewText; private String overviewText;
/** segment text */ /** segment text */
@Column(columnDefinition = "text") @Column(columnDefinition = "text")
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String segText; private String segText;
@Column(length = 8) @Column(length = 8)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String locationID; private String locationID;
@Column(length = 2) @Column(length = 2)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String floodSeverity; private String floodSeverity;
@XmlAttribute @Column
@DynamicSerializeElement @DynamicSerializeElement
private String immediateCause; private String immediateCause;
@Column(length = 2) @Column(length = 2)
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private String floodRecordStatus; private String floodRecordStatus;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar floodBegin; private Calendar floodBegin;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar floodCrest; private Calendar floodCrest;
@Column @Column
@XmlAttribute
@DynamicSerializeElement @DynamicSerializeElement
private Calendar floodEnd; private Calendar floodEnd;
@ -280,7 +239,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.setForecaster(old.getForecaster()); this.setForecaster(old.getForecaster());
this.setGeometry(old.getGeometry()); this.setGeometry(old.getGeometry());
this.setGeometry(old.getGeometry()); this.setGeometry(old.getGeometry());
this.setIdentifier(old.getIdentifier());
this.setInsertTime(old.getInsertTime()); this.setInsertTime(old.getInsertTime());
this.setIssueTime(old.getIssueTime()); this.setIssueTime(old.getIssueTime());
this.setLoc(old.getLoc()); this.setLoc(old.getLoc());
@ -315,7 +273,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
*/ */
public AbstractWarningRecord(String uri) { public AbstractWarningRecord(String uri) {
super(uri); super(uri);
identifier = java.util.UUID.randomUUID().toString();
} }
@Override @Override
@ -553,21 +510,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.purgeTime = purgeTime; this.purgeTime = purgeTime;
} }
/**
* @return the ugczones
*/
public Set<UGCZone> getUgczones() {
return ugczones;
}
/**
* @param ugczones
* the ugczones to set
*/
public void setUgczones(Set<UGCZone> ugczones) {
this.ugczones = ugczones;
}
/** /**
* @return the region * @return the region
*/ */
@ -688,8 +630,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.floodEnd = floodEnd; this.floodEnd = floodEnd;
} }
public abstract void setUgcs(List<String> list);
/** /**
* @return the ufn * @return the ufn
*/ */
@ -735,13 +675,40 @@ public abstract class AbstractWarningRecord extends PluginDataObject {
this.segText = segText; this.segText = segText;
} }
public String[] getUgcsString() { public void setUgcZones(Set<String> list) {
String[] s = new String[ugczones.size()]; ugcZones = new LinkedHashSet<String>(list);
UGCZone[] ugcs = ugczones.toArray(new UGCZone[ugczones.size()]); StringBuilder builder = new StringBuilder(ugcZones.size() * 8);
for (int i = 0; i < ugcs.length; i++) { boolean addComma = false;
s[i] = ugcs[i].getZone(); for (String ugc : list) {
if (addComma) {
builder.append(", ");
} else {
addComma = true;
} }
return s; builder.append(ugc);
}
ugcZoneList = builder.toString();
} }
public Set<String> getUgcZones() {
if (ugcZones == null) {
ugcZones = new LinkedHashSet<String>();
if ((ugcZoneList != null) && (ugcZoneList.length() > 0)) {
String[] zones = ugcSplitter.split(ugcZoneList);
ugcZones.addAll(Arrays.asList(zones));
}
}
return ugcZones;
}
public String getUgcZoneList() {
return ugcZoneList;
}
public void setUgcZoneList(String ugcZoneList) {
this.ugcZoneList = ugcZoneList;
this.ugcZones = null;
}
} }

View file

@ -20,15 +20,10 @@
package com.raytheon.uf.common.dataplugin.warning; package com.raytheon.uf.common.dataplugin.warning;
import java.util.List;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Index; import org.hibernate.annotations.Index;
@ -46,6 +41,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* 10/04/2011 10049 bgonzale initial creation * 10/04/2011 10049 bgonzale initial creation
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* May 02, 2013 1949 rjpeter Removed ugcZones.
* *
* </pre> * </pre>
* *
@ -59,14 +55,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* Both refTime and forecastTime are included in the refTimeIndex since * Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used. * forecastTime is unlikely to be used.
*/ */
@org.hibernate.annotations.Table( @org.hibernate.annotations.Table(appliesTo = "practicewarning", indexes = {
appliesTo = "practicewarning", @Index(name = "practicewarning_refTimeIndex", columnNames = {
indexes = { "refTime", "forecastTime" }),
@Index(name = "practicewarning_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) @Index(name = "practicewarning_office_phensig_index", columnNames = {
} "officeid", "phensig" }) })
)
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize @DynamicSerialize
public class PracticeWarningRecord extends AbstractWarningRecord { public class PracticeWarningRecord extends AbstractWarningRecord {
@ -99,15 +92,5 @@ public class PracticeWarningRecord extends AbstractWarningRecord {
*/ */
public PracticeWarningRecord(String uri) { public PracticeWarningRecord(String uri) {
super(uri); super(uri);
identifier = java.util.UUID.randomUUID().toString();
} }
@Override
public void setUgcs(List<String> list) {
ugczones.clear();
for (String s : list) {
ugczones.add(new UGCZone(s, this));
}
}
} }

View file

@ -21,16 +21,12 @@
package com.raytheon.uf.common.dataplugin.warning; package com.raytheon.uf.common.dataplugin.warning;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.SequenceGenerator; import javax.persistence.SequenceGenerator;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.UniqueConstraint; import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Index; import org.hibernate.annotations.Index;
@ -48,28 +44,24 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
* 03/12/2007 1003 bwoodle initial creation * 03/12/2007 1003 bwoodle initial creation
* Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* * May 02, 2013 1949 rjpeter Removed ugcZones.
* </pre> * </pre>
* *
* @author bwoodle * @author bwoodle
* @version 1 * @version 1
*/ */
@Entity @Entity
@XmlAccessorType(XmlAccessType.NONE)
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "warningseq") @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "warningseq")
@Table(name = "warning", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @Table(name = "warning", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
/* /*
* Both refTime and forecastTime are included in the refTimeIndex since * Both refTime and forecastTime are included in the refTimeIndex since
* forecastTime is unlikely to be used. * forecastTime is unlikely to be used.
*/ */
@org.hibernate.annotations.Table( @org.hibernate.annotations.Table(appliesTo = "warning", indexes = {
appliesTo = "warning", @Index(name = "warning_refTimeIndex", columnNames = { "refTime",
indexes = { "forecastTime" }),
@Index(name = "warning_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) @Index(name = "warning_office_phensig_index", columnNames = {
} "officeid", "phensig" }) })
)
@XmlRootElement
@DynamicSerialize @DynamicSerialize
public class WarningRecord extends AbstractWarningRecord { public class WarningRecord extends AbstractWarningRecord {
@ -102,7 +94,7 @@ public class WarningRecord extends AbstractWarningRecord {
private static Map<String, WarningAction> unknownMap = new HashMap<String, WarningAction>(); private static Map<String, WarningAction> unknownMap = new HashMap<String, WarningAction>();
private String text; private final String text;
private WarningAction(String text) { private WarningAction(String text) {
this.text = text; this.text = text;
@ -163,12 +155,4 @@ public class WarningRecord extends AbstractWarningRecord {
public WarningRecord(String uri) { public WarningRecord(String uri) {
super(uri); super(uri);
} }
public void setUgcs(List<String> list) {
ugczones.clear();
for (String s : list) {
ugczones.add(new UGCZone(s, this));
}
}
} }

View file

@ -47,6 +47,11 @@ if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
/usr/bin/find %{_build_root}/awips2/edex/data/share -name .gitignore -exec rm -rf {} \;
if [ $? -ne 0 ]; then
exit 1
fi
%pre %pre
%post %post

View file

@ -72,6 +72,13 @@ if [ $? -ne 0 ]; then
fi fi
popd > /dev/null popd > /dev/null
# remove any .gitignore files
# currently, the ebxml webapp includes a .gitignore file
/usr/bin/find ${RPM_BUILD_ROOT}/awips2/edex -name .gitignore -exec rm -f {} \;
if [ $? -ne 0 ]; then
exit 1
fi
INSTALLER_RPM="%{_baseline_workspace}/rpms" INSTALLER_RPM="%{_baseline_workspace}/rpms"
# copy the service script. # copy the service script.
EDEX_BASE="${INSTALLER_RPM}/awips2.edex/Installer.edex-base" EDEX_BASE="${INSTALLER_RPM}/awips2.edex/Installer.edex-base"

View file

@ -1,6 +1,6 @@
diff -crB a/qpid-java.spec b/qpid-java.spec diff -crB a/qpid-java.spec b/qpid-java.spec
*** a/qpid-java.spec 2013-04-15 16:19:49.000000000 -0500 *** a/qpid-java.spec 2013-05-14 20:24:21.000000000 -0500
--- b/qpid-java.spec 2013-04-24 13:31:29.000000000 -0500 --- b/qpid-java.spec 2013-05-14 20:23:49.000000000 -0500
*************** ***************
*** 1,6 **** *** 1,6 ****
! Name: qpid-java ! Name: qpid-java
@ -10,8 +10,8 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
License: Apache Software License License: Apache Software License
Group: Development/Java Group: Development/Java
--- 1,8 ---- --- 1,8 ----
+ %define _awips2_directory "/awips2/qpid" ! %define _awips2_directory "/awips2/qpid"
+ !
! Name: awips2-qpid-java ! Name: awips2-qpid-java
Version: 0.18 Version: 0.18
! Release: 1%{?dist} ! Release: 1%{?dist}
@ -37,8 +37,19 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch BuildArch: noarch
*************** ***************
*** 35,40 **** *** 35,45 ****
--- 42,55 ---- %description common
Java implementation of Apache Qpid - common files
%package client
Summary: Java implementation of Apache Qpid - client
Group: Development/Java
BuildArch: noarch
! Requires: qpid-java-common = %{version}-%{release}
Requires: log4j >= 1.2.12
%description client
--- 42,61 ----
%description common %description common
Java implementation of Apache Qpid - common files Java implementation of Apache Qpid - common files
@ -46,6 +57,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
+ Summary: Java implementation of Apache Qpid - broker files + Summary: Java implementation of Apache Qpid - broker files
+ Group: Development/Java + Group: Development/Java
+ BuildArch: noarch + BuildArch: noarch
+ Provides: awips2-base-component
+ +
+ %description broker + %description broker
+ Java implementation of Apache Qpid - broker files + Java implementation of Apache Qpid - broker files
@ -53,9 +65,31 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%package client %package client
Summary: Java implementation of Apache Qpid - client Summary: Java implementation of Apache Qpid - client
Group: Development/Java Group: Development/Java
BuildArch: noarch
! Requires: awips2-qpid-java-common = %{version}-%{release}
Requires: log4j >= 1.2.12
%description client
***************
*** 49,55 ****
Summary: Java implementation of Apache Qpid - example
Group: Development/Java
BuildArch: noarch
! Requires: qpid-java-client = %{version}-%{release}
%description example
Java implementation of Apache Qpid - example
--- 65,71 ----
Summary: Java implementation of Apache Qpid - example
Group: Development/Java
BuildArch: noarch
! Requires: awips2-qpid-java-client = %{version}-%{release}
%description example
Java implementation of Apache Qpid - example
*************** ***************
*** 58,67 **** *** 58,67 ****
--- 73,97 ---- --- 74,98 ----
%setup -q -n %{qpid_src_dir} %setup -q -n %{qpid_src_dir}
mkdir -p java/lib/required mkdir -p java/lib/required
tar -xvzf %SOURCE1 -C java/lib/required tar -xvzf %SOURCE1 -C java/lib/required
@ -90,7 +124,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
# blacklisted jars are either provided by the Requires: or not needed. # blacklisted jars are either provided by the Requires: or not needed.
BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests" BLACKLIST="slf4j qpid-client-tests qpid-all qpid-common-tests"
--- 100,114 ---- --- 101,115 ----
( (
cd %{qpid_src_dir}/java cd %{qpid_src_dir}/java
@ -155,7 +189,7 @@ diff -crB a/qpid-java.spec b/qpid-java.spec
%changelog %changelog
* Thu Sep 6 2012 Irina Boverman <iboverma@redhat.com> - 0.18-2 * Thu Sep 6 2012 Irina Boverman <iboverma@redhat.com> - 0.18-2
--- 122,233 ---- --- 123,234 ----
cd .. cd ..

View file

@ -85,28 +85,28 @@ if [ "${2}" = "-nobinlightning" ]; then
fi fi
if [ "${1}" = "-python-qpid" ]; then if [ "${1}" = "-python-qpid" ]; then
buildRPM "awips2" # buildRPM "awips2"
buildRPM "awips2-python-qpid" # buildRPM "awips2-python-qpid"
buildRPM "awips2-python" # buildRPM "awips2-python"
buildRPM "awips2-python-cherrypy" # buildRPM "awips2-python-cherrypy"
buildRPM "awips2-python-dynamicserialize" buildRPM "awips2-python-dynamicserialize"
buildRPM "awips2-python-nose" # buildRPM "awips2-python-nose"
buildRPM "awips2-python-numpy" # buildRPM "awips2-python-numpy"
buildRPM "awips2-python-h5py" # buildRPM "awips2-python-h5py"
buildRPM "awips2-python-jimporter" # buildRPM "awips2-python-jimporter"
buildRPM "awips2-python-matplotlib" # buildRPM "awips2-python-matplotlib"
buildRPM "awips2-python-pil" # buildRPM "awips2-python-pil"
buildRPM "awips2-python-pmw" # buildRPM "awips2-python-pmw"
buildRPM "awips2-python-pupynere" # buildRPM "awips2-python-pupynere"
buildRPM "awips2-python-scientific" # buildRPM "awips2-python-scientific"
buildRPM "awips2-python-scipy" # buildRPM "awips2-python-scipy"
buildRPM "awips2-python-tables" # buildRPM "awips2-python-tables"
buildRPM "awips2-python-thrift" # buildRPM "awips2-python-thrift"
buildRPM "awips2-python-tpg" # buildRPM "awips2-python-tpg"
buildRPM "awips2-python-ufpy" # buildRPM "awips2-python-ufpy"
buildRPM "awips2-python-werkzeug" # buildRPM "awips2-python-werkzeug"
buildRPM "awips2-python-pygtk" # buildRPM "awips2-python-pygtk"
buildRPM "awips2-python-pycairo" # buildRPM "awips2-python-pycairo"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
@ -342,6 +342,7 @@ fi
if [ "${1}" = "-viz" ]; then if [ "${1}" = "-viz" ]; then
buildRPM "awips2" buildRPM "awips2"
buildRPM "awips2-rcm" buildRPM "awips2-rcm"
buildRPM "awips2-hydroapps-shared"
buildCAVE buildCAVE
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1