Merge branch 'master_13.4.1' (13.4.1-5) into omaha_13.4.1

Conflicts:
	cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/FFMPMonitor.java
	cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FFMPConfig.java
	cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/dialogs/FfmpBasinTableDlg.java
	cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataGenerator.java
	cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataLoader.java
	cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPResource.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/ScanMonitor.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/ScanStarterJob.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanDrawer.java
	cave/com.raytheon.viz.aviation/src/com/raytheon/viz/aviation/climatology/CigVisByHourTabComp.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/griddata/AbstractGridData.java
	cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java
	edexOsgi/build.edex/opt/db/ddl/maps/importShapeFile.sh
	edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosData.java
	edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/D2DGridDatabase.java
	edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/IFPWE.java
	edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py
	edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/grid/gfeLevelMappingFile.xml
	edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-decode.xml
	edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/RedbookRecord.java
	edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPBasin.java
	edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java
	edexOsgi/com.raytheon.uf.common.dataplugin.npp.sounding/src/com/raytheon/uf/common/dataplugin/npp/sounding/NPPSoundingRecord.java
	edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/PluginDataObject.java
	edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/DefaultPathProvider.java
	edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/persist/PersistablePluginDataObject.java
	edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/DataTime.java
	edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/TimeRange.java
	edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java
	edexOsgi/com.raytheon.uf.edex.pointdata/src/com/raytheon/uf/edex/pointdata/PointDataPluginDao.java
	edexOsgi/com.raytheon.uf.tools.gfesuite/cli/src/ifpnetcdf/ifpnetCDF.py
	edexOsgi/com.raytheon.uf.tools.gfesuite/cli/src/iscmosaic/iscMosaic.py
	edexOsgi/com.raytheon.uf.tools.gfesuite/cli/src/purgeallgrids/purgeAllGrids.py
	nativeLib/dist.native/i386-pc-linux-gnu.tar
	nativeLib/rary.ohd.filesystem/awips/hydroapps/set_hydro_env
	pythonPackages/qpid/bin/qpid-queue-count
	pythonPackages/qpid/bin/qpid-stat
	rpms/awips2.core/Installer.database-server-configuration/configuration/postgresql.conf
	rpms/awips2.core/Installer.database-standalone-configuration/configuration/postgresql.conf
	rpms/awips2.core/Installer.ldm/component.spec
	rpms/awips2.core/Installer.ldm/patch/etc/ldmadmin-pl.conf
	rpms/awips2.core/Installer.ldm/src/awips2-ldm.6.11.2.tar.gz
	rpms/awips2.core/Installer.ncep-database/component.spec
	rpms/awips2.qpid/0.18/SOURCES/virtualhosts.xml
	rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0
	rpms/build/x86_64/build.sh
	tests/.classpath

Change-Id: Ie5c71a39060fdd21d17f1c73ec79c03dfe523cfb

Former-commit-id: 17a5f519cc [formerly 083700d315] [formerly 2b496de6d8 [formerly 9fb7a04d920e56496cdc896513da8fc54765c6d5]]
Former-commit-id: 2b496de6d8
Former-commit-id: 349bcc15d7
This commit is contained in:
Richard Peter 2013-05-05 14:25:36 -05:00
commit 398e808300
125 changed files with 2737 additions and 726 deletions

View file

@ -2,19 +2,19 @@
##
# 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.
##
@ -119,7 +119,7 @@ nnn = r'(?:[A-Z]{2}[ZC])?\d{3}'
purge = r'(?P<purgeT>\d{6})-'
ugc = r'\n(?P<uhdr>' + r'[A-Z]{2}[Z|C](?:(?:\d{3})|(?:ALL))' + r'(?:[->]\n?' + nnn + \
r')*-\n?' + purge + el + r')'
cityh = r'(?<=-\n(?!.*-\n))(?P<incc>(?:.*\n))'
cityh = r'-\n(?P<incc>(?:\s*\n)*(?:INCLUDING THE (?:CITIES|CITY) OF...)?)'
body = r'(?P<body>(?:^.*\n)*?)'
#body = r'.*'
@ -192,20 +192,20 @@ class ProductParser:
#l = headline_re.finditer(str)
l = single_head_re.finditer(str)
for m in l:
if m is not None:
if m is not None:
#print 'phl m = ', m
newstart = start + m.start()
m = headline_re.match(m.group(0))
if m is not None:
hdlns.append(self.dumpMatch(m, newstart))
#print 'hdlns = ', hdlns
rval['headInfo'] = hdlns
def dumpMatch(self, m, offset=0, rval=None):
if rval is None:
rval = {}
#print 'dumpmatch m = ', m.groupdict()
for k in m.groupdict().keys():
if m.start(k) != -1 and m.start(k) != m.end(k):
@ -234,7 +234,7 @@ class ProductParser:
segs = []
l = ugch_re.finditer(self._str)
for m in l:
if m is not None:
m1 = cityh_re.search(self._str, m.end())
@ -250,7 +250,7 @@ class ProductParser:
else:
continue
m4 = head_re.search(self._str, m.end(), m3.end())
d = self.dumpMatch(m)
d = self.dumpMatch(m2, rval=d)
d = self.dumpMatch(m3, rval=d)
@ -266,7 +266,7 @@ class ProductParser:
else:
d['city'] = (self.tkc(m2.start()),
self.tkc(m2.start()))
if m4 is not None:
#print 'm4 = ', m4.group()
d = self.dumpMatch(m4, rval=d)
@ -284,7 +284,7 @@ class ProductParser:
rval['frames'] = frames
return rval
def parseFromJava(self, text):
self._str = text
self._ci = None
@ -295,13 +295,13 @@ class ProductParser:
lc.append(count)
count += l
self._totals = lc
#print 'text START ----------------------'
#print text
#print 'text END ------------------------'
result = self.parse()
#print 'result = ', result
return JUtil.pyDictToJavaMap(result)

View file

@ -42,6 +42,8 @@
# improve performance.
# Mar 13, 2013 1793 bsteffen Performance improvements for
# TCMWindTool
# Apr 24, 2013 1947 randerso Fix UVToMagDir to work with scalar arguments
# Cleaned up some constants
#
########################################################################
import types, string, time, sys
@ -49,6 +51,7 @@ from math import *
from numpy import *
import os
import numpy
import math
import re
import jep
import BaseTool, Exceptions
@ -788,19 +791,26 @@ class SmartScript(BaseTool.BaseTool):
## Conversion methods
def UVToMagDir(self, u, v):
RAD_TO_DEG = 57.29577951308232
RAD_TO_DEG = 180.0 / numpy.pi
# Sign change to make math to meteor. coords work
u = - u
v = - v
speed = numpy.sqrt(u * u + v * v)
dir = numpy.arctan2(u, v) * RAD_TO_DEG
# adjust values so that 0<dir<360
dir[numpy.greater_equal(dir, 360)] -= 360
dir[numpy.less(dir, 0)] += 360
u = -u
v = -v
if type(u) is numpy.ndarray or type(v) is numpy.ndarray:
speed = numpy.sqrt(u * u + v * v)
dir = numpy.arctan2(u, v) * RAD_TO_DEG
dir[numpy.greater_equal(dir, 360)] -= 360
dir[numpy.less(dir, 0)] += 360
else:
speed = math.sqrt(u * u + v * v)
dir = math.atan2(u, v) * RAD_TO_DEG
while dir < 0.0:
dir = dir + 360.0
while dir >= 360.0:
dir = dir - 360.0
return (speed, dir)
def MagDirToUV(self, mag, dir):
DEG_TO_RAD = 0.017453292519943295
DEG_TO_RAD = numpy.pi / 180.0
# Note sign change for components so math to meteor. coords works
uw = - sin(dir * DEG_TO_RAD) * mag
vw = - cos(dir * DEG_TO_RAD) * mag
@ -808,7 +818,7 @@ class SmartScript(BaseTool.BaseTool):
def convertMsecToKts(self, value_Msec):
# Convert from meters/sec to Kts
return value_Msec * 1.944
return value_Msec * 3600.0 / 1852.0
def convertKtoF(self, t_K):
# Convert the temperature from Kelvin to Fahrenheit
@ -830,7 +840,7 @@ class SmartScript(BaseTool.BaseTool):
def convertFtToM(self, value_Ft):
# Convert the value in Feet to Meters
return value_Ft/3.28084
return value_Ft * 0.3048
#########################################################################
## Error Handling ##

View file

@ -59,6 +59,8 @@ import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
* ------------ ---------- ----------- --------------------------
* Sep 5, 2007 chammack Initial Creation.
* Apr 9, 2009 1288 rjpeter Added iterator implementation to fix remove.
* Apr 24, 2013 1950 bsteffen Sort resources before instantiation.
*
* </pre>
*
* @author chammack
@ -76,6 +78,33 @@ public class ResourceList extends CopyOnWriteArrayList<ResourcePair> implements
private static final int LOWEST = RenderingOrderFactory.ResourceOrder.LOWEST.value;
private static final Comparator<ResourcePair> INSTANTIATION_ORDERER = new Comparator<ResourcePair>() {
@Override
public int compare(ResourcePair rp1, ResourcePair rp2) {
if (rp1.getProperties().isSystemResource()) {
if (rp2.getProperties().isSystemResource()) {
return 0;
} else {
return -1;
}
} else if (rp2.getProperties().isSystemResource()) {
return 1;
}
if (rp1.getProperties().isMapLayer()) {
if (rp2.getProperties().isMapLayer()) {
return 0;
} else {
return -1;
}
} else if (rp2.getProperties().isMapLayer()) {
return 1;
}
return 0;
}
};
private final transient Set<AddListener> preAddListeners;
private final transient Set<AddListener> postAddListeners;
@ -868,17 +897,16 @@ public class ResourceList extends CopyOnWriteArrayList<ResourcePair> implements
boolean fireListeners) {
List<ResourcePair> orderedList = null;
synchronized (resourcesToInstantiate) {
if (descriptor.getTimeMatcher() != null) {
orderedList = new ArrayList<ResourcePair>(descriptor
.getTimeMatcher().getResourceLoadOrder(
resourcesToInstantiate));
} else {
orderedList = new ArrayList<ResourcePair>(
resourcesToInstantiate);
}
orderedList = new ArrayList<ResourcePair>(resourcesToInstantiate);
resourcesToInstantiate.removeAll(orderedList);
}
Collections.sort(orderedList, INSTANTIATION_ORDERER);
if (descriptor.getTimeMatcher() != null) {
orderedList = new ArrayList<ResourcePair>(descriptor
.getTimeMatcher().getResourceLoadOrder(orderedList));
}
Iterator<ResourcePair> iterator = orderedList.iterator();
List<ResourcePair> noTimes = new ArrayList<ResourcePair>();
List<ResourcePair> successful = new ArrayList<ResourcePair>();
@ -1025,4 +1053,6 @@ public class ResourceList extends CopyOnWriteArrayList<ResourcePair> implements
}
return resources;
}
}

View file

View file

View file

@ -89,6 +89,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Changes for non-blocking HelpDlg.
* Changes for non-blocking RetrieveMergeDlg.
* Changes for non-blocking LoadSaveDeleteSelectDlg.
* Apr, 15, 2013 #1911 dhladky dialog wouldn't open every time to retrieve file.
*
* </pre>
*
@ -1607,8 +1608,8 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction,
}
if (isDialogClear() && (fileNameLbl.getText().trim().length() == 0)) {
return;
} else {
getRetrieveFilename(RetrieveMergeAction.RETRIEVE);
} else {
if (retMergeDlg == null) {
retMergeDlg = new RetrieveMergeDlg(shell);
retMergeDlg.setCloseCallback(new ICloseCallback() {

View file

@ -73,8 +73,10 @@ import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpTableConfigData;
* feb 20, 2013 1635 dhladky Fixed multi guidance displays
* Feb 28, 2013 1729 dhladky General enhancements for speed.
* Apr 12, 2013 1902 mpduff Code Cleanup.
* Apr 15, 2013 1890 dhladky Added another constant fix
* Apr 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP.
* Apr 15, 2013 1890 dhladky Added another constant fix.
* 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 26, 2013 1954 bsteffen Minor code cleanup throughout FFMP.
*
* </pre>
*
@ -96,10 +98,12 @@ public class FFMPDataGenerator {
private final Date paintRefTime;
private final Object centeredAggregationKey;
private final String huc;
private final double sliderTime;
private boolean isWorstCase = false;
@ -154,6 +158,12 @@ public class FFMPDataGenerator {
ffmpTableCfgData = tableConfig.getTableConfigData(siteKey);
}
/**
* Generate the FFMP Data.
*
* @return FFMPTableData object
* @throws Exception
*/
public FFMPTableData generateFFMPData() throws Exception {
// You should always have at least a QPE data source
FFMPTableData tData = null;
@ -467,6 +477,7 @@ public class FFMPDataGenerator {
isRate);
}
}
trd.setTableCellData(2, new FFMPTableCellData(FIELDS.QPE,
qpe));
@ -477,8 +488,8 @@ public class FFMPDataGenerator {
qpf = basin.getAverageValue(window.getAfterTime(),
window.getBeforeTime());
}
}
trd.setTableCellData(3, new FFMPTableCellData(FIELDS.QPF,
qpf));
@ -582,7 +593,6 @@ public class FFMPDataGenerator {
} else {
guidance = resource.getGuidanceValue(ffmpGuidBasin, paintRefTime,
guidType);
if (guidance < 0.0f) {
guidance = Float.NaN;
}

View file

@ -2459,7 +2459,7 @@ public class FFMPResource extends
&& (!pfafsToProcess.isEmpty())) {
HashMap<Object, RGB> colorMap = new HashMap<Object, RGB>(
pfafsToProcess.size());
pfafsToProcess.size(), 1);
String shadedHuc = null;
if (!isAllPhuc) {

View file

@ -67,7 +67,10 @@ import com.vividsolutions.jts.geom.Coordinate;
* 03/13/2008 879 rbell Legacy conversion.
* 06/10/2009 2159 rjpeter Updated isValid to call gridSlice.isValid
* 02/19/2013 1637 randerso Added throws declarations to translateDataFrom
* 04/15/2013 1892 randerso Adding logging to help determine what is different in the gridInfos
* Changed how gridInfo is retrieved which seems to have fixed the problem
* 04/23/2013 1949 rjpeter Removed validation on copy, source is verified on store.
* </pre>
*
* @author chammack
@ -1019,16 +1022,20 @@ public abstract class AbstractGridData implements IGridData {
return false;
}
if (!((AbstractGridData) source).gridSlice.getGridInfo().equals(
this.gridSlice.getGridInfo())) {
if (!source.getParm().getGridInfo()
.equals(this.getParm().getGridInfo())) {
statusHandler.handle(Priority.PROBLEM,
"Differing gridInfos for source/dest for replace()");
"Differing gridInfos for source/dest for replace()."
+ "\nSource: " + source.getParm().getGridInfo()
+ "\nDest: " + this.getParm().getGridInfo());
return false;
}
if (!source.getGridTime().equals(getGridTime())) {
statusHandler.handle(Priority.PROBLEM,
"Differing gridTimes for source/dest for replace()");
"Differing gridTimes for source/dest for replace()"
+ "\nSource: " + source.getGridTime() + "\nDest: "
+ this.getGridTime());
return false;
}

View file

@ -353,11 +353,11 @@ public class ProductScriptsDialog extends CaveJFACEDialog {
start = start - 3;
cmd = cmd.substring(0, start) + returnMsg;
TaskManager.getInstance().createScriptTask(name, cmd);
}
}
}
TaskManager.getInstance().createScriptTask(name, cmd);
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);

View file

@ -1,4 +1,5 @@
com.raytheon.viz.mpe.ui.rsc.MPERadarRingOverlayResourceData
com.raytheon.viz.mpe.ui.displays.MPEMapRenderableDisplay
com.raytheon.viz.mpe.ui.displays.MPETimeMatcher
com.raytheon.viz.mpe.ui.rsc.RadarGageOverlayRscData
com.raytheon.viz.mpe.ui.rsc.RadarGageOverlayRscData
com.raytheon.viz.mpe.ui.rsc.MPEFieldResourceData

View file

@ -19,6 +19,7 @@
**/
package com.raytheon.viz.mpe.ui;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
@ -99,6 +100,8 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
* ------------ ---------- ----------- --------------------------
* Dec 18, 2012 mschenke Initial creation
* Mar 14, 2013 1457 mpduff Reset the gages on the resource.
* Apr 18, 2013 1920 mpduff Added updateGages method to reload the gage data,
* fix formatting of legend for Base field Height.
*
* </pre>
*
@ -401,6 +404,10 @@ public class MPEDisplayManager {
private DisplayFieldData displayedField;
private int displayedAccumHrs;
private ArealDisplay displayedArealDisplay;
private final MPEFieldResourceData fieldResourceData = new MPEFieldResourceData();
private MPEFieldResource displayedFieldResource;
@ -698,9 +705,14 @@ public class MPEDisplayManager {
*/
public void displayFieldData(DisplayFieldData fieldToDisplay,
int accumulationHrs, ArealDisplay arealDisplay) {
if (displayedField != fieldToDisplay || displayedFieldResource == null) {
if (displayedField != fieldToDisplay || displayedFieldResource == null
|| accumulationHrs != displayedAccumHrs
|| arealDisplay != displayedArealDisplay) {
DisplayFieldData oldField = displayedField;
displayedField = fieldToDisplay;
displayedAccumHrs = accumulationHrs;
displayedArealDisplay = arealDisplay;
ResourceList list = display.getDescriptor().getResourceList();
if (displayedFieldResource != null) {
@ -725,14 +737,6 @@ public class MPEDisplayManager {
listener.displayFieldChanged(oldField, fieldToDisplay);
}
}
// reset gages
List<MPEGageResource> rscs = display.getDescriptor()
.getResourceList()
.getResourcesByTypeAsType(MPEGageResource.class);
for (MPEGageResource rsc : rscs) {
rsc.reloadGages();
}
}
displayedFieldResource.issueRefresh();
@ -977,6 +981,13 @@ public class MPEDisplayManager {
APPLICATION_NAME, cvUse, durationInHrs * 60 * 60, "E",
pColorSetGroup).toArray(new Colorvalue[0]);
DisplayFieldData displayField = DisplayFieldData.fromString(cvUse);
if (displayField == DisplayFieldData.Height) {
params.setFormatString("0");
}
DecimalFormat format = new DecimalFormat(params.getFormatString());
int numColors = colorSet.length;
float[] red = new float[numColors];
float[] green = new float[numColors];
@ -1000,6 +1011,9 @@ public class MPEDisplayManager {
// display
entry.setDisplayValue(dataToDisplay
.convert((short) displayToData.convert(threshold)));
if (displayField != DisplayFieldData.Index) {
entry.setLabel(format.format(threshold));
}
}
entry.setPixelValue((double) i);
@ -1020,7 +1034,7 @@ public class MPEDisplayManager {
params.setColorMapMax(params.getDataMax());
// Check for Index parameter and set labels to radar sites
if (DisplayFieldData.fromString(cvUse) == DisplayFieldData.Index) {
if (displayField == DisplayFieldData.Index) {
MPERadarLoc[] radars = MPEDataManager.getInstance().getRadars()
.toArray(new MPERadarLoc[0]);
DataMappingEntry[] entries = dm.getEntries().toArray(
@ -1035,7 +1049,7 @@ public class MPEDisplayManager {
entries[i].setLabel("");
}
}
}
}
return params;
}
@ -1118,4 +1132,15 @@ public class MPEDisplayManager {
+ " - OK to Proceed?");
}
/**
* Update the Gage resource.
*/
public void updateGages() {
// reset gages
List<MPEGageResource> rscs = display.getDescriptor().getResourceList()
.getResourcesByTypeAsType(MPEGageResource.class);
for (MPEGageResource rsc : rscs) {
rsc.reloadGages();
}
}
}

View file

@ -26,10 +26,13 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
import com.raytheon.viz.hydrocommon.colorscalemgr.ColorScaleMgrDlg;
import com.raytheon.viz.mpe.ui.DisplayFieldData;
import com.raytheon.viz.mpe.ui.MPEDisplayManager;
import com.raytheon.viz.mpe.ui.colors.MPEColorManager;
import com.raytheon.viz.mpe.ui.rsc.MPEFieldResource;
import com.raytheon.viz.mpe.ui.rsc.MPEFieldResourceData;
/**
* TODO Add Description
@ -39,6 +42,7 @@ import com.raytheon.viz.mpe.ui.colors.MPEColorManager;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec 5, 2008 mschenke Initial creation
* Apr 18, 2013 1920 mpduff Set new ColorMap.
* </pre>
*
* @author mschenke
@ -69,9 +73,24 @@ public class MPEColorScaleMgrAction extends AbstractHandler {
colorScaleDlg.open();
}
DisplayFieldData dt = MPEDisplayManager.getCurrent()
.getDisplayFieldType();
MPEDisplayManager.getCurrent().displayFieldData(dt);
MPEFieldResource displayedFieldResource = MPEDisplayManager
.getCurrent().getDisplayedFieldResource();
if (displayedFieldResource != null) {
MPEFieldResourceData resourceData = displayedFieldResource
.getResourceData();
displayedFieldResource.getCapability(ColorMapCapability.class)
.setColorMapParameters(
MPEDisplayManager.createColorMap(
resourceData.getCvUseString(),
resourceData.getDurationInHours(),
resourceData.getDataUnits(),
resourceData.getDisplayUnits()));
DisplayFieldData dt = MPEDisplayManager.getCurrent()
.getDisplayFieldType();
MPEDisplayManager.getCurrent().displayFieldData(dt);
}
return null;
}

View file

@ -61,6 +61,8 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 23, 2008 randerso Initial creation
* Apr 30, 2013 lbousaidi made seconds in the date/Time
* fields visible.
* </pre>
*
* @author randerso
@ -259,7 +261,7 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
lastSave = new Label(statusComp, SWT.NONE);
lastSave.setText("NA");
data = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
data.widthHint = 120;
data.widthHint = 140;
lastSave.setLayoutData(data);
Label lab2 = new Label(statusComp, SWT.NONE);
@ -268,7 +270,7 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
lastExec = new Label(statusComp, SWT.NONE);
lastExec.setText("NA");
data = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
data.widthHint = 120;
data.widthHint = 140;
lastExec.setLayoutData(data);
Label lab3 = new Label(statusComp, SWT.NONE);

View file

@ -69,6 +69,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 2, 2008 randerso Initial creation
* May 01,2013 15920 lbousaidi gages get updated after clicking on
* Regenerate Hour Fields without closing 7x7 Gui.
* </pre>
*
* @author randerso
@ -179,8 +181,7 @@ public class Display7x7Dialog extends CaveSWTDialog {
if (gData != null) {
workingGage = new MPEDataManager.MPEGageData();
workingGage = gData;
undoEn = true;
workingGage = gData;
} else if (editGage.containsKey(selectedGage.getId())) {
workingGage = editGage.get(selectedGage.getId());
undoEn = true;
@ -482,6 +483,14 @@ public class Display7x7Dialog extends CaveSWTDialog {
undoMissing.setEnabled(undoEn);
String wid = workingGage.getId();
editGage.put(wid, workingGage);
if (!editGage.isEmpty()) {
Iterator<MPEGageData> x = editGage.values().iterator();
for (int i = 0; i < editGage.size(); i++) {
MPEGageData gd = x.next();
MPEDataManager.getInstance().addEditedGage(gd);
}
}
}
});
@ -557,6 +566,14 @@ public class Display7x7Dialog extends CaveSWTDialog {
oldManedit = workingGage.isManedit();
workingGage.setManedit(true);
editGage.put(wid, workingGage);
if (!editGage.isEmpty()) {
Iterator<MPEGageData> x = editGage.values().iterator();
for (int i = 0; i < editGage.size(); i++) {
MPEGageData gd = x.next();
MPEDataManager.getInstance().addEditedGage(gd);
}
}
}
});
@ -890,10 +907,9 @@ public class Display7x7Dialog extends CaveSWTDialog {
valueLabel.setText(String.format("%4.2f", scaleVal / 100.0f));
if (gageVal.equalsIgnoreCase("bad")) {
setBad.setText("Set Not Bad");
}
if (gageVal.equalsIgnoreCase("missing")) {
setMissing.setEnabled(false);
}
}
undoMissing.setEnabled(false);
updateGridField(displayTypes[prodSetCbo.getSelectionIndex()]);
}

View file

@ -41,7 +41,7 @@ import com.raytheon.viz.mpe.ui.rsc.MPEFieldResource;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
/**
* TODO Add Description
* The Run FieldGen dialog.
*
* <pre>
* SOFTWARE HISTORY
@ -49,6 +49,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* ------------ ---------- ----------- --------------------------
* Oct 27, 2008 snaples Initial creation
* Nov 10, 2008 1649 snaples Added handlers for Yes button
* Apr 18, 2013 1920 mpduff Call back to MPEDisplayManager to reload the gages.
* </pre>
*
* @author snaples
@ -109,6 +110,8 @@ public class DisplayFieldGenDialog extends CaveJFACEDialog {
if (rsc != null) {
rsc.getResourceData().update(dt);
}
instance.updateGages();
} catch (VizException ex) {
Activator.statusHandler.handle(Priority.PROBLEM,
"Error regenerating hourly fields", ex);

View file

@ -47,6 +47,7 @@ import com.raytheon.uf.common.colormap.Color;
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.DrawableCircle;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IExtent;
@ -95,6 +96,7 @@ import com.vividsolutions.jts.index.strtree.STRtree;
* Sep 5, 2012 15079 snaples Added constant for Milli to inches conversion factor
* Feb 12, 2013 15773 snaples Updated addPoints to display PC gages when token is set to use PC data.
* Mar 14, 2013 1457 mpduff Fixed various bugs.
* Apr 19, 2013 1920 mpduff Fixed gage color contrast, add e to display value of manually edited gages.
*
* </pre>
*
@ -192,8 +194,7 @@ public class MPEGageResource extends AbstractMPEInputResource implements
displayMgr.registerDisplayFieldChangedListener(this);
fontFactory = new MPEFontFactory(target, this);
loadColors();
lastDate = displayMgr.getCurrentEditDate();
addPoints(MPEDataManager.getInstance().readGageData(lastDate, lastDate));
reloadGages();
}
@Override
@ -350,10 +351,10 @@ public class MPEGageResource extends AbstractMPEInputResource implements
MPEDisplayManager.GageMissingOptions gm = MPEDisplayManager
.getGageMissing();
boolean displayIsEdit = false;
if (paintProps.getDataTime() != null
&& displayMgr.getCurrentEditDate() != null) {
displayIsEdit = displayMgr.getCurrentEditDate().equals(
paintProps.getDataTime().getRefTime());
DataTime paintTime = paintProps.getFramesInfo().getCurrentFrame();
Date editTime = displayMgr.getCurrentEditDate();
if (paintTime != null && editTime != null) {
displayIsEdit = editTime.equals(paintTime.getRefTime());
}
boolean xor = MPEDisplayManager.getGageColor() == GageColor.Contrast
&& displayIsEdit;
@ -421,6 +422,9 @@ public class MPEGageResource extends AbstractMPEInputResource implements
}
if (isGageIdsDisplayed || isGageValuesDisplayed) {
if (gageData.isManedit()) {
gageValue = gageValue.concat("e");
}
DrawableString string = new DrawableString(
new String[] { gageValue, gageId, }, gageColor);
string.font = font;
@ -651,7 +655,7 @@ public class MPEGageResource extends AbstractMPEInputResource implements
public void displayFieldChanged(DisplayFieldData oldFieldData,
DisplayFieldData newFieldData) {
loadColors();
reloadGages();
issueRefresh();
}
}

View file

@ -71,6 +71,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 8, 2009 snaples Initial creation
* May 2, 2013 15970 snaples Updated setColor to use the correct color.
*
* </pre>
*
@ -96,7 +97,7 @@ public class PlotMeanAreaPrecipResource extends
private ColorMapParameters parameters = new ColorMapParameters();
private List<Colorvalue> colorSet;
private final List<Colorvalue> colorSet;
public PlotMeanAreaPrecipResource(MPEDisplayManager displayMgr,
List<Colorvalue> colorSet) {
@ -542,12 +543,23 @@ public class PlotMeanAreaPrecipResource extends
if (i == colorMap.getColors().size()) {
break;
}
// DR 15970
// Adjusted the index value of the color returned, was
// returning one level higher than value should have.
if (value == entry.getDisplayValue()) {
if (i == 0){
gcol = convertC(colorMap.getColors().get(i));
} else {
gcol = convertC(colorMap.getColors().get(i - 1));
}
break;
} else if (value < entry.getDisplayValue()) {
gcol = convertC(colorMap.getColors().get(i));
break;
if (i == 0){
gcol = convertC(colorMap.getColors().get(i));
} else {
gcol = convertC(colorMap.getColors().get(i - 1));
}
break;
}
i++;
}

View file

@ -319,6 +319,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* is not a valid WMO heading.
* 31JAN2013 1563 rferrel Force location of airport tooltip.
* 31JAN2013 1568 rferrel Spell checker now tied to this dialog instead of parent.
* 26Apr2013 16123 snaples Removed setFocus to TextEditor in postExecute method.
* </pre>
*
* @author lvenable
@ -1101,7 +1102,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
/**
* flag to indicate it a product request is from the GUI or an updated ob.
*/
private AtomicInteger updateCount = new AtomicInteger(0);
private final AtomicInteger updateCount = new AtomicInteger(0);
/**
* The expire notification when editing a warn gen product.
@ -1199,7 +1200,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
/**
* Job to handle query for products off the UI thread.
*/
private ProductQueryJob productQueryJob = new ProductQueryJob(this);
private final ProductQueryJob productQueryJob = new ProductQueryJob(this);
/**
* Flag to indicate if the dialog is in wait mode.
@ -3175,10 +3176,12 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
});
afosCmdTF.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent event) {
}
@Override
public void widgetDefaultSelected(SelectionEvent event) {
String tmp = afosCmdTF.getText();
tmp = tmp.trim();
@ -3253,6 +3256,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
});
wmoTtaaiiTF.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent event) {
if (wmoTtaaiiTF.getCaretPosition() == wmoTtaaiiTF
.getTextLimit()) {
@ -3262,10 +3266,12 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
});
wmoTtaaiiTF.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent event) {
}
@Override
public void widgetDefaultSelected(SelectionEvent event) {
wmoTtaaiiTF.setText(wmoTtaaiiTF.getText().toUpperCase());
ccccTF.setText(ccccTF.getText().toUpperCase());
@ -3320,10 +3326,12 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
});
ccccTF.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent event) {
}
@Override
public void widgetDefaultSelected(SelectionEvent event) {
wmoTtaaiiTF.setText(wmoTtaaiiTF.getText().toUpperCase());
ccccTF.setText(ccccTF.getText().toUpperCase());
@ -3381,10 +3389,12 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
});
awipsIdTF.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent event) {
}
@Override
public void widgetDefaultSelected(SelectionEvent event) {
awipsIdTF.setText(awipsIdTF.getText().trim().toUpperCase());
int charCount = awipsIdTF.getCharCount();
@ -3794,6 +3804,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
// });
textEditor.addVerifyKeyListener(new VerifyKeyListener() {
@Override
public void verifyKey(VerifyEvent event) {
// Ignore edit keys when not in edit mode.
if (textEditor.getEditable() == false) {
@ -3925,6 +3936,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
mi.setEnabled(isPopItemDefault[items.indexOf(pi)]);
}
mi.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
handleSelection(event);
}
@ -5769,6 +5781,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
/**
* Set the dispaly model's AFOS command for this editor.
*/
@Override
public void setAfosCmdField(String cmd) {
afosCmdTF.setText(cmd);
TextDisplayModel.getInstance().setAfosCommand(token, cmd);
@ -5795,6 +5808,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
/**
* Convience method to execuete comand without updating ObsUpdated.
*/
@Override
public void executeCommand(ICommand command) {
executeCommand(command, false);
}
@ -5831,6 +5845,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
* Request for product(s) is finish now update the display with the
* information.
*/
@Override
public void requestDone(ICommand command,
final List<StdTextProduct> prodList, final boolean isObsUpdated) {
boolean enterEditor = false;
@ -6012,11 +6027,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
} else {
resendWarningProductnItem.setEnabled(true);
}
// Always give focus to textEditor after populating it.
if (validExecuteCommand) {
textEditor.setFocus();
}
}
}
@ -7181,6 +7191,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
@Override
public void run() {
getDisplay().syncExec(new Runnable() {
@Override
public void run() {
if (!shell.isDisposed()) {
if (autoSave == AutoSaveTask.this) {

View file

@ -41,6 +41,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* Feb 13, 2012 1605 jsanchez Calculated the point based on lat,lon values.
* Mar 25, 2013 1810 jsanchez Allowed other values to be accepted as a true value for useDirs.
* Mar 25, 2013 1605 jsanchez Set ClosestPoint's prepGeom.
* Apr 24, 2013 1944 jsanchez Updated calculateLocationPortion visibility to public.
*
* </pre>
*
@ -119,10 +120,26 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
int gid = getGid(ptFields, attributes);
ClosestPoint cp = new ClosestPoint(name, point, population, warngenlev,
partOfArea, gid);
cp.setPrepGeom(PreparedGeometryFactory.prepare(ptRslt.geometry));
// Used to determine if a storm location is within an urban bound area
if (useDirections(attributes.get(useDirectionField))) {
cp.setPrepGeom(PreparedGeometryFactory.prepare(ptRslt.geometry));
}
return cp;
}
/**
* Converts DB value (i.e. 1, t, true) to a boolean true
*
* @param useDirectionValue
* @return
*/
private boolean useDirections(Object useDirectionValue) {
String userDir = String.valueOf(useDirectionValue).toLowerCase();
return Boolean.valueOf(userDir) || userDir.equals("t")
|| userDir.equals("1");
}
/**
* Processes the filter to set the localized site.
*/
@ -148,7 +165,8 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
/**
* Determines the part of area impacted if the userDirectionField is set to
* true.
* true. This method only takes into account areas within the warning
* polygon.
*
* @param ptFields
* @param attributes
@ -158,17 +176,12 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
private List<String> getPartOfArea(Set<String> ptFields,
Map<String, Object> attributes, Geometry geom) {
List<String> partOfArea = null;
String userDir = String.valueOf(attributes.get(useDirectionField))
.toLowerCase();
boolean userDirections = Boolean.valueOf(userDir)
|| userDir.equals("t") || userDir.equals("1");
if (userDirections) {
if (useDirections(attributes.get(useDirectionField))) {
PreparedGeometry prepGeom = PreparedGeometryFactory.prepare(geom);
if (prepGeom.intersects(searchArea) && !prepGeom.within(searchArea)) {
Geometry intersection = searchArea.intersection(geom);
partOfArea = GisUtil.asStringList(calculateLocationPortion(
geom, intersection, gc));
geom, null, intersection, gc));
if (attributes.get(suppressedDirectionsField) != null) {
String suppressedDirections = String.valueOf(
@ -243,15 +256,20 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
* Calculates the cardinal directions of a location.
*
* @param geom
* @param point
* @param intersection
* @param gc
* @return
*/
private static EnumSet<Direction> calculateLocationPortion(Geometry geom,
Geometry intersection, GeodeticCalculator gc) {
public static EnumSet<Direction> calculateLocationPortion(Geometry geom,
Coordinate point, Geometry intersection, GeodeticCalculator gc) {
EnumSet<Direction> directions = EnumSet.noneOf(Direction.class);
Coordinate geomCentroid = geom.convexHull().getCentroid()
.getCoordinate();
Coordinate geomCentroid = null;
if (point != null) {
geomCentroid = point;
} else {
geomCentroid = geom.convexHull().getCentroid().getCoordinate();
}
Coordinate intersectCentroid = intersection.convexHull().getCentroid()
.getCoordinate();

View file

@ -21,7 +21,10 @@ package com.raytheon.viz.warngen.gis;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import org.geotools.coverage.grid.GeneralGridEnvelope;
import org.geotools.coverage.grid.GridGeometry2D;
@ -57,6 +60,8 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* ------------ ---------- ----------- --------------------------
* Dec 1, 2010 mschenke Initial creation
* 12/06/2012 DR 15559 Qinglu Lin Added round() methods.
* 04/16/2013 DR 16045 Qinglu Lin Relocated removeDuplicateCoordinate(), computeSlope(),
* computeCoordinate(), and adjustPolygon from WarngenUIState.
*
* </pre>
*
@ -982,4 +987,178 @@ public class PolygonUtil {
coordinate.x = x / Math.pow(10, decimalPlaces);
coordinate.y = y / Math.pow(10, decimalPlaces);
}
/**
* removeDuplicateCoordinate remove duplicate intermediate coordinates in
* warningPolygon. History 10-26-2012 Qinglu Lin DR15479 Created.
*/
public static Polygon removeDuplicateCoordinate(Polygon polygon) {
if (polygon == null) {
return null;
}
Coordinate[] verts = polygon.getCoordinates();
Set<Coordinate> coords = new LinkedHashSet<Coordinate>();
for (Coordinate c : verts)
coords.add(c);
if ((verts.length - coords.size()) < 2)
return polygon;
Coordinate[] vertices = new Coordinate[coords.size() + 1];
Iterator<Coordinate> iter = coords.iterator();
int i = 0;
while (iter.hasNext()) {
vertices[i] = new Coordinate(iter.next());
i += 1;
}
vertices[i] = new Coordinate(vertices[0]);
GeometryFactory gf = new GeometryFactory();
return gf.createPolygon(gf.createLinearRing(vertices), null);
}
/**
* computeSlope compute the slope of a line.
*
* History 12/06/2012 DR 15559 Qinglu Lin Created.
*/
private static double computeSlope(Coordinate[] coords, int i) {
double min = 1.0E-08;
double dx = coords[i].x - coords[i + 1].x;
double slope = 0.0;
if (Math.abs(dx) > min) {
slope = (coords[i].y - coords[i + 1].y) / dx;
}
return slope;
}
/**
* computeCoordinate Compute the x component of a coordinate after its y
* component is adjusted.
*
* History 12/06/2012 DR 15559 Qinglu Lin Created.
*/
private static void computeCoordinate(Coordinate[] c, int i, int j) {
double slope;
slope = computeSlope(c, i);
int iPlus1 = i + 1;
if (c[j].x >= c[i].x && c[j].x <= c[iPlus1].x || c[j].x >= c[iPlus1].x
&& c[j].x <= c[i].x) {
double x, y;
double min1 = 0.005d;
y = slope * (c[j].x - c[i].x) + c[i].y;
double d = Math.abs(y - c[j].y);
if (d > min1)
return;
double min2 = 1.0E-8d;
double delta = 0.005d; // empirical value
double dyMin = 0.01d;
int jMinus1 = j - 1;
if (jMinus1 < 0)
jMinus1 = c.length - 2;
int jPlus1 = j + 1;
if (Math.abs(y - c[j].y) < min1) {
double dy1, dy2;
dy1 = Math.abs(c[jMinus1].y - y);
dy2 = Math.abs(c[jPlus1].y - y);
if (dy1 >= dy2
&& (Math.abs(dy1) > dyMin || Math.abs(dy2) > dyMin)) {
// attempt to use l2 for computation
if (c[j].y == c[jMinus1].y
&& Math.abs(c[j].x - c[jMinus1].x) > min2) {
// l2 is a horizontal line, use l3 for computation
if (c[jPlus1].y < c[j].y)
delta = -delta;
slope = computeSlope(c, j);
if (Math.abs(slope) > min2) {
y = c[j].y + delta;
x = (y - c[jPlus1].y) / slope + c[jPlus1].x;
} else {
// l3 is a vertical line
y = c[j].y + delta;
x = c[j].x;
}
} else {
// use l2 for computation
if (c[jMinus1].y < c[j].y)
delta = -delta;
slope = computeSlope(c, jMinus1);
if (Math.abs(slope) > min2) {
y = c[j].y + delta;
x = (y - c[jMinus1].y) / slope + c[jMinus1].x;
} else {
// l2 is a vertical line
y = c[j].y + delta;
x = c[j].x;
}
}
} else {
if (Math.abs(dy1) > dyMin || Math.abs(dy2) > dyMin) {
// attempt to use l3 for computation
if (c[j].y == c[jPlus1].y
&& Math.abs(c[j].x - c[jPlus1].x) > min2) {
// l3 is a horizontal line, use l2 for computation
if (c[jMinus1].y < c[j].y)
delta = -delta;
slope = computeSlope(c, jMinus1);
if (Math.abs(slope) > min2) {
y = c[j].y + delta;
x = (y - c[jMinus1].y) / slope + c[jMinus1].x;
} else {
// l2 is a vertical line
y = c[j].y + delta;
x = c[j].x;
}
} else {
// use l3 for computation
if (c[jPlus1].y < c[j].y)
delta = -delta;
slope = computeSlope(c, j);
if (Math.abs(slope) > min2) {
y = c[j].y + delta;
x = (y - c[jPlus1].y) / slope + c[jPlus1].x;
} else {
// l3 is a vertical line
y = c[j].y + delta;
x = c[j].x;
}
}
} else {
x = c[j].x;
y = c[j].y;
}
}
c[j].x = x;
c[j].y = y;
if (j == 0)
c[c.length - 1] = c[j];
}
}
}
/**
* adjustPolygon When a point is very close to a line in the initial warning
* polygon, the resulting coordinates cause the failure of polygon drawing
* in follow-up. The method move that kind of points away from the line, and
* return a Polygon.
*
* History 12/06/2012 DR 15559 Qinglu Lin Created.
*/
public static void adjustPolygon(Coordinate[] coords) {
int n = coords.length;
for (int i = 0; i < n - 1; ++i) {
int j;
for (j = i + 2; j <= n - 2; j++) {
computeCoordinate(coords, i, j);
}
if (i <= n - 3)
for (j = 0; j < i; j++) {
computeCoordinate(coords, i, j);
}
else
for (j = 1; j < i; j++) {
computeCoordinate(coords, i, j);
}
}
}
}

View file

@ -73,6 +73,7 @@ import com.raytheon.viz.warngen.PreferenceUtil;
import com.raytheon.viz.warngen.WarngenException;
import com.raytheon.viz.warngen.config.AbstractDbSourceDataAdaptor;
import com.raytheon.viz.warngen.config.DataAdaptorFactory;
import com.raytheon.viz.warngen.config.DbAreaSourceDataAdaptor;
import com.raytheon.viz.warngen.util.Abbreviation;
import com.raytheon.viz.warngen.util.AdjustAngle;
import com.raytheon.viz.warnings.DateUtil;
@ -106,6 +107,7 @@ import com.vividsolutions.jts.geom.Point;
* Feb 12, 2013 1600 jsanchez Used adjustAngle method from AbstractStormTrackResource.
* Mar 5, 2013 1600 jsanchez Used AdjustAngle instead of AbstractStormTrackResource to handle angle adjusting.
* Mar 25, 2013 1605 jsanchez Checks if a storm location is over an urban bound area.
* Apr 24, 2013 1943 jsanchez Calculated partOfArea for a storm location over an urban bound area.
*
* </pre>
*
@ -723,10 +725,21 @@ public class Wx {
latLonToLocal);
double distance = localDistanceGeom.distance(localPt);
// Tests if storm location is over an urban bound area
if (cp.prepGeom != null
&& cp.prepGeom.intersects(stormLocation)) {
distance = 0;
// Tests if storm location is over an urban bound area even if
// it may be outside the warning polygon
if (cp.prepGeom != null && config.isTrackEnabled()
&& isWithinPolygon == false) {
// When isWithinPolygon is true, partOfArea
// has already been set in DbAreaSoureDataAdapter
Point reference = gf.createPoint(coords[i]);
if (cp.prepGeom.intersects(reference)) {
cp.partOfArea = GisUtil
.asStringList(DbAreaSourceDataAdaptor
.calculateLocationPortion(
cp.prepGeom.getGeometry(),
cp.point, reference, gc));
distance = 0;
}
}
if (distance <= thresholdInMeters) {
if (allowDuplicates) {

View file

@ -135,7 +135,7 @@ import com.vividsolutions.jts.geom.Polygon;
* and removed it from updateListSelected().
* Feb 18, 2013 #1633 rferrel Changed checkFollowupSelection to use SimulatedTime.
* Mar 28, 2013 DR 15974 D. Friedman Do not track removed GIDs.
*
* Apr 11, 2013 1894 jsanchez Removed the ability to load/unload maps via bullet selection. This will be resolved in a follow on ticket.
* </pre>
*
* @author chammack
@ -1426,7 +1426,6 @@ public class WarngenDialog extends CaveSWTDialog implements
.getBullets(), warngenLayer.getConfiguration()
.getDamInfoBullets());
refreshBulletList();
updateMaps(bulletListManager.getMapsToLoad());
// duration
boolean enableDuration = warngenLayer.getConfiguration()
@ -1626,7 +1625,10 @@ public class WarngenDialog extends CaveSWTDialog implements
bulletListManager.recreateBullets(warngenLayer
.getConfiguration().getBullets(), warngenLayer
.getConfiguration().getDamInfoBullets());
updateMaps(bulletListManager.getMapsToLoad());
// TODO Repair load/unload maps via bullet selection
// A follow on ticket will be written to fix the existing broken
// functionality of loading/unloading maps
// updateMaps(bulletListManager.getMapsToLoad());
} else {
bulletListManager.recreateBulletsFromFollowup(
warngenLayer.getConfiguration(), action, oldWarning);
@ -1729,7 +1731,10 @@ public class WarngenDialog extends CaveSWTDialog implements
bulletList.deselectAll();
bulletList.setItems(bulletListManager.getAllBulletTexts());
bulletList.select(bulletListManager.getSelectedIndices());
updateMaps(bulletListManager.getMapsToLoad());
// TODO Repair load/unload maps via bullet selection
// A follow on ticket will be written to fix the existing broken
// functionality of loading/unloading maps
// updateMaps(bulletListManager.getMapsToLoad());
}
private void updateMaps(ArrayList<String> mapsToLoad) {

View file

@ -58,6 +58,8 @@ import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.common.activetable.ActiveTableRecord;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration;
import com.raytheon.uf.common.dataplugin.warning.config.AreaSourceConfiguration.AreaType;
import com.raytheon.uf.common.dataplugin.warning.config.BulletActionGroup;
import com.raytheon.uf.common.dataplugin.warning.config.DialogConfiguration;
import com.raytheon.uf.common.dataplugin.warning.config.GridSpacing;
@ -165,9 +167,12 @@ import com.vividsolutions.jts.io.WKTReader;
* 03/28/2013 DR 15974 D. Friedman Preserve the set of selected counties when recreating the polygon from the
* hatched area and remember marked counties outside the polygon on followup.
* 04/03/2013 1858 jsanchez Handled creating follow up warnings when created before 0z but issued after 0z.
* 03/13/2013 DR 15942 Qinglu Lin Added code to prevent small area from being toggled on that
* 04/03/2013 DR 15942 Qinglu Lin Added code to prevent small area from being toggled on that
* does not meet inclusionPercent/inclusionArea criteria.
* 04/10/2013 DR 16044 D. Friedman Fix NPE in getAllFipsInArea.
* 04/11/2013 1894 jsanchez Kept tracked of the currently loaded custom maps.
* 04/12/1013 DR 16045 Qinglu Lin Updated AreaHatcher's run() by calling removeDuplicateCoordinate().
* 04/24/2013 1943 jsanchez Replaced used of areaConfig with areaSource.
* </pre>
*
* @author mschenke
@ -197,7 +202,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
private class CustomMaps extends Job {
private final Set<String> customMaps = new HashSet<String>();
private Set<String> customMaps = new HashSet<String>();
private Set<String> mapsToLoad;
@ -228,7 +233,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
for (String load : toLoad) {
manager.loadMapByName(load);
}
customMaps = toLoad;
issueRefresh();
}
@ -241,6 +246,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
synchronized (this) {
mapsToLoad = new HashSet<String>(maps);
}
schedule();
}
@ -285,6 +291,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
}
try {
warningPolygon = PolygonUtil.removeDuplicateCoordinate(warningPolygon);
Polygon hatched = polygonUtil.hatchWarningArea(
warningPolygon,
removeCounties(warningArea,
@ -293,7 +300,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
// DR 15559
Coordinate[] coords = hatched.getCoordinates();
PolygonUtil.round(coords, 2);
WarngenUIState.adjustPolygon(coords);
PolygonUtil.adjustPolygon(coords);
GeometryFactory gf = new GeometryFactory();
LinearRing lr = gf.createLinearRing(coords);
hatchedArea = gf.createPolygon(lr, null);
@ -2558,8 +2565,13 @@ public class WarngenLayer extends AbstractStormTrackResource {
}
private String getFips(GeospatialData data) {
return (String) data.attributes.get(configuration.getAreaConfig()
.getFipsField());
for (AreaSourceConfiguration areaSource : configuration
.getAreaSources()) {
if (areaSource.getType() == AreaType.HATCHING) {
return (String) data.attributes.get(areaSource.getFipsField());
}
}
return null;
}
private String getFips(Geometry g) {

View file

@ -45,6 +45,11 @@ import com.vividsolutions.jts.geom.Polygon;
* and adjustPolygon().
* Feb 15, 2013 1624 jsanchez Fix NullPointerException in removeDuplicateCoordinate.
* 03/28/2013 DR 15974 D. Friedman Track marked areas outside polygon.
* 04/12/2013 DR 16045 Qinglu Lin Updated setWarningPolygon() by removing the call to
* removeDuplicateCoordinate() and updated removeDuplicateCoordinate()
* by changing access control level from private to public.
* Moved removeDuplicateCoordinate(), computeSlope(),computeCoordinate(),
* and adjustPolygon to PolygonUtil.
*
* </pre>
*
@ -126,180 +131,6 @@ public class WarngenUIState {
return oldWarningArea;
}
/**
* removeDuplicateCoordinate remove duplicate intermediate coordinates in
* warningPolygon. History 10-26-2012 Qinglu Lin DR15479 Created.
*/
private static Polygon removeDuplicateCoordinate(Polygon polygon) {
if (polygon == null) {
return null;
}
Coordinate[] verts = polygon.getCoordinates();
Set<Coordinate> coords = new LinkedHashSet<Coordinate>();
for (Coordinate c : verts)
coords.add(c);
if ((verts.length - coords.size()) < 2)
return polygon;
Coordinate[] vertices = new Coordinate[coords.size() + 1];
Iterator<Coordinate> iter = coords.iterator();
int i = 0;
while (iter.hasNext()) {
vertices[i] = new Coordinate(iter.next());
i += 1;
}
vertices[i] = new Coordinate(vertices[0]);
GeometryFactory gf = new GeometryFactory();
return gf.createPolygon(gf.createLinearRing(vertices), null);
}
/**
* computeSlope compute the slope of a line.
*
* History 12/06/2012 DR 15559 Qinglu Lin Created.
*/
private static double computeSlope(Coordinate[] coords, int i) {
double min = 1.0E-08;
double dx = coords[i].x - coords[i + 1].x;
double slope = 0.0;
if (Math.abs(dx) > min) {
slope = (coords[i].y - coords[i + 1].y) / dx;
}
return slope;
}
/**
* computeCoordinate Compute the x component of a coordinate after its y
* component is adjusted.
*
* History 12/06/2012 DR 15559 Qinglu Lin Created.
*/
private static void computeCoordinate(Coordinate[] c, int i, int j) {
double slope;
slope = computeSlope(c, i);
int iPlus1 = i + 1;
if (c[j].x >= c[i].x && c[j].x <= c[iPlus1].x || c[j].x >= c[iPlus1].x
&& c[j].x <= c[i].x) {
double x, y;
double min1 = 0.005d;
y = slope * (c[j].x - c[i].x) + c[i].y;
double d = Math.abs(y - c[j].y);
if (d > min1)
return;
double min2 = 1.0E-8d;
double delta = 0.005d; // empirical value
double dyMin = 0.01d;
int jMinus1 = j - 1;
if (jMinus1 < 0)
jMinus1 = c.length - 2;
int jPlus1 = j + 1;
if (Math.abs(y - c[j].y) < min1) {
double dy1, dy2;
dy1 = Math.abs(c[jMinus1].y - y);
dy2 = Math.abs(c[jPlus1].y - y);
if (dy1 >= dy2
&& (Math.abs(dy1) > dyMin || Math.abs(dy2) > dyMin)) {
// attempt to use l2 for computation
if (c[j].y == c[jMinus1].y
&& Math.abs(c[j].x - c[jMinus1].x) > min2) {
// l2 is a horizontal line, use l3 for computation
if (c[jPlus1].y < c[j].y)
delta = -delta;
slope = computeSlope(c, j);
if (Math.abs(slope) > min2) {
y = c[j].y + delta;
x = (y - c[jPlus1].y) / slope + c[jPlus1].x;
} else {
// l3 is a vertical line
y = c[j].y + delta;
x = c[j].x;
}
} else {
// use l2 for computation
if (c[jMinus1].y < c[j].y)
delta = -delta;
slope = computeSlope(c, jMinus1);
if (Math.abs(slope) > min2) {
y = c[j].y + delta;
x = (y - c[jMinus1].y) / slope + c[jMinus1].x;
} else {
// l2 is a vertical line
y = c[j].y + delta;
x = c[j].x;
}
}
} else {
if (Math.abs(dy1) > dyMin || Math.abs(dy2) > dyMin) {
// attempt to use l3 for computation
if (c[j].y == c[jPlus1].y
&& Math.abs(c[j].x - c[jPlus1].x) > min2) {
// l3 is a horizontal line, use l2 for computation
if (c[jMinus1].y < c[j].y)
delta = -delta;
slope = computeSlope(c, jMinus1);
if (Math.abs(slope) > min2) {
y = c[j].y + delta;
x = (y - c[jMinus1].y) / slope + c[jMinus1].x;
} else {
// l2 is a vertical line
y = c[j].y + delta;
x = c[j].x;
}
} else {
// use l3 for computation
if (c[jPlus1].y < c[j].y)
delta = -delta;
slope = computeSlope(c, j);
if (Math.abs(slope) > min2) {
y = c[j].y + delta;
x = (y - c[jPlus1].y) / slope + c[jPlus1].x;
} else {
// l3 is a vertical line
y = c[j].y + delta;
x = c[j].x;
}
}
} else {
x = c[j].x;
y = c[j].y;
}
}
c[j].x = x;
c[j].y = y;
if (j == 0)
c[c.length - 1] = c[j];
}
}
}
/**
* adjustPolygon When a point is very close to a line in the initial warning
* polygon, the resulting coordinates cause the failure of polygon drawing
* in follow-up. The method move that kind of points away from the line, and
* return a Polygon.
*
* History 12/06/2012 DR 15559 Qinglu Lin Created.
*/
public static void adjustPolygon(Coordinate[] coords) {
int n = coords.length;
for (int i = 0; i < n - 1; ++i) {
int j;
for (j = i + 2; j <= n - 2; j++) {
computeCoordinate(coords, i, j);
}
if (i <= n - 3)
for (j = 0; j < i; j++) {
computeCoordinate(coords, i, j);
}
else
for (j = 1; j < i; j++) {
computeCoordinate(coords, i, j);
}
}
}
/**
* Set the old warning area in lat/lon projection. Will be converted to
* local
@ -326,7 +157,7 @@ public class WarngenUIState {
* the warningPolygon to set
*/
public void setWarningPolygon(Polygon warningPolygon) {
this.warningPolygon = removeDuplicateCoordinate(warningPolygon);
this.warningPolygon = warningPolygon;
}
public Set<String> getFipsOutsidePolygon() {

View file

@ -33,6 +33,7 @@ import java.util.regex.Pattern;
* Sep 24, 2012 15332 jsanchez Initial creation
* Oct 18, 2012 15332 jsanchez Replaced listOfAreaNamesPtrn with String pattern.
* Mar 13, 2013 DR 15892 D. Friedman Allow some punctuation in area names.
* Apr 18, 2013 DR 16055 D. Friedman Allow more than one contiguous space in areas.
*
* </pre>
*
@ -56,7 +57,7 @@ public interface ICommonPatterns {
// LOCK_END can be added at the start of the line if a previous line has
// been locked.
public static final String listOfAreaName = "^((" + LOCK_END
+ "){0,1}((([\\?\\(\\)\\w\\.,/'-]+\\s{1})+\\w{2}-)*(([\\?\\(\\)\\w\\.,/'-]+\\s{1})+\\w{2}-)))";
+ "){0,1}((([\\?\\(\\)\\w\\.,/'-]+\\s{1,})+\\w{2}-)*(([\\?\\(\\)\\w\\.,/'-]+\\s{1,})+\\w{2}-)))";
// LOCK_END should not be found at the beginning of a first bullet since the
// previous line should be blank.

View file

@ -33,6 +33,7 @@ import java.util.regex.Pattern;
* ------------ ---------- ----------- --------------------------
* Sep 24, 2012 15322 jsanchez Initial creation
* Oct 19, 2012 15332 jsanchez Created a local pattern listOfAreaNamesPtrn.
* Apr 18, 2013 DR 16055 D. Friedman Fix word wrapping of long area names.
*
* </pre>
*
@ -48,24 +49,13 @@ public class WrapUtil implements ICommonPatterns {
private static final String BULLET_START = "* ";
private static final Pattern wrapUgcPtrn = Pattern.compile("(\\S{1,"
+ (MAX_WIDTH - 1) + "}-)");
// Guess at the amount of extra characters added by wrapping
private static final int WRAP_COUNT_GUESS = 16 * 3; // *3 for bullet indent + \n
private static final Pattern wrapListOfNamesPtrn = Pattern.compile("(.{1,"
+ (MAX_WIDTH - 4) + "} \\w{2}-)");
// Locations in 4th bullet or locations paragraph of followup
// ex: ellipsis, spaces, period
private static final Pattern wrapDefaultPtrn = Pattern
.compile("(\\w{1,}\\.\\.\\.)|(AND \\w+\\.\\.\\.)|(\\w+\\.\\.\\.\\s{1,2})|"
+ "("
+ LOCK_START
+ "\\w+"
+ LOCK_END
+ "\\.\\.\\.)|\\S+\\.\\.\\."
+ LOCK_END
+ "|\\S+\\.\\.\\.|"
+ "(\\s*\\S+\\s+)|(.+\\.)|(\\S+$)");
private static final String DELIM_GROUP = "\0";
private static final String[] NORMAL_DELIMS = { " ", "...", DELIM_GROUP, "-" };
private static final String[] AREA_DELIMS = { "-", "...", DELIM_GROUP, " " };
private static final String[] UGC_DELIMS = AREA_DELIMS;
// ugc pattern
private static final Pattern ugcPtrn = Pattern.compile(ugc);
@ -93,19 +83,24 @@ public class WrapUtil implements ICommonPatterns {
if (unlocked.trim().length() == 0) { // BLANK LINE
inBullet = false;
addLine = line;
} else if (unlocked.length() <= MAX_WIDTH) { // LESS THAN MAX
// Add indenting if the template didn't account for it yet.
if (inBullet && !unlocked.startsWith(INDENT)) {
sb.append(INDENT);
}
} else {
boolean wasInBullet = inBullet;
if (unlocked.startsWith(BULLET_START)) {
inBullet = true;
}
addLine = line;
} else { // NEEDS TO BE WRAPPED
addLine = wrapLongLines(line, inBullet);
// Add indenting if the template didn't account for it yet.
int add = wasInBullet && !unlocked.startsWith(INDENT) ? INDENT
.length() : 0;
if (unlocked.length() <= MAX_WIDTH - add) { // LESS THAN MAX
if (add > 0) {
sb.append(INDENT);
}
addLine = line;
} else { // NEEDS TO BE WRAPPED
addLine = wrapLongLines(line, inBullet);
}
}
sb.append(addLine);
@ -125,34 +120,113 @@ public class WrapUtil implements ICommonPatterns {
* @return
*/
private static String wrapLongLines(String line, boolean inBullet) {
StringBuffer sb = new StringBuffer(line.length());
String unlockedLine = line.replaceAll(LOCK_START + "|" + LOCK_END, "");
String[] delims = getDelimiters(line);
return wrapLongLine(line, inBullet, delims, MAX_WIDTH);
}
if (unlockedLine.startsWith(BULLET_START)) {
inBullet = true;
}
/**
* Wraps a line of text to the given maximum width, if possible, by breaking
* at the given delimiters.
*
* @param line
* @param inBullet
* @param delims
* a list of delimiters divided into groups by the object
* instance DELIM_GROUP. A delimiter in an earlier group will be
* used before using any delimiter from a later group. Within a
* group, the delimiter closest to the margin is used.
* @param maxLength
* @return
*/
public static String wrapLongLine(String line, boolean inBullet, String[] delims, int maxLength) {
StringBuilder sb = new StringBuilder(line.length() + WRAP_COUNT_GUESS);
int start = 0;
int allowLength = maxLength;
boolean failed = false;
Pattern p = getPattern(line);
Matcher m = p.matcher(line.trim());
String tmp = inBullet && !unlockedLine.startsWith(BULLET_START) ? INDENT
: "";
while (m.find()) {
String group = m.group();
String unlocked = group.replaceAll(LOCK_START + "|" + LOCK_END, "");
int len = tmp.replaceAll(LOCK_START + "|" + LOCK_END, "").length();
if (len + unlocked.length() > MAX_WIDTH && tmp.trim().length() > 0) {
sb.append(tmp + "\n");
tmp = inBullet ? INDENT : "";
tmp += group;
} else {
tmp += group;
/*
* Skip over initial bullet point and/or indent OR add indentation if
* missing.
*/
if (inBullet) {
char[] cb = new char[2];
int i = indexIgnoringLockMarkers(line, start, 0);
int o = 0;
while (i < line.length() && o < 2) {
cb[o++] = line.charAt(i);
i = indexIgnoringLockMarkers(line, i, 1);
}
if (o == 2) {
String lead = new String(cb, 0, o);
if (INDENT.equals(lead) || BULLET_START.equals(lead)) {
allowLength -= lead.length();
start = i;
sb.append(line, 0, i);
} else {
allowLength -= INDENT.length();
sb.append(INDENT);
}
}
}
if (tmp.trim().length() > 0) {
sb.append(tmp);
while (start < line.length()) {
int limit = indexIgnoringLockMarkers(line, start, allowLength);
if (limit >= line.length()) {
appendRTrim(line, start, line.length(), sb);
break;
}
/*
* Find delimiter in a group of delimiters that is closest to the
* wrap margin. If not found, try again with the next group.
*
* Searches before the limit (or at the limit if the delimiter is a
* space). If the whole process has failed once, searches after the
* limit.
*/
String bestDelim = null;
int bestP = -1;
for (String delim : delims) {
if (delim == DELIM_GROUP) {
if (bestDelim != null)
break;
continue;
}
int backup = " ".equals(delim) ? 0 : delim.length();
int p = !failed ? line.lastIndexOf(delim, limit - backup)
: line.indexOf(delim, limit - backup);
if (p >= start && (bestDelim == null
|| !failed ? p > bestP : p < bestP)) {
bestDelim = delim;
bestP = p;
}
}
if (bestDelim != null) {
failed = false;
int next = bestP + bestDelim.length();
int segmentEnd = " ".equals(bestDelim) ? bestP : next;
appendRTrim(line, start, segmentEnd, sb);
start = splitEndOfLine(line, next, inBullet, sb);
if (inBullet) {
allowLength = maxLength - INDENT.length();
}
} else if (! failed) {
/*
* Failed to wrap before the margin. Try again, wrapping the
* line after the margin, but still as close to it as possible.
*/
failed = true;
continue;
} else {
/*
* Failed to find any kind of break. Just dump the rest of the
* text.
*/
appendRTrim(line, start, line.length(), sb);
break;
}
}
return sb.toString();
@ -164,21 +238,123 @@ public class WrapUtil implements ICommonPatterns {
* @param line
* @return
*/
private static Pattern getPattern(String line) {
private static String[] getDelimiters(String line) {
Matcher m = ugcPtrn.matcher(line);
// UGC line or FIPS line
if (m.find()) {
return wrapUgcPtrn;
return UGC_DELIMS;
}
m = listOfAreaNamePtrn.matcher(line);
// List of area names.
if (m.find() && !line.startsWith(BULLET_START)) {
return wrapListOfNamesPtrn;
return AREA_DELIMS;
}
return wrapDefaultPtrn;
return NORMAL_DELIMS;
}
/**
* Returns the index in {@code text} that is {@code count} characters after
* {@code start}, skipping past any lock markers. This includes any lock
* markers at the desired index. This greediness prevents wrapping to a new
* line that would only contain lock markers.
*
* @param text
* @param start
* 0 <= start < text.length()
* @param count
* Number of characters to skip. May be greater than the number
* of characters in text past start.
* @return
*/
private static int indexIgnoringLockMarkers(String text, int start, int count) {
int i = start;
do {
if (text.startsWith(LOCK_START, i))
i += LOCK_START.length();
else if (text.startsWith(LOCK_END, i))
i += LOCK_END.length();
else if (count > 0) {
if (i >= text.length())
break;
++i;
--count;
} else
break;
} while (true);
return i;
}
/**
* Append text.substring(start, end) to sb, removing any trailing
* whitespace. The trailing whitespace may have have embedded lock marks.
*/
private static void appendRTrim(String text, int start, int end, StringBuilder sb) {
int sbStart = sb.length();
sb.append(text, start, end);
int i = sb.length();
while (i > sbStart) {
if (Character.isWhitespace(sb.charAt(i - 1))) {
sb.deleteCharAt(--i);
} else if (i - sbStart >= LOCK_START.length() &&
LOCK_START.equals(sb.substring(i - LOCK_START.length(), i))) {
i -= LOCK_START.length();
} else if (i - sbStart >= LOCK_END.length() &&
LOCK_END.equals(sb.substring(i - LOCK_END.length(), i))) {
i -= LOCK_END.length();
} else
break;
}
}
/**
* Handle whitespace and lock markers between line breaks. Adds line break
* and indentation for the next line as necessary.
*
* <ul>
* <li>If there is nothing but whitespace and lock markers remaining, append
* all of it to the current line so as to not create an extra empty blank
* line.</li>
* <li>If there is an end-lock marker, include it on the current line and
* break after it.</li>
* <li>If there is a start-lock marker, break before it.
* </ul>
*
* @return The index in text at which processing for the next line should
* begin.
*/
private static int splitEndOfLine(String text, int start, boolean inBullet, StringBuilder sb) {
int goodBreak = start;
int i = start;
while (i < text.length()) {
if (Character.isWhitespace(text.charAt(i))) {
++i;
} else if (text.startsWith(LOCK_START, i)) {
goodBreak = i;
i += LOCK_START.length();
break;
} else if (text.startsWith(LOCK_END, i)) {
i += LOCK_END.length();
goodBreak = i;
break;
} else
break;
}
if (i >= text.length())
goodBreak = i;
if (goodBreak >= start) {
appendRTrim(text, start, goodBreak, sb);
}
if (i < text.length()) {
sb.append('\n');
if (inBullet) {
sb.append(INDENT);
}
appendRTrim(text, goodBreak, i, sb);
}
return i;
}
}

View file

@ -68,6 +68,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Mar 28, 2011 mschenke Initial creation
* Feb 12, 2013 1500 mschenke Refactored to not request full records and only request full
* record when actually retrieving for use
* Apr 22, 2013 jsanchez Set the issue time for follow up warnings.
*
* </pre>
*
@ -303,6 +304,7 @@ public class CurrentWarnings {
if (getAction(warning.getAct()) == WarningAction.EXT) {
if (rval != null) {
rval.setEndTime(warning.getEndTime());
rval.setIssueTime(warning.getInsertTime());
}
}
}
@ -317,6 +319,7 @@ public class CurrentWarnings {
rval.setUgczones(warning.getUgczones());
rval.setLoc(warning.getLoc());
rval.setRawmessage(warning.getRawmessage());
rval.setIssueTime(warning.getInsertTime());
}
}
}

View file

@ -50,6 +50,7 @@ import com.raytheon.viz.warnings.DateUtil;
* May 6, 2008 bwoodle Initial creation
* Dec 28 2012 DR15599 mgamazaychikov Updated method getListCounties to fix the problem
* with generated list of counties.
* Apr 25,2013 1877 jsanchez Sorted the UGC line for cancellations.
*
* </pre>
*
@ -170,6 +171,7 @@ public class FipsUtil {
}
}
Collections.sort(countiesOrZones);
rval.append(simplifyHeader(getUgcLine(countiesOrZones)));
rval.append(du
.format(endtime, new SimpleDateFormat("ddHHmm"), interval)
@ -362,12 +364,12 @@ public class FipsUtil {
}
/*
* DR15599 - completely re-did how rval is calculated.
* DR15599 - completely re-did how rval is calculated.
*/
String[] lines = matchStr.split("[\n]");
matchStr = "";
for (String line : lines) {
matchStr += line;
matchStr += line;
}
String[] ranges = matchStr.split("[-]");
@ -376,12 +378,12 @@ public class FipsUtil {
for (String range : ranges) {
if (Character.isLetter(range.charAt(0))) {
/*
* range starts with a character - get the new
* state or marine zone name
* range starts with a character - get the new state or marine
* zone name
*/
if (curState != null) {
for (String zone: curList) {
rval.add(curState+zone);
for (String zone : curList) {
rval.add(curState + zone);
}
}
curState = range.substring(0, 3);
@ -406,8 +408,8 @@ public class FipsUtil {
}
}
if (curState != null) {
for (String zone: curList) {
rval.add(curState+zone);
for (String zone : curList) {
rval.add(curState + zone);
}
}
return rval;

View file

@ -3,6 +3,7 @@ package com.raytheon.viz.warnings.rsc;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -74,7 +75,10 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* String array returned from getText method
* Jun 04, 2012 DR14992 mgamazaychikov Reversed the previous changes
* Sep 26, 2012 jsanchez Refactored AbstractWarningResource and AbstractWatchesResource into this class.
*
* Apr 11, 2013 1877 jsanchez Updated conditions for matching a frame.
* Apr 18, 2013 1877 jsanchez Had the child classes set the comparator. Fixed a null pointer.
* Remove frameAltered condition in matchesFrame. It prevented entries from being displayed.
* Check if geometry is null when inspecting.
* </pre>
*
* @author jsanchez
@ -103,8 +107,6 @@ public abstract class AbstractWWAResource extends
protected Date timeAltered;
protected Date frameAltered;
/**
* was the alter a partial cancel? if it was then a matching CON should
* be processed and added
@ -152,7 +154,7 @@ public abstract class AbstractWWAResource extends
protected List<AbstractWarningRecord> recordsToLoad;
protected WarningRecordComparator comparator = new WarningRecordComparator();
protected Comparator<AbstractWarningRecord> comparator;
protected abstract void updateDisplay(IGraphicsTarget target)
throws VizException;
@ -215,7 +217,8 @@ public abstract class AbstractWWAResource extends
WarningEntry entry = entryMap.get(key);
AbstractWarningRecord record = entry.record;
if (matchesFrame(entry, time, framePeriod, lastFrame)) {
if (matchesFrame(entry, time, framePeriod, lastFrame)
&& record.getGeometry() != null) {
Geometry recordGeom = record.getGeometry();
for (int i = 0; i < recordGeom.getNumGeometries(); i++) {
@ -284,18 +287,24 @@ public abstract class AbstractWWAResource extends
PaintProperties paintProps) throws VizException {
FramesInfo info = paintProps.getFramesInfo();
DataTime[] frames = info.getFrameTimes();
int frameToRequestedCompare = frames[0].compareTo(earliestRequested);
if (frameToRequestedCompare < 0) {
// we haven't requested data this far back
if (earliestRequested == null) {
this.requestData(frames[0]);
} else if (frameToRequestedCompare > 0) {
// the previous earliest frame was removed as updates came in, so
// the warnings need to be disposed and we need to update the
// earliestRequested so if they ever went back in time to that
// again, it would be re-requested
earliestRequested = frames[0];
if (paintProps.getDataTime() != null) {
cleanupData(paintProps.getDataTime(), frames);
} else {
int frameToRequestedCompare = frames[0]
.compareTo(earliestRequested);
if (frameToRequestedCompare < 0) {
// we haven't requested data this far back
this.requestData(frames[0]);
} else if (frameToRequestedCompare > 0) {
// the previous earliest frame was removed as updates came in,
// so
// the warnings need to be disposed and we need to update the
// earliestRequested so if they ever went back in time to that
// again, it would be re-requested
earliestRequested = frames[0];
if (paintProps.getDataTime() != null) {
cleanupData(paintProps.getDataTime(), frames);
}
}
}
int index = info.getFrameIndex();
@ -436,16 +445,12 @@ public abstract class AbstractWWAResource extends
if (action == WarningAction.CAN && refTime.equals(paintTime)) {
return false;
// If this entry has been altered/updated, display its pre-altered
// version
// only in the frames prior to the time it was altered
// version only in the frames prior to the time it was altered
} else if (entry.altered) {
if (frameStart.getTime() >= refTime.getTime()
&& frameStart.getTime() < (entry.timeAltered.getTime())
&& frameStart.getTime() < entry.frameAltered.getTime())
&& frameStart.getTime() < entry.timeAltered.getTime()) {
return true;
if (frameStart.getTime() >= (entry.timeAltered.getTime()))
return false;
}
} else if (refTime.equals(paintTime)
|| recordPeriod.contains(frameTime)
|| (framePeriod.contains(centerTime) && (!lastFrame || !entry.altered))) {
@ -518,8 +523,9 @@ public abstract class AbstractWWAResource extends
}
}
/* Sorts by phensig, etn, starttime (descending), act */
Collections.sort(sortedWarnings, comparator);
if (comparator != null) {
Collections.sort(sortedWarnings, comparator);
}
return sortedWarnings.toArray(new AbstractWarningRecord[sortedWarnings
.size()]);
}

View file

@ -18,6 +18,7 @@ import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
* ------------ ---------- ----------- --------------------------
* May 12, 2011 jsanchez Initial creation
* Sep 27, 2012 1149 jsanchez Updated order of actions. Put CON before CAN,EXP
* Apr 18, 2013 1877 jsanchez Ordered by starttime before action to handle updates and initial load of the resource.
* </pre>
*
* @author jsanchez
@ -27,8 +28,8 @@ public class WarningRecordComparator implements
Comparator<AbstractWarningRecord> {
/**
* Compares the WarningRecords by phenSig, ETN, action, then starttime
* (descending order)
* Compares the WarningRecords by phenSig, ETN, starttime (ascending order),
* then action
*/
@Override
public int compare(AbstractWarningRecord wr1, AbstractWarningRecord wr2) {
@ -43,6 +44,11 @@ public class WarningRecordComparator implements
rval = Double.compare(Double.parseDouble(wr1.getEtn()),
Double.parseDouble(wr2.getEtn()));
}
if (rval == 0) {
rval = wr1.getStartTime().compareTo(wr2.getStartTime());
}
if (rval == 0) {
if (wr1.getAct() != null && wr2.getAct() != null) {
WarningAction act1 = WarningAction.valueOf(wr1.getAct());
@ -55,24 +61,15 @@ public class WarningRecordComparator implements
rval = 1;
} else if (act1 == WarningAction.CON
&& (act2 == WarningAction.CAN || act2 == WarningAction.EXP)) {
return -1;
return 1;
} else if (act2 == WarningAction.CON
&& (act1 == WarningAction.CAN || act1 == WarningAction.EXP)) {
return 1;
return -1;
} else {
rval = wr1.getAct().compareTo(wr2.getAct());
}
}
if (rval == 0) {
rval = wr1.getStartTime().compareTo(wr2.getStartTime());
// sort warnings in descending order
if (wr1.getSig() != null) {
if (!wr1.getSig().equals("A")) {
rval *= -1;
}
}
}
}
}
return rval;

View file

@ -58,6 +58,8 @@ import com.vividsolutions.jts.geom.Geometry;
* Jun 04, 2012 DR14992 mgamazaychikov Fix the problem with plotting expiration time for
* NEW warning when CAN warning is issued
* Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class.
* Apr 18, 2013 1877 jsanchez Ordered the records the same for update and initial load.
* Removed no longer needed frameAltered. Do not set wire frame for a CAN.
* </pre>
*
* @author jsanchez
@ -104,6 +106,7 @@ public class WarningsResource extends AbstractWWAResource {
*/
public WarningsResource(WWAResourceData data, LoadProperties props) {
super(data, props);
comparator = new WarningRecordComparator();
resourceName = "Warnings";
}
@ -148,7 +151,7 @@ public class WarningsResource extends AbstractWWAResource {
synchronized (WarningsResource.this) {
{
try {
addRecord(pdo);
addRecord(sort(pdo));
} catch (VizException e) {
statusHandler.handle(Priority.SIGNIFICANT,
e.getLocalizedMessage(), e);
@ -199,14 +202,21 @@ public class WarningsResource extends AbstractWWAResource {
if (wfs != null) {
wfs.dispose();
}
WarningAction act = WarningAction.valueOf(record.getAct());
// Do not paint a wire frame shape for a CAN
if (act != WarningAction.CAN) {
wfs = target.createWireframeShape(false, descriptor);
geo = (Geometry) record.getGeometry().clone();
wfs = target.createWireframeShape(false, descriptor);
geo = (Geometry) record.getGeometry().clone();
JTSCompiler jtsCompiler = new JTSCompiler(null, wfs, descriptor);
jtsCompiler.handle(geo);
wfs.compile();
entry.wireframeShape = wfs;
JTSCompiler jtsCompiler = new JTSCompiler(null, wfs,
descriptor);
jtsCompiler.handle(geo);
wfs.compile();
entry.wireframeShape = wfs;
} else {
// Prevents sampling and a label to be painted
entry.record.setGeometry(null);
}
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
"Error creating wireframe", e);
@ -241,28 +251,18 @@ public class WarningsResource extends AbstractWWAResource {
// changing end time
entry.timeAltered = warnrec.getStartTime()
.getTime();
// prevents the original entry and the modified
// entry to be displayed in the same frame
entry.frameAltered = frames[info
.getFrameIndex()].getRefTime();
// if cancellation, set end time to start time
// of this action
// DR14992: fix the problem with plotting
// expiration time for
// NEW warning when CAN warning is issued
if (act == WarningAction.CAN
&& WarningAction.valueOf(entry.record
.getAct()) == WarningAction.CAN) {
entry.record.setEndTime((Calendar) warnrec
.getStartTime().clone());
}
if (!rec.getCountyheader().equals(
warnrec.getCountyheader())
&& act == WarningAction.CAN) {
entry.partialCancel = true;
// expiration time for NEW warning when CAN
// warning is issued
if (act == WarningAction.CAN) {
if (!rec.getCountyheader().equals(
warnrec.getCountyheader())) {
entry.partialCancel = true;
} else {
// complete cancellation
createShape = warnrec;
}
}
// if it's a con, need to have a new entry for a

View file

@ -0,0 +1,93 @@
/**
* 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;
import java.util.Comparator;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
/**
* Comparator class for SPC watches. The logic for the compare method differs
* from the WarningRecordComparator.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 18, 2013 jsanchez Initial creation
*
* </pre>
*
* @author jsanchez
* @version 1.0
*/
public class WatchesComparator implements Comparator<AbstractWarningRecord> {
/**
* Compares the WarningRecords by phenSig, ETN, action, then starttime
* (ascending order)
*/
@Override
public int compare(AbstractWarningRecord wr1, AbstractWarningRecord wr2) {
int rval = 0;
if (wr1.getPhensig() != null && wr2.getPhensig() != null) {
rval = wr1.getPhensig().compareTo(wr2.getPhensig());
}
if (rval == 0) {
if (wr1.getEtn() != null && wr2.getEtn() != null) {
rval = Double.compare(Double.parseDouble(wr1.getEtn()),
Double.parseDouble(wr2.getEtn()));
}
if (rval == 0) {
if (wr1.getAct() != null && wr2.getAct() != null) {
WarningAction act1 = WarningAction.valueOf(wr1.getAct());
WarningAction act2 = WarningAction.valueOf(wr2.getAct());
if (act1 == act2) {
rval = 0;
} else if (act1 == WarningAction.NEW) {
rval = -1;
} else if (act2 == WarningAction.NEW) {
rval = 1;
} else if (act1 == WarningAction.CON
&& (act2 == WarningAction.CAN || act2 == WarningAction.EXP)) {
return -1;
} else if (act2 == WarningAction.CON
&& (act1 == WarningAction.CAN || act1 == WarningAction.EXP)) {
return 1;
} else {
rval = wr1.getAct().compareTo(wr2.getAct());
}
}
}
if (rval == 0) {
rval = wr1.getStartTime().compareTo(wr2.getStartTime());
}
}
return rval;
}
}

View file

@ -94,6 +94,7 @@ public class WatchesResource extends AbstractWWAResource {
public WatchesResource(WWAResourceData data, LoadProperties props) {
super(data, props);
comparator = new WatchesComparator();
timer = new Timer();
expTaskSet = new HashSet<Long>();
resourceName = "Watches";

0
cave/ohd.hseb.common/externaljars/jdom.jar Executable file → Normal file
View file

0
deltaScripts/13.2.1/fixParameterUnits.sh Normal file → Executable file
View file

Binary file not shown.

View file

@ -1,19 +1,19 @@
##
# 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
# 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
#
# 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.
##

View file

@ -237,7 +237,7 @@ class DGEXForecaster(Forecaster):
t_BL120150, t_BL150180, rh_FHAG2, rh_BL030, rh_BL3060, rh_BL6090,
rh_BL90120, rh_BL120150, rh_BL150180, wind_FHAG10, wind_BL030,
wind_BL3060, wind_BL6090, wind_BL90120, wind_BL120150, wind_BL150180,
p_SFC, PoP, T, RH, sli_MB1000500, stopo, topo, gh_c, t_c, rh_c, wind_c,
p_SFC, PoP, T, RH, sli_MB0500, stopo, topo, gh_c, t_c, rh_c, wind_c,
ctime):
self.setupBLCube(t_FHAG2, t_BL030, t_BL3060, t_BL6090, t_BL90120,
t_BL120150, t_BL150180, rh_FHAG2, rh_BL030, rh_BL3060, rh_BL6090,
@ -374,17 +374,17 @@ class DGEXForecaster(Forecaster):
#
# Where LI<2, make showers
#
sli_MB1000500=where(less(sli_MB1000500,-18.0),10.0,sli_MB1000500)
sli_MB0500=where(less(sli_MB0500,-18.0),10.0,sli_MB0500)
convecMask = less(sli_MB1000500, 2)
convecMask = less(sli_MB0500, 2)
wx=where(convecMask,wx+6,wx)
#
# off the DGEX gridpoints need no weather
#
wxgrid = zeros(self._empty.shape, dtype = byte)
keys = ['<NoCov>:<NoWx>:<NoInten>:<NoVis>:', ]
# wxgrid=where(less(sli_MB1000500,-18.0),0,wxgrid)
wxgrid[less(sli_MB1000500, -18.0)] = 0
# wxgrid=where(less(sli_MB0500,-18.0),0,wxgrid)
wxgrid[less(sli_MB0500, -18.0)] = 0
#
# Match PoP, and remove non-occurring wx
#
@ -439,13 +439,13 @@ class DGEXForecaster(Forecaster):
# the instability. SChc for LI <-1, Chc for LI<-3,
# Lkly for LI<-5, Def for LI<-8
#
thunder = where(less_equal(sli_MB1000500, -1), 1, 0)
# thunder=where(less_equal(sli_MB1000500,-3),2,thunder)
# thunder=where(less_equal(sli_MB1000500,-5),3,thunder)
# thunder=where(less_equal(sli_MB1000500,-8),4,thunder)
thunder[less_equal(sli_MB1000500, -3)] = 2
thunder[less_equal(sli_MB1000500, -5)] = 3
thunder[less_equal(sli_MB1000500, -8)] = 4
thunder = where(less_equal(sli_MB0500, -1), 1, 0)
# thunder=where(less_equal(sli_MB0500,-3),2,thunder)
# thunder=where(less_equal(sli_MB0500,-5),3,thunder)
# thunder=where(less_equal(sli_MB0500,-8),4,thunder)
thunder[less_equal(sli_MB0500, -3)] = 2
thunder[less_equal(sli_MB0500, -5)] = 3
thunder[less_equal(sli_MB0500, -8)] = 4
tprobs = ["None", "SChc", "Chc", "Lkly", "Def"]
for ith in range(1, 5):
@ -992,7 +992,7 @@ class DGEXForecaster(Forecaster):
t_BL120150, t_BL150180, rh_FHAG2, rh_BL030, rh_BL3060, rh_BL6090,
rh_BL90120, rh_BL120150, rh_BL150180, wind_FHAG10, wind_BL030,
wind_BL3060, wind_BL6090, wind_BL90120, wind_BL120150, wind_BL150180,
p_SFC, sli_MB1000500, tp_SFC, stopo, topo, gh_c, t_c, rh_c, wind_c, ctime):
p_SFC, sli_MB0500, tp_SFC, stopo, topo, gh_c, t_c, rh_c, wind_c, ctime):
self.setupBLCube(t_FHAG2, t_BL030, t_BL3060, t_BL6090, t_BL90120,
t_BL120150, t_BL150180, rh_FHAG2, rh_BL030, rh_BL3060, rh_BL6090,
rh_BL90120, rh_BL120150, rh_BL150180, wind_FHAG10, wind_BL030,
@ -1004,9 +1004,9 @@ class DGEXForecaster(Forecaster):
# only thing we have is boundary layer lifted index
# set LAL to 2 if LI<0, 3 if LI<-3, 4 if LI<-5
#
lal=where(less(sli_MB1000500, 0), lal+1, lal)
lal=where(less(sli_MB1000500, -3), lal+1, lal)
lal=where(less(sli_MB1000500, -5), lal+1, lal)
lal=where(less(sli_MB0500, 0), lal+1, lal)
lal=where(less(sli_MB0500, -3), lal+1, lal)
lal=where(less(sli_MB0500, -5), lal+1, lal)
#
# Add more when RH at top of BL is greater than
# than 70% and RH at bottom of BL is less than 30
@ -1019,7 +1019,7 @@ class DGEXForecaster(Forecaster):
#
V = logical_and(greater(BLR[5], 80), less(BLR[0], 20))
lal=where(V,lal+1,lal)
lal=where(less(sli_MB1000500,-18.0),1,lal)
lal=where(less(sli_MB0500,-18.0),1,lal)
return lal
#---------------------------------------------------------------------------

View file

@ -59,7 +59,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* 20080221 862 jkorman Initial Coding.
* 02/06/09 1990 bphillip removed populateDataStore method
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
* Mar 02, 2013 1970 bgonzale Removed Table annotation, changed from Entity
* May 02, 2013 1970 bgonzale Removed Table annotation, changed from Entity
* annotation to MappedSuperClass.
*
* </pre>

View file

@ -421,12 +421,13 @@ public class D2DGridDatabase extends VGridDatabase {
}
}
String d2dParmName = getD2DParmName(atts.getShort_name());
String gfeParmName = atts.getShort_name();
String d2dParmName = getD2DParmName(gfeParmName);
D2DParm d2dParm = new D2DParm(pid, gpi, possibleInventorySlots,
d2dParmName);
this.gfeParms.put(pid, d2dParm);
this.d2dParms.put(compositeName(atts.getShort_name(), level), d2dParm);
this.d2dParms.put(compositeName(gfeParmName, level), d2dParm);
}
/**
@ -464,14 +465,17 @@ public class D2DGridDatabase extends VGridDatabase {
availableTimes.get(i));
}
String uD2dParmName = getD2DParmName(uatts.getShort_name());
String vD2dParmName = getD2DParmName(vatts.getShort_name());
String uGfeParmName = uatts.getShort_name();
String uD2dParmName = getD2DParmName(uGfeParmName);
String vGfeParmName = vatts.getShort_name();
String vD2dParmName = getD2DParmName(vGfeParmName);
D2DParm d2dParm = new D2DParm(pid, gpi, possibleInventorySlots,
uD2dParmName, vD2dParmName);
this.gfeParms.put(pid, d2dParm);
this.d2dParms.put(compositeName(uatts.getShort_name(), level), d2dParm);
this.d2dParms.put(compositeName(vatts.getShort_name(), level), d2dParm);
this.d2dParms.put(compositeName(uGfeParmName, level), d2dParm);
this.d2dParms.put(compositeName(vGfeParmName, level), d2dParm);
}
/**

View file

@ -187,7 +187,7 @@ public class GfeIngestNotificationFilter {
String otherComponent = null;
String[] components = parm.getComponents();
if (components.length > 1) {
if (components[0].equals(gfeParamName)) {
if (components[0].equals(d2dParamName)) {
otherComponent = components[1];
} else {
otherComponent = components[0];
@ -207,7 +207,7 @@ public class GfeIngestNotificationFilter {
if (otherTimes == null
|| !otherTimes.remove(fcstHour)) {
// need to wait for other component
ParmID compPid = new ParmID(gfeParamName,
ParmID compPid = new ParmID(d2dParamName,
parmID.getDbId(), parmID.getParmLevel());
Set<Integer> times = windComps.get(compPid);
if (times == null) {

View file

@ -249,13 +249,13 @@
<Level key="FHAG4000">
<DatabaseLevel levelName="FHAG" levelOneValue="4000.0" unit="m"/>
</Level>
<Level key="FHAG030">
<DatabaseLevel levelName="FHAG" levelOneValue="0.0" levelTwoValue="30.0" unit="m"/>
<Level key="FHAG01000">
<DatabaseLevel levelName="FHAG" levelOneValue="0.0" levelTwoValue="1000.0" unit="m"/>
</Level>
<Level key="FHAG3000">
<Level key="FHAG03000">
<DatabaseLevel levelName="FHAG" levelOneValue="0.0" levelTwoValue="3000.0" unit="m"/>
</Level>
<Level key="FHAG6000">
<Level key="FHAG06000">
<DatabaseLevel levelName="FHAG" levelOneValue="0.0" levelTwoValue="6000.0" unit="m"/>
</Level>
<Level key="FRZ">
@ -399,9 +399,6 @@
<Level key="MB1100">
<DatabaseLevel levelName="MB" levelOneValue="1100.0" unit="hPa"/>
</Level>
<Level key="MB50100">
<DatabaseLevel levelName="MB" levelOneValue="1000.0" levelTwoValue="500.0" unit="hPa"/>
</Level>
<Level key="MB0500">
<DatabaseLevel levelName="MB" levelOneValue="1000.0" levelTwoValue="500.0" unit="hPa"/>
</Level>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -46,7 +46,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -417,7 +417,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -592,7 +592,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 6000</levelsDesc>
<levels>
<level>FHAG6000</level>
<level>FHAG06000</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -1,4 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
REVISION HISTORY
Date Ticket# Engineer Description
04/17/2013 #1913 randerso Corrected heli level
-->
<gridParamInfo xmlns:ns2="group">
<valtimeMINUSreftime>
<fcst>0</fcst>
@ -154,9 +160,9 @@
<valid_range>1000.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>0</n3D>
<levelsDesc>FHAG 0&gt;30</levelsDesc>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG030</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">

View file

@ -1,4 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
REVISION HISTORY
Date Ticket# Engineer Description
04/17/2013 #1913 randerso Corrected heli level
-->
<gridParamInfo xmlns:ns2="group">
<valtimeMINUSreftime>
<fcst>0</fcst>
@ -154,9 +160,9 @@
<valid_range>1000.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>0</n3D>
<levelsDesc>FHAG 0&gt;30</levelsDesc>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG030</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">

View file

@ -58,7 +58,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">

View file

@ -58,7 +58,7 @@
<n3D>0</n3D>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG3000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">

View file

@ -1,4 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
REVISION HISTORY
Date Ticket# Engineer Description
04/17/2013 #1913 randerso Corrected heli level
-->
<gridParamInfo xmlns:ns2="group">
<valtimeMINUSreftime>
<fcst>0</fcst>
@ -56,9 +62,9 @@
<valid_range>1000.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>0</n3D>
<levelsDesc>FHAG 0&gt;30</levelsDesc>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG030</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">

View file

@ -1,4 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
REVISION HISTORY
Date Ticket# Engineer Description
04/17/2013 #1913 randerso Corrected heli level
-->
<gridParamInfo xmlns:ns2="group">
<valtimeMINUSreftime>
<fcst>0</fcst>
@ -138,9 +144,9 @@
<valid_range>1000.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>0</n3D>
<levelsDesc>FHAG 0&gt;30</levelsDesc>
<levelsDesc>FHAG 3000</levelsDesc>
<levels>
<level>FHAG030</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
@ -363,9 +369,9 @@
<valid_range>20.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>0</n3D>
<levelsDesc>MB 50&gt;100</levelsDesc>
<levelsDesc>MB 0&gt;500</levelsDesc>
<levels>
<level>MB50100</level>
<level>MB0500</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -49,9 +49,10 @@
<valid_range>1000.0</valid_range>
<fillValue>-99999.0</fillValue>
<n3D>0</n3D>
<levelsDesc>SFC</levelsDesc>
<levelsDesc>FHAG 1000 FHAG 3000</levelsDesc>
<levels>
<level>SFC</level>
<level>FHAG01000</level>
<level>FHAG03000</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">

View file

@ -37,11 +37,11 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
/**
* Implementation of a colormap
*
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 5, 2007 chammack Initial Creation.
@ -50,9 +50,10 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
* Aug 20, 2008 dglazesk Added some interface pieces to make this more
* usable
* Jan 10, 2013 15648 ryu Added removeDuplicates() method.
*
* Apr 18, 2013 1920 mpduff Default changed to true.
*
* </pre>
*
*
* @author chammack
* @version 1
*/
@ -67,7 +68,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
private Buffer glBuffer;
private boolean changed = false;
private boolean changed = true;
/**
* Constructor used by JiBX
@ -97,7 +98,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
/**
* Creates a ColorMap using name and the list of colors in map.
*
*
* @param name
* Name for the new ColorMap
* @param map
@ -107,12 +108,11 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
this.name = name;
colors = new ArrayList<Color>();
colors.addAll(map.getColors());
this.changed = true;
}
/**
* Do not instantiate directly, use GLTarget methods
*
*
* @param name
* @param red
* @param green
@ -139,9 +139,10 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
/*
* (non-Javadoc)
*
*
* @see com.raytheon.uf.common.colormap.IColorMap#getBlue()
*/
@Override
public float[] getBlue() {
int colorNum = colors.size();
float[] blues = new float[colorNum];
@ -153,9 +154,10 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
/*
* (non-Javadoc)
*
*
* @see com.raytheon.uf.common.colormap.IColorMap#getGreen()
*/
@Override
public float[] getGreen() {
int colorNum = colors.size();
float[] greens = new float[colorNum];
@ -167,9 +169,10 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
/*
* (non-Javadoc)
*
*
* @see com.raytheon.uf.common.colormap.IColorMap#getRed()
*/
@Override
public float[] getRed() {
int colorNum = colors.size();
float[] reds = new float[colorNum];
@ -181,18 +184,20 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
/*
* (non-Javadoc)
*
*
* @see com.raytheon.uf.common.colormap.IColorMap#getSize()
*/
@Override
public int getSize() {
return colors.size();
}
/*
* (non-Javadoc)
*
*
* @see com.raytheon.uf.common.colormap.IColorMap#getAlpha()
*/
@Override
public float[] getAlpha() {
int colorNum = colors.size();
float[] alphas = new float[colorNum];
@ -204,7 +209,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
/**
* Return the buffer representation of the colormap
*
*
* @return the colorMap buffer
*/
public synchronized Buffer getColorMap() {
@ -233,20 +238,22 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
/*
* (non-Javadoc)
*
*
* @see com.raytheon.edex.colormap.IColorMap#getName()
*/
@Override
public String getName() {
return name;
}
@Override
public List<Color> getColors() {
return colors;
}
/*
* (non-Javadoc)
*
*
* @see java.lang.Object#toString()
*/
@Override
@ -254,10 +261,12 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
return "COLORMAP { " + getName() + " }";
}
@Override
public boolean isChanged() {
return changed;
}
@Override
public void setAlpha(float[] anAlpha) {
int size = anAlpha.length;
for (int i = 0; i < size; ++i) {
@ -270,6 +279,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
changed = true;
}
@Override
public void setBlue(float[] aBlue) {
int size = aBlue.length;
for (int i = 0; i < size; ++i) {
@ -282,6 +292,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
changed = true;
}
@Override
public void setGreen(float[] aGreen) {
int size = aGreen.length;
for (int i = 0; i < size; ++i) {
@ -294,6 +305,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
changed = true;
}
@Override
public void setRed(float[] aRed) {
int size = aRed.length;
for (int i = 0; i < size; ++i) {
@ -310,10 +322,12 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
this.colors.set(index, color);
}
@Override
public void setChanged(boolean aChanged) {
changed = aChanged;
}
@Override
public void setName(String aName) {
name = aName;
changed = true;
@ -329,7 +343,7 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
* wavelength to the maximum wavelength. If the reverse flag is set, then a
* reverse spectrum is generated. The red, green, and blue indexes are
* returned through the calling arguments.
*
*
* @param numOfColors
* @param minWaveLength
* @param maxWaveLength
@ -416,10 +430,10 @@ public class ColorMap extends AbstractColorMap implements ISerializableObject {
public void removeDuplicates() {
List<Color> colors = new ArrayList<Color>();
Color current = null;
for (Color color: this.colors) {
for (Color color : this.colors) {
if (!color.equals(current)) {
colors.add(color);
current = color;
colors.add(color);
current = color;
}
}

View file

@ -31,6 +31,7 @@ import javax.persistence.Transient;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.time.util.ImmutableDate;
/**
* FFMP basin/aggregated value holder

View file

@ -22,6 +22,7 @@ import com.raytheon.uf.common.dataquery.requests.RequestableMetadataMarshaller;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 29, 2012 #14691 Qinglu Lin Added feAreaField and its getter and setter, etc.
* Apr 24, 2014 1943 jsanchez Removed unused areaType.
*
* </pre>
*
@ -39,13 +40,6 @@ public class AreaSourceConfiguration {
@XmlElement
private AreaType type = AreaType.HATCHING;
/*
* TODO This is for 12.9 to be backwards compatible. This will be removed in
* 12.10
*/
@XmlElement
private AreaType areaType;
@XmlAttribute
private String variable;
@ -277,12 +271,4 @@ public class AreaSourceConfiguration {
this.type = type;
}
public AreaType getAreaType() {
return areaType;
}
public void setAreaType(AreaType areaType) {
this.areaType = areaType;
}
}

View file

@ -59,6 +59,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* Nov 21, 2007 chammack Initial Creation.
* Aug 26, 2008 #1502 bclement Added JAXB annotations
* May 26, 2010 #4649 Qinglu Lin Made including TO.A and SV.A mandatory
* Apr 24, 2013 1943 jsanchez Marked areaConfig as Deprecated.
*
* </pre>
*
@ -83,6 +84,7 @@ public class WarngenConfiguration implements ISerializableObject {
private AreaSourceConfiguration hatchedAreaSource;
@XmlElement
@Deprecated
private AreaConfiguration areaConfig;
@XmlElementWrapper(name = "bulletActionGroups")
@ -201,8 +203,8 @@ public class WarngenConfiguration implements ISerializableObject {
}
}
// TODO This section is for 12.9 to be backwards compatible with old
// configuration files. 12.10 will drop the use of 'areaConfig'.
// AreaConfiguration is deprecated. This is only meant for backwards
// compatibility while areaConfig is phased out with updated templates from the template team.
if (config.getAreaConfig() != null) {
ArrayList<AreaSourceConfiguration> areaSources = null;
@ -217,18 +219,12 @@ public class WarngenConfiguration implements ISerializableObject {
config.setAreaSources(areaSources
.toArray(new AreaSourceConfiguration[areaSources.size()]));
}
// 12.9 section end
for (AreaSourceConfiguration asc : config.getAreaSources()) {
if (asc.getAreaSource() == null) {
asc.setAreaSource(config.getGeospatialConfig().getAreaSource());
}
// 12.9. 12.10 get rid of 'areaType'
if (asc.getAreaType() != null) {
asc.setType(asc.getAreaType());
}
if (asc.getType() == AreaType.HATCHING) {
config.setHatchedAreaSource(asc);
}
@ -252,8 +248,12 @@ public class WarngenConfiguration implements ISerializableObject {
}
/**
* This method is depreciated. Please use AreaSourceConfiguration. The type
* AreaType.HATCHING will determine which area source is for hatching.
*
* @return the areaConfig
*/
@Deprecated
public AreaConfiguration getAreaConfig() {
return areaConfig;
}
@ -262,6 +262,7 @@ public class WarngenConfiguration implements ISerializableObject {
* @param areaConfig
* the areaConfig to set
*/
@Deprecated
public void setAreaConfig(AreaConfiguration areaConfig) {
this.areaConfig = areaConfig;
}

View file

@ -23,6 +23,7 @@ import java.awt.Point;
import java.util.Arrays;
import java.util.LinkedHashSet;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -39,6 +40,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 27, 2009 chammack Initial creation
* Jun 18, 2013 DR 15662 dhuffman Cross section terrain disappears if baseline is too short.
*
* </pre>
*
@ -91,9 +93,26 @@ public class Request implements ISerializableObject {
Request request = new Request();
request.type = Type.POINT;
request.points = new LinkedHashSet<Point>(Arrays.asList(points))
.toArray(new Point[points.length]);
.toArray(new Point[points.length]);
return request;
}
/**
* Build a request that asks for specific cross points to be returned
*
* @param points
* @return
*/
public static Request buildXsectPointRequest(Point... points) {
Request request = new Request();
request.type = Type.POINT;
request.points = new Point[points.length];
for(int x=0; x<points.length; x++)
request.points[x] = new Point(points[x]);
return request;
}
/**
* Build a request that asks for all x values at a provided set of y values.

View file

@ -29,10 +29,8 @@ import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.status.UFStatus;
@ -51,8 +49,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 23, 2011 mschenke Initial creation
*
* Jun 23, 2011 mschenke Initial creation
* Apr 12, 2013 1903 rjpeter Fix allocateLock freezing out other lock requests.
* </pre>
*
* @author mschenke
@ -64,14 +62,26 @@ public class FileLocker {
private static class LockWaiter {
}
private static enum LockState {
ACQUIRING, IN_USE, RELEASED
}
private static class LockedFile {
Type lockType;
final Type lockType;
Thread lockingThread;
final Thread lockingThread;
Set<Object> lockers = new HashSet<Object>();
final List<Object> lockers = new ArrayList<Object>();
File lockFile;
LockState lockState = LockState.ACQUIRING;
LockedFile(Thread thread, Type type, Object locker) {
lockType = type;
lockingThread = thread;
lockers.add(locker);
}
}
public static enum Type {
@ -81,10 +91,10 @@ public class FileLocker {
private static final int MAX_WAIT = 30 * 1000;
/** Map of waiters on threads */
private Map<File, Deque<LockWaiter>> waiters = new HashMap<File, Deque<LockWaiter>>();
private final Map<File, Deque<LockWaiter>> waiters = new HashMap<File, Deque<LockWaiter>>();
/** Map of locks we have on files */
private Map<File, LockedFile> locks = new HashMap<File, LockedFile>();
private final Map<File, LockedFile> locks = new HashMap<File, LockedFile>();
/** Singleton instance of FileLocker class */
private static FileLocker instance = new FileLocker();
@ -181,22 +191,27 @@ public class FileLocker {
synchronized (locks) {
lock = locks.get(file);
if (lock == null) {
lock = new LockedFile();
lock = new LockedFile(myThread, type, locker);
locks.put(file, lock);
grabbedLock = true;
}
}
synchronized (lock) {
if (grabbedLock) {
// We were able to grab the lock file ourselves
return allocateLock(locker, file, type, myThread, lock);
} else if (lock.lockingThread == myThread
|| (type == lock.lockType && type == Type.READ)) {
// Locked on same thread to avoid indefinite waiting. If
// there are issues on how locked, they will be known
lock.lockers.add(locker);
return true;
if (grabbedLock) {
// We were able to grab the lock file ourselves
return allocateLock(file, lock);
} else {
synchronized (lock) {
// if the lock file has been obtained and either the thread is
// the same as the one that obtained the lock or the original
// lock and this request are both read locks
if ((lock.lockState == LockState.IN_USE)
&& ((lock.lockingThread == myThread) || ((type == Type.READ) && (type == lock.lockType)))) {
// TODO: This is not safe as another thread could have a
// read lock and we may clobber the read
lock.lockers.add(locker);
return true;
}
}
}
@ -216,83 +231,121 @@ public class FileLocker {
lws.add(waiter);
}
while (true) {
// Sleep
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// Ignore
}
boolean waiterRemoved = false;
grabbedLock = false;
synchronized (locks) {
lock = locks.get(file);
if (lock == null) {
// File ready for grabbing
synchronized (lws) {
if (lws.peek() == waiter) {
lws.poll();
lock = new LockedFile();
locks.put(file, lock);
grabbedLock = true;
try {
while (true) {
// Sleep
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// Ignore
}
grabbedLock = false;
synchronized (locks) {
lock = locks.get(file);
if (lock == null) {
// File ready for grabbing
synchronized (lws) {
if (lws.peek() == waiter) {
lws.poll();
waiterRemoved = true;
lock = new LockedFile(myThread, type,
locker);
locks.put(file, lock);
grabbedLock = true;
}
}
}
} else if (lock.lockFile != null) {
}
if (grabbedLock) {
// We were able to grab the lock file ourselves
return allocateLock(file, lock);
} else if (lock != null) {
synchronized (lock) {
if ((System.currentTimeMillis() - lock.lockFile
.lastModified()) > MAX_WAIT) {
System.err
.println("Releasing lock since: "
+ "Lock has been allocated for more than "
+ (MAX_WAIT / 1000) + "s");
locks.remove(file);
switch (lock.lockState) {
case IN_USE:
if ((type == Type.READ)
&& (type == lock.lockType)) {
// A different waiter grabbed it for
// reading, we can read it also
lock.lockers.add(locker);
return true;
} else {
long curTime = System.currentTimeMillis();
long lastMod = lock.lockFile.lastModified();
if ((curTime - lastMod) > MAX_WAIT) {
System.err
.println("Releasing lock: "
+ "Lock has been allocated for "
+ ((curTime - lastMod) / 1000)
+ "s on file "
+ file.getPath());
locks.remove(file);
}
}
break;
// ACUIRING - NOOP wait for lock to be acquired
// RELEASED - loop again and check if next waiter
}
}
}
}
if (grabbedLock) {
// We were able to grab the lock file ourselves
allocateLock(locker, file, type, myThread, lock);
return true;
} finally {
if (!waiterRemoved) {
synchronized (lws) {
lws.remove(waiter);
}
}
}
}
return false;
}
private void unlockInternal(Object locker, File file) {
try {
boolean fileUnlocked = false;
LockedFile lock = null;
// Get the Lock
synchronized (locks) {
lock = locks.get(file);
// Return early if we never locked or have already been
// unlocked
if (lock == null
|| (locker != null && lock.lockers.contains(locker) == false)) {
// Return early if we have never locked
if ((lock == null) || (locker == null)) {
return;
}
}
// Lock has locker and is not null
synchronized (lock) {
lock.lockers.remove(locker);
if (lock.lockers.size() == 0) {
// No more lockers, remove lock and release
locks.remove(file);
unallocateLock(lock);
if (lock.lockState == LockState.IN_USE) {
lock.lockers.remove(locker);
if (lock.lockers.isEmpty()) {
// No more lockers, remove lock and release
lock.lockState = LockState.RELEASED;
unallocateLock(lock);
fileUnlocked = true;
}
}
}
// Check for waiters on the file
synchronized (waiters) {
Deque<LockWaiter> lws = waiters.get(file);
if (lws == null) {
waiters.remove(file);
} else {
synchronized (lws) {
if (lws.size() == 0) {
waiters.remove(file);
if (fileUnlocked) {
synchronized (locks) {
locks.remove(file);
}
// Check for waiters on the file
synchronized (waiters) {
Deque<LockWaiter> lws = waiters.get(file);
if (lws == null) {
waiters.remove(file);
} else {
synchronized (lws) {
if (lws.isEmpty()) {
waiters.remove(file);
}
}
}
}
@ -307,20 +360,13 @@ public class FileLocker {
* Function to actually allocate the lock, this needs to be cross process
* aware and wait until other processes are finished with the file
*
* @param locker
* @param file
* @param type
* @param thread
* @param lock
* @return
* @throws FileNotFoundException
* @throws IOException
*/
private boolean allocateLock(Object locker, File file, Type type,
Thread thread, LockedFile lock) {
// Set tht thread of the lock and add lock allocator
lock.lockingThread = Thread.currentThread();
lock.lockers.add(locker);
private boolean allocateLock(File file, LockedFile lock) {
// Get the lock directory, make sure it is not already taken
File parentDir = file.getParentFile();
@ -333,23 +379,40 @@ public class FileLocker {
boolean gotLock = false;
File lockFile = new File(parentDir, "." + file.getName() + "_LOCK");
try {
long waitInterval = 500;
long tryCount = MAX_WAIT / waitInterval;
// start with a moderate wait
long waitInterval = 100;
long curTime = System.currentTimeMillis();
long maxWaitTime = curTime + MAX_WAIT;
long fileTime;
for (int i = 0; !gotLock && i < tryCount; ++i) {
while ((curTime = System.currentTimeMillis()) < maxWaitTime) {
gotLock = lockFile.createNewFile()
|| ((fileTime = lockFile.lastModified()) > 0 && (System
.currentTimeMillis() - fileTime) > MAX_WAIT);
if (!gotLock) {
|| (((fileTime = lockFile.lastModified()) > 0) && ((curTime - fileTime) > MAX_WAIT));
if (gotLock) {
break;
} else {
try {
Thread.sleep(waitInterval);
} catch (InterruptedException e) {
// Ignore
}
// every wait reduces the next wait down to minimum wait of
// 10 milliseconds
if (waitInterval > 10) {
waitInterval -= 10;
}
}
}
} catch (IOException e) {
e.printStackTrace();
UFStatus.getHandler().handle(Priority.PROBLEM,
"Error obtaining file lock: " + file, e);
} finally {
synchronized (lock) {
lock.lockFile = lockFile;
lock.lockFile.setLastModified(System.currentTimeMillis());
lock.lockState = LockState.IN_USE;
}
}
if (!gotLock) {
@ -357,14 +420,14 @@ public class FileLocker {
+ ", returning anyway");
Thread.dumpStack();
}
lockFile.setLastModified(System.currentTimeMillis());
lock.lockFile = lockFile;
return gotLock;
}
private void unallocateLock(LockedFile lock) throws IOException {
if (lock.lockFile != null) {
lock.lockFile.delete();
lock.lockFile = null;
}
}
@ -381,8 +444,8 @@ public class FileLocker {
String arg = args[i];
if (arg.startsWith("-")) {
// we have a key
if (args.length > (i + 1)
&& args[i + 1].startsWith("-") == false) {
if ((args.length > (i + 1))
&& (args[i + 1].startsWith("-") == false)) {
argumentMap.put(arg.substring(1), args[i + 1]);
++i;
} else {
@ -398,12 +461,13 @@ public class FileLocker {
String fileToLock = argumentMap.get("f");
String threads = argumentMap.get("tc");
final boolean verbose = argumentMap.get("v") != null;
final boolean verboseCount = argumentMap.get("vc") != null || verbose;
final boolean verboseErrors = argumentMap.get("ve") != null || verbose;
final boolean verboseCount = (argumentMap.get("vc") != null) || verbose;
final boolean verboseErrors = (argumentMap.get("ve") != null)
|| verbose;
String outputAtCount = argumentMap.get("c");
String iterVal = argumentMap.get("i");
if (fileToLock == null || argumentMap.get("help") != null) {
if ((fileToLock == null) || (argumentMap.get("help") != null)) {
System.out.println("Required argument -f <pathToFile>"
+ " specifies the file to use in the program");
System.out.println("-help prints out this help message");
@ -458,6 +522,7 @@ public class FileLocker {
final int[] errors = new int[1];
final File toLock = new File(fileToLock);
List<Runnable> runnables = new ArrayList<Runnable>(threadCount);
final Object lockObj = new Object();
final int[] i = { 0 };
for (int j = 1; j <= threadCount; ++j) {
@ -474,8 +539,8 @@ public class FileLocker {
System.out.flush();
}
threadArgs = "rw";
} else if (threadArgs.contains("r") == false
&& threadArgs.contains("w") == false) {
} else if ((threadArgs.contains("r") == false)
&& (threadArgs.contains("w") == false)) {
System.err.println("Error parsing thread " + j + " arguments ("
+ threadArgs + "), defaulting to rw");
System.err.flush();
@ -496,7 +561,7 @@ public class FileLocker {
@Override
public void run() {
try {
if (FileLocker.lock(this, toLock, write ? Type.WRITE
if (FileLocker.lock(lockObj, toLock, write ? Type.WRITE
: Type.READ)) {
boolean canRead = true;
if (toLock.exists() == false) {
@ -578,7 +643,7 @@ public class FileLocker {
t.printStackTrace();
}
} finally {
FileLocker.unlock(this, toLock);
FileLocker.unlock(lockObj, toLock);
}
}
});
@ -586,7 +651,7 @@ public class FileLocker {
int totalErrors = 0;
int count = 0;
while (iterations == null || i[0] < iterations) {
while ((iterations == null) || (i[0] < iterations)) {
List<Thread> threadList = new ArrayList<Thread>(threadCount);
for (Runnable r : runnables) {
threadList.add(new Thread(r));
@ -610,7 +675,8 @@ public class FileLocker {
++count;
// Output at -c val if we are verbose or indefinitely looping
if (count == outputCountAt && (verboseCount || iterations == null)) {
if ((count == outputCountAt)
&& (verboseCount || (iterations == null))) {
PrintStream out = errors[0] > 0 ? System.err : System.out;
out.println("Completed " + count + " iterations with "
+ errors[0] + " errors");
@ -621,7 +687,7 @@ public class FileLocker {
}
}
if (i[0] % outputCountAt != 0 || !verboseCount) {
if ((i[0] % outputCountAt != 0) || !verboseCount) {
totalErrors += errors[0];
PrintStream out = totalErrors > 0 ? System.err : System.out;
out.println("Completed " + i[0] + " iterations with " + totalErrors

View file

@ -83,6 +83,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* localization performance but caused updated
* files on the server not to be retrieved.
* Jan 17, 2013 1412 djohnson Add jaxbMarshal.
* Apr 12, 2013 1903 rjpeter Updated getFile to check parentFile for existence.
* </pre>
*
* @author njensen
@ -283,7 +284,7 @@ public final class LocalizationFile implements Comparable<LocalizationFile> {
adapter.retrieve(this);
}
if ((isDirectory == false) && !file.exists()) {
if ((isDirectory == false) && !file.getParentFile().exists()) {
try {
file.getParentFile().mkdirs();
} catch (Throwable t) {
@ -647,7 +648,8 @@ public final class LocalizationFile implements Comparable<LocalizationFile> {
* @param jaxbManager
* the jaxbManager
*/
public void jaxbMarshal(Object obj, JAXBManager jaxbManager) throws LocalizationException{
public void jaxbMarshal(Object obj, JAXBManager jaxbManager)
throws LocalizationException {
try {
String xml = jaxbManager.marshalToXml(obj);
write(xml.getBytes());

View file

@ -40,6 +40,7 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.hibernate.annotations.Index;
import org.hibernate.annotations.Type;
import com.raytheon.uf.common.serialization.ISerializableObject;
@ -344,6 +345,7 @@ public class DataTime implements Comparable<DataTime>, Serializable,
/**
* @return the refTime
*/
@Index(name = "refTimeIndex")
public Date getRefTime() {
return this.refTime;
}
@ -360,6 +362,7 @@ public class DataTime implements Comparable<DataTime>, Serializable,
/**
* @return the fcstTime
*/
@Index(name = "fcstTimeIndex")
public int getFcstTime() {
return fcstTime;
}

View file

@ -51,7 +51,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.edex.core.props.PropertiesFactory;
import com.raytheon.uf.edex.dat.utils.FreezingLevel;
import com.vividsolutions.jts.geom.Coordinate;
@ -65,6 +64,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Nov 19, 2011 dhladky Initial Creation.
* Oct 09, 2012 15168 wkwock Fix incorrect values.
* Jan 10, 2013 1448 bgonzale Made methods that are used internally private.
* Apr 17, 2013 15914 snaples Updated constructor to check for and
* create stationFilePath directory if not found.
*
* </pre>
*
@ -96,6 +97,15 @@ public class MpeRUCFreezingLevel {
public static String[] models = new String[] { "RUC236" };
public MpeRUCFreezingLevel() {
// DR 15914
// make sure directory exists, if not make directory before
// opening file.
File pn = new File(stationFilePath);
if (pn.exists() == false) {
pn.mkdir();
}
pn = null;
this.stationFile = new File(stationFilePath+"/"+mpeSiteId+"_freezing_station_list");
// correct env vairiable dqcPreprocessorBasetime if needed. Default to 12z

View file

@ -97,6 +97,7 @@ import com.vividsolutions.jts.geom.Polygon;
* 10/25/12 DR 15514 G. Zhang Fix ConcurrentModificationException
* 02/01/13 1569 D. Hladky Added constants
* 02/25/13 1660 D. Hladky FFTI design change to help mosaic processing.
* 05/01/2013 15684 zhao Unlock when Exception caught
* </pre>
*
* @author dhladky
@ -363,13 +364,23 @@ public class FFMPProcessor {
.getRawGeometries(dataKey,
domain.getCwa());
}
sbl = (new RadarSBLGenerator(config)
.generate(sourceId,
map.keySet(),
cwaGeometries, radarRec));
generator.setSourceBinList(sbl);
isSBL = true;
//DR15684
try {
sbl = (new RadarSBLGenerator(config)
.generate(sourceId,
map.keySet(),
cwaGeometries, radarRec));
} catch (Exception e) {
statusHandler.handle(Priority.WARN, "caught an Exception while generating Source Bin List");
e.printStackTrace();
if (!checkLockStatus()) {
ClusterLockUtils.unlock(sourceBinTaskName, sourceId);
}
}
if (sbl != null) {
generator.setSourceBinList(sbl);
isSBL = true;
}
} else {
continue;

View file

@ -65,6 +65,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import com.vividsolutions.jts.geom.TopologyException;
/**
* Creates a SourceBinList for given radar and set of basins.
@ -75,6 +76,7 @@ import com.vividsolutions.jts.geom.Polygon;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 6, 2011 10593 dfriedma Initial creation
* May 1, 2013 15684 zhao Add code to handle possible TopologyException
*
* </pre>
*
@ -227,7 +229,15 @@ public class RadarSBLGenerator {
if (i >= 0 && i < searchGridLen && j >= 0 && j < searchGridLen) {
for (Long pfaf : searchGrid[j * searchGridLen + i]) {
Geometry geom = xformedBasinMap.get(pfaf);
if (geom.contains(p)) {
//DR15684
boolean geomContainsPointP = false;
try {
geomContainsPointP = geom.contains(p);
} catch (TopologyException e) {
logger.warn(String.format("RadarSBLGenerator: caught a TopologyException: %s", e.getMessage()));
throw e;
}
if (geomContainsPointP) {
//lastPfaf = pfaf;
lastBasinGeometry = geom;
lastSBEL = sbeMap.get(pfaf);

View file

@ -89,6 +89,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* 03/09/2012 DR 14581 D. Friedman Fix grid referencing and use custom
* nearest-neighbor resampling.i
* 01/14/2013 #1469 bkowal Removed the hdf5 data directory.
* 04/18/2013 DR 15662 dhuffman Cross section terrain disappears if baseline is too short.
*
* </pre>
*
@ -313,7 +314,7 @@ public class TopoQuery implements ITopoQuery {
index += 2;
}
Request request = Request.buildPointRequest(points);
Request request = Request.buildXsectPointRequest(points);
ShortDataRecord record = (ShortDataRecord) dataStore.retrieve("/",
"full", request);
short[] data = record.getShortData();

0
edexOsgi/com.raytheon.uf.tools.cli/impl/textdb Executable file → Normal file
View file

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