Merge branch 'master_13.4.1' (13.4.1-7) into omaha_13.4.1
Conflicts: cave/com.raytheon.uf.viz.monitor.ffmp/src/com/raytheon/uf/viz/monitor/ffmp/ui/rsc/FFMPDataGenerator.java edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/db/purge/SchemaManager.java edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFELockDao.java edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/isc/IscSendJob.java edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/database/IFPGridDatabase.java edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/server/lock/LockManager.java edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/util/GribModelLookup.java edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/blocks/RedbookBlockBuilder.java edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/HucLevelGeometriesFactory.java nativeLib/files.native/adapt/climate/bin/Linux/ASOS_smDecoder nativeLib/files.native/adapt/climate/bin/Linux/build_f6 nativeLib/files.native/adapt/climate/bin/Linux/create_climate nativeLib/files.native/adapt/climate/bin/Linux/display_climate nativeLib/files.native/adapt/climate/bin/Linux/do_all_climate nativeLib/files.native/adapt/climate/bin/Linux/format_climate nativeLib/files.native/adapt/climate/bin/Linux/init_climate nativeLib/files.native/adapt/climate/bin/Linux/qc_climate nativeLib/files.native/adapt/climate/bin/Linux/recordClimate nativeLib/files.native/adapt/climate/bin/Linux/set_up_climate nativeLib/files.native/edex/lib/native/linux32/libXm.so nativeLib/files.native/edex/lib/native/linux32/libXm.so.2 nativeLib/files.native/edex/lib/native/linux32/libecpg.so nativeLib/files.native/edex/lib/native/linux32/libecpg.so.6 nativeLib/files.native/edex/lib/native/linux32/libecpg_compat.so nativeLib/files.native/edex/lib/native/linux32/libecpg_compat.so.3 nativeLib/files.native/edex/lib/native/linux32/libjasper.so nativeLib/files.native/edex/lib/native/linux32/libjasper.so.1 nativeLib/files.native/edex/lib/native/linux32/libpgtypes.so nativeLib/files.native/edex/lib/native/linux32/libpgtypes.so.3 nativeLib/files.native/edex/lib/native/linux32/libtcl.so nativeLib/files.native/edex/lib/native/linux32/libtk.so rpms/awips2.qpid/0.18/SOURCES/virtualhosts.xml rpms/awips2.qpid/0.18/SPECS/qpid-java.spec.patch0 Change-Id: Idddce3fffab060f0eeaf69c3df825af0a6edd23e Former-commit-id: 4cd57d3ee7f55b3fdea60376d5dea57b1729fccc
This commit is contained in:
commit
8062c38b71
35 changed files with 1212 additions and 154 deletions
|
@ -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(?P<incc>(?:\s*\n)*(?:INCLUDING THE (?:CITIES|CITY) OF...)?)'
|
||||
cityh = r'(?<=-\n(?!.*-\n))(?P<incc>(?:.*\n))'
|
||||
|
||||
body = r'(?P<body>(?:^.*\n)*?)'
|
||||
#body = r'.*'
|
||||
|
|
|
@ -30,6 +30,8 @@ import org.eclipse.swt.events.MouseTrackAdapter;
|
|||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.events.ShellAdapter;
|
||||
import org.eclipse.swt.events.ShellEvent;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
|
@ -43,6 +45,7 @@ import org.eclipse.swt.widgets.Label;
|
|||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.viz.ui.menus.widgets.tearoff.TearOffMenuDialog.MenuPathElement;
|
||||
|
||||
|
@ -57,6 +60,8 @@ import com.raytheon.uf.viz.ui.menus.widgets.tearoff.TearOffMenuDialog.MenuPathEl
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 15, 2011 mnash Initial creation
|
||||
* Apr 10, 2013 DR 15185 D. Friedman Preserve tear-offs over perspective switches.
|
||||
* Apr 30, 2013 DR 15727 D. Friedman Try to make items that depend on an active
|
||||
* workbench window work correctly.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -378,7 +383,7 @@ public class MenuItemComposite extends Composite {
|
|||
private MouseAdapter getMouseAdapter() {
|
||||
MouseAdapter mouseAdapter = new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseDown(MouseEvent e) {
|
||||
public void mouseDown(final MouseEvent e) {
|
||||
MenuItem item = getItem();
|
||||
|
||||
if (item.getMenu() != null) {
|
||||
|
@ -394,6 +399,59 @@ public class MenuItemComposite extends Composite {
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Many menu items do not work unless there in an active
|
||||
* workbench window.
|
||||
*
|
||||
* If not already active (and it probably will not be), make the
|
||||
* shell of the original menu item active and finish selecting
|
||||
* the item after receiving an activation event. Otherwise,
|
||||
* finish selecting the item immediately.
|
||||
*
|
||||
* Also select immediately if the shell if not visible or is
|
||||
* minimized because we cannot exepect to get an activation
|
||||
* event.
|
||||
*
|
||||
* TODO: This is all still a kludge and could cause unexpected
|
||||
* behavior.
|
||||
*/
|
||||
final Shell shell = item.getParent().getShell();
|
||||
Display display = shell.getDisplay();
|
||||
if (shell.isVisible() && !shell.getMinimized()
|
||||
&& display.getActiveShell() != shell) {
|
||||
shell.addShellListener(new ShellAdapter() {
|
||||
@Override
|
||||
public void shellActivated(ShellEvent e2) {
|
||||
shell.removeShellListener(this);
|
||||
selectItem(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shellDeiconified(ShellEvent e) {
|
||||
shell.removeShellListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shellIconified(ShellEvent e) {
|
||||
shell.removeShellListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shellClosed(ShellEvent e) {
|
||||
shell.removeShellListener(this);
|
||||
}
|
||||
});
|
||||
shell.setActive();
|
||||
} else {
|
||||
selectItem(e);
|
||||
}
|
||||
}
|
||||
};
|
||||
return mouseAdapter;
|
||||
}
|
||||
|
||||
private void selectItem(MouseEvent e) {
|
||||
MenuItem item = getItem();
|
||||
// handle the selection event, so if it is able to load
|
||||
// something, do it (by looping over ALL the selection
|
||||
// listeners assigned to the item)
|
||||
|
@ -457,9 +515,6 @@ public class MenuItemComposite extends Composite {
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
return mouseAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
|
|
|
@ -27,6 +27,12 @@
|
|||
capabilityClass="com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability"
|
||||
name="Range Rings Capability"
|
||||
sortID="2"/>
|
||||
<contextualMenu
|
||||
actionClass="com.raytheon.viz.awipstools.ui.action.VelocitySourceAction"
|
||||
capabilityClass="com.raytheon.viz.awipstools.ui.layer.VRShearLayer"
|
||||
name="Velocity Source"
|
||||
sortID="601">
|
||||
</contextualMenu>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.viz.ui.contextualMenu">
|
||||
|
@ -201,9 +207,6 @@
|
|||
commandId="com.raytheon.viz.awipstools.arbitrary">
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="com.raytheon.uf.viz.core.alterBundle">
|
||||
<alterBundle class="com.raytheon.viz.awipstools.ToolsAlterBundleContributor"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.menus">
|
||||
<menuContribution
|
||||
|
|
|
@ -46,6 +46,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 10/08/2010 5953 bgonzale refactored EAV code out of layer class.
|
||||
* 05/02/2013 DR 14587 D. Friedman Use base velocity.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -71,6 +72,10 @@ public class EstimatedActualVelocity {
|
|||
|
||||
public static final String EST_ACT_VEL_LOCATION = "Estimated Act Vel";
|
||||
|
||||
private static String NUMERIC_VALUE_KEY = "numericValue";
|
||||
|
||||
private static String BASE_VELOCITY_NUMERIC_VALUE_KEY = "baseVelocity-numericValue";
|
||||
|
||||
private List<EAVConfig> eavList = new ArrayList<EAVConfig>();
|
||||
|
||||
private int _dirForward;
|
||||
|
@ -194,8 +199,12 @@ public class EstimatedActualVelocity {
|
|||
&& (dataMap.get("Mnemonic").equals("V")
|
||||
|| dataMap.get("Mnemonic").equals("HV") || dataMap
|
||||
.get("Mnemonic").equals("SRM"))
|
||||
&& dataMap.get("numericValue") != null) {
|
||||
return Double.parseDouble((String) dataMap.get("numericValue"));
|
||||
&& (dataMap.get(BASE_VELOCITY_NUMERIC_VALUE_KEY) != null ||
|
||||
dataMap.get(NUMERIC_VALUE_KEY) != null)) {
|
||||
String s = (String) dataMap.get(BASE_VELOCITY_NUMERIC_VALUE_KEY);
|
||||
if (s == null)
|
||||
s = (String) dataMap.get(NUMERIC_VALUE_KEY);
|
||||
return Double.parseDouble(s);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package com.raytheon.viz.awipstools.common;
|
||||
|
||||
/**
|
||||
* Dynamic tag for radial velocity data sources for shear tools
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ------------ --------------------------
|
||||
* 5/2/2013 DR 14587 D. Friedman Initial revision
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public interface IRadialVelocityToolSource {
|
||||
boolean isRadialVelocitySource();
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
package com.raytheon.viz.awipstools.ui.action;
|
||||
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.ActionContributionItem;
|
||||
import org.eclipse.jface.action.IMenuCreator;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.viz.awipstools.ui.layer.VRShearLayer;
|
||||
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||
|
||||
/**
|
||||
* Displays a menu of resources that can be used with the VR Shear tool.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ------------ --------------------------
|
||||
* 5/2/2013 DR 14587 D. Friedman Initial revision
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class VelocitySourceAction extends AbstractRightClickAction implements IMenuCreator {
|
||||
private Menu menu;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public VelocitySourceAction() {
|
||||
super(Action.AS_DROP_DOWN_MENU);
|
||||
setMenuCreator(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMenuCreator getMenuCreator() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.action.Action#getText()
|
||||
*/
|
||||
@Override
|
||||
public String getText() {
|
||||
return "Velocity Source";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (menu != null) {
|
||||
menu.dispose();
|
||||
menu = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Menu getMenu(Control parent) {
|
||||
if (menu != null) {
|
||||
menu.dispose();
|
||||
}
|
||||
menu = new Menu(parent);
|
||||
fillMenu(menu, parent.getDisplay());
|
||||
return menu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Menu getMenu(Menu parent) {
|
||||
if (menu != null) {
|
||||
menu.dispose();
|
||||
}
|
||||
menu = new Menu(parent);
|
||||
fillMenu(menu, parent.getDisplay());
|
||||
return menu;
|
||||
}
|
||||
|
||||
public void fillMenu(Menu menu, Display d) {
|
||||
VRShearLayer layer = getVRShearLayer();
|
||||
if (layer != null) {
|
||||
AbstractVizResource<?, ?> selectedResource = layer.getSelectedVelocitySource();
|
||||
ActionContributionItem actionItem;
|
||||
|
||||
actionItem = new ActionContributionItem(
|
||||
new SetVelocitySourceAction(null, selectedResource == null));
|
||||
actionItem.fill(menu, -1);
|
||||
|
||||
for (AbstractVizResource<?, ?> resource : layer.getEligibleResources(false)) {
|
||||
actionItem = new ActionContributionItem(
|
||||
new SetVelocitySourceAction(resource, resource == selectedResource));
|
||||
actionItem.fill(menu, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class SetVelocitySourceAction extends Action {
|
||||
private AbstractVizResource<?, ?> resource;
|
||||
|
||||
public SetVelocitySourceAction(AbstractVizResource<?, ?> resource, boolean selected) {
|
||||
super(resource != null ? resource.getName() : "(default)", Action.AS_RADIO_BUTTON);
|
||||
setChecked(selected);
|
||||
this.resource = resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
VRShearLayer layer = getVRShearLayer();
|
||||
if (layer != null) {
|
||||
layer.setSelectedVelocitySource(resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private VRShearLayer getVRShearLayer() {
|
||||
if (getSelectedRsc() instanceof VRShearLayer) {
|
||||
return (VRShearLayer) getSelectedRsc();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -66,6 +66,7 @@ import com.vividsolutions.jts.operation.buffer.BufferOp;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 15Mar2013 15693 mgamazaychikov Added magnification capability.
|
||||
* 05/02/2013 DR 14587 D. Friedman Use base velocity.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -458,6 +459,10 @@ public class ShearLayer extends
|
|||
}
|
||||
|
||||
protected static class VelocityRange {
|
||||
private static String VALUE_KEY = "Value";
|
||||
|
||||
private static String BASE_VELOCITY_VALUE_KEY = "baseVelocity-Value";
|
||||
|
||||
Float lower;
|
||||
|
||||
Float upper;
|
||||
|
@ -466,13 +471,16 @@ public class ShearLayer extends
|
|||
|
||||
public VelocityRange(Map<String, Object> map) {
|
||||
if (map != null && map.containsKey("Mnemonic")
|
||||
&& map.containsKey("Value")) {
|
||||
&& (map.containsKey(BASE_VELOCITY_VALUE_KEY) ||
|
||||
map.containsKey(VALUE_KEY))) {
|
||||
String mnemonic = map.get("Mnemonic").toString();
|
||||
|
||||
if (mnemonic.equalsIgnoreCase("V")
|
||||
|| mnemonic.equalsIgnoreCase("SRM")
|
||||
|| mnemonic.equalsIgnoreCase("HV")) {
|
||||
String s = map.get("Value").toString();
|
||||
String s = map.get(BASE_VELOCITY_VALUE_KEY).toString();
|
||||
if (s == null)
|
||||
s = map.get(VALUE_KEY).toString();
|
||||
if (s != null && !s.equalsIgnoreCase("NO DATA")) {
|
||||
final String corePatternStr = "-?[0-9]+\\.[0-9]+";
|
||||
final String symbolPatternStr = "[<>]";
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
**/
|
||||
package com.raytheon.viz.awipstools.ui.layer;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
|
@ -35,10 +37,12 @@ import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.map.MapDescriptor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.tools.AwipsToolsResourceData;
|
||||
import com.raytheon.viz.awipstools.common.IRadialVelocityToolSource;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.LineString;
|
||||
|
||||
|
@ -59,6 +63,8 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* counter-clockwise rotation. The order of the points will also
|
||||
* no longer impact the sign that is displayed.
|
||||
* 15Mar2013 15693 mgamazaychikov Added magnification capability.
|
||||
* 02May2013 DR 14587 D. Friedman Correct calculation. Make source velocity data choice more
|
||||
* explicit.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -71,6 +77,8 @@ public class VRShearLayer extends ShearLayer {
|
|||
|
||||
private static final int NUM_ANGLE_POINTERS = 7200;
|
||||
|
||||
private AbstractVizResource<?, ?> selectedVelocitySource;
|
||||
|
||||
/**
|
||||
* @param data
|
||||
* @param props
|
||||
|
@ -90,17 +98,19 @@ public class VRShearLayer extends ShearLayer {
|
|||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return VRSHEAR_LOCATION;
|
||||
String name = VRSHEAR_LOCATION;
|
||||
if (selectedVelocitySource != null)
|
||||
name = name + makeLabel(selectedVelocitySource);
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String calculateShearLabel(double length, Coordinate sCoor,
|
||||
Coordinate eCoor, Coordinate midpointCoor) throws VizException {
|
||||
ResourceList list = descriptor.getResourceList();
|
||||
for (Iterator<ResourcePair> iter = list.iterator(); iter.hasNext();) {
|
||||
ResourcePair rPair = iter.next();
|
||||
AbstractVizResource<?, ?> rsc = rPair.getResource();
|
||||
|
||||
List<AbstractVizResource<?, ?>> potentialSources = getEligibleResources(false);
|
||||
|
||||
for (AbstractVizResource<?, ?> rsc : getVelocitySources()) {
|
||||
Map<String, Object> mapS = (rsc)
|
||||
.interrogate(new ReferencedCoordinate(sCoor));
|
||||
Map<String, Object> mapE = (rsc)
|
||||
|
@ -162,13 +172,17 @@ public class VRShearLayer extends ShearLayer {
|
|||
long midpointRange = new Float(getRangeValue(mapMid))
|
||||
.longValue();
|
||||
String velocitySymbol = velS.pickSeparatorSymbol(velE);
|
||||
double sec = (velocity / (length * 3600));
|
||||
double sec = (velocity / (length * 1800));
|
||||
|
||||
return String.format("%1s%.1fkts %.1fnm %.4f/s dist:%2dnm",
|
||||
velocitySymbol, velocity, length, sec, midpointRange);
|
||||
boolean needLabel = selectedVelocitySource != null
|
||||
|| potentialSources.size() > 1;
|
||||
return String.format("%1s%.1fkts %.1fnm %.4f/s dist:%2dnm%s",
|
||||
velocitySymbol, velocity, length, sec, midpointRange,
|
||||
needLabel ? makeLabel(rsc) : "");
|
||||
}
|
||||
}
|
||||
return "NO DATA";
|
||||
return "NO DATA"
|
||||
+ (selectedVelocitySource != null ? makeLabel(selectedVelocitySource) : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -203,4 +217,65 @@ public class VRShearLayer extends ShearLayer {
|
|||
drawBaselineLabel(target, labelPoint, label);
|
||||
return label;
|
||||
}
|
||||
|
||||
public AbstractVizResource<?, ?> getSelectedVelocitySource() {
|
||||
return selectedVelocitySource;
|
||||
}
|
||||
|
||||
public void setSelectedVelocitySource(
|
||||
AbstractVizResource<?, ?> selectedVelocitySource) {
|
||||
this.selectedVelocitySource = selectedVelocitySource;
|
||||
issueRefresh();
|
||||
}
|
||||
|
||||
public List<AbstractVizResource<?, ?>> getEligibleResources(boolean forDefault) {
|
||||
ArrayList<AbstractVizResource<?, ?>> list = new ArrayList<AbstractVizResource<?,?>>();
|
||||
getEligibleResources1(getDescriptor().getResourceList(), forDefault, list);
|
||||
Collections.reverse(list); // Topmost first, but TODO: shouldn't reverse combos...
|
||||
return list;
|
||||
}
|
||||
|
||||
public void getEligibleResources1(ResourceList resourceList, boolean forDefault,
|
||||
List<AbstractVizResource<?, ?>> list) {
|
||||
for (ResourcePair rp : resourceList) {
|
||||
if (rp.getResource() instanceof IResourceGroup) {
|
||||
getEligibleResources1(((IResourceGroup)rp.getResource()).getResourceList(), forDefault, list);
|
||||
} else if (isEligibleResource(rp, forDefault)) {
|
||||
list.add(rp.getResource());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isEligibleResource(ResourcePair rp, boolean forDefault) {
|
||||
AbstractVizResource<?, ?> resource = rp.getResource();
|
||||
return resource instanceof IRadialVelocityToolSource
|
||||
&& ((IRadialVelocityToolSource) resource)
|
||||
.isRadialVelocitySource() &&
|
||||
(!forDefault || rp.getProperties().isVisible());
|
||||
}
|
||||
|
||||
private List<AbstractVizResource<?, ?>> getVelocitySources() {
|
||||
List<AbstractVizResource<?, ?>> list;
|
||||
if (selectedVelocitySource != null) {
|
||||
/* Note: This checks for DISPOSED, but not if the resource has
|
||||
* somehow changed so that it no longer contains velocity data.
|
||||
* This could happen for combo resources if we held references
|
||||
* to the combo rather than the component resources.
|
||||
*/
|
||||
if (selectedVelocitySource.getStatus() != ResourceStatus.DISPOSED) {
|
||||
list = new ArrayList<AbstractVizResource<?, ?>>(1);
|
||||
list.add(selectedVelocitySource);
|
||||
return list;
|
||||
} else {
|
||||
selectedVelocitySource = null;
|
||||
}
|
||||
}
|
||||
|
||||
list = getEligibleResources(true);
|
||||
return list;
|
||||
}
|
||||
|
||||
private String makeLabel(AbstractVizResource<?, ?> resource) {
|
||||
return String.format(" (%s)", resource.getName());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
|
|||
* 30 Jul 2010 6719 jnjanga Placed cursor at the end of inserted CTA
|
||||
* 26 Sep 2012 15423 ryu Avoid resetting text when possible.
|
||||
* 03 Dec 2012 15620 ryu Unlock framed cities list for editing.
|
||||
* 30 APR 2013 16095 ryu Modified updateTextStyle() to not lock edited text.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -742,15 +743,12 @@ public class StyledTextComp extends Composite {
|
|||
// .getStyleRangeAtOffset(event.start + event.length + 1);
|
||||
|
||||
// if it's in a framing code, turn it red
|
||||
// or if it's in a locked section (because a programmatic text
|
||||
// update was made), turn it blue
|
||||
if (startRange != null
|
||||
&& endRange != null
|
||||
&& event.start > startRange.start
|
||||
&& event.start + event.length < endRange.start
|
||||
&& startRange.similarTo(endRange)
|
||||
&& (startRange.foreground.equals(frameColor) || startRange.foreground
|
||||
.equals(lockColor))) {
|
||||
&& startRange.foreground.equals(frameColor)) {
|
||||
StyleRange style = (StyleRange) startRange.clone();
|
||||
style.start = event.start;
|
||||
style.length = event.length;
|
||||
|
|
|
@ -76,6 +76,7 @@ import com.raytheon.viz.mpe.util.WriteQPFGrids;
|
|||
* Mar 24, 2009 snaples Initial creation
|
||||
* Sep 19, 2011 10955 rferrel Use RunProcess
|
||||
* Nov 06, 2012 15481 wkwock Fix save 6 hours precipitation files
|
||||
* May 02, 2013 15956 wkwock Fix incorrect contents in precip_LLL_grid_yyyymmdd.nc file
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -765,6 +766,13 @@ public class SaveLevel2Data {
|
|||
DailyQcUtils.precip_stations, hrap_grid,
|
||||
DailyQcUtils.pdata, DailyQcUtils.pcp_in_use);
|
||||
|
||||
//copy DailyQcUtils.pcp.value to datavals
|
||||
for (int h = 0; h < hrap_grid.maxj; h++) {
|
||||
for (int i = 0; i < hrap_grid.maxi; i++) {
|
||||
datavals[i][h] = (DailyQcUtils.pcp.value[i][h] / 100.f);
|
||||
}
|
||||
}
|
||||
|
||||
String dbuf = String.format("%s%s_%04d%02d%02d", grid_file,
|
||||
timefile[2][l], gm.get(Calendar.YEAR),
|
||||
gm.get(Calendar.MONTH) + 1,
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Hrap_Grid;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 7, 2011 snaples Initial creation
|
||||
* May 02, 2013 15956 wkwock Fix incorrect contents in precip_LLL_grid_yyyymmdd.nc file
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -274,7 +275,7 @@ public class AutoDailyQC {
|
|||
otime.get(Calendar.DAY_OF_MONTH));
|
||||
File pl2 = new File(precip_level2_file);
|
||||
|
||||
if (pl2.exists()) {
|
||||
if (!pl2.exists()) {//dr16046:file not exist then don't generate
|
||||
precip_level2_flag[i] = 0;
|
||||
System.out
|
||||
.println(String
|
||||
|
@ -389,6 +390,8 @@ public class AutoDailyQC {
|
|||
CreateMap cm = new CreateMap();
|
||||
cm.create_map(num);
|
||||
}
|
||||
|
||||
//Here's the 12 to 12 whole day nc file
|
||||
//for (int l = 0; l < 5; l++) {
|
||||
for (int l = 0; l < num_period_qc; l++) {
|
||||
if (DailyQcUtils.pdata[i].used[l] == 0) {
|
||||
|
@ -415,6 +418,13 @@ public class AutoDailyQC {
|
|||
DailyQcUtils.getHrap_grid(),
|
||||
DailyQcUtils.pdata, DailyQcUtils.pcp_in_use);
|
||||
|
||||
//copy data from DailyQcUtils.pcp.value to datavals
|
||||
for (int y = 0; y < hrap_grid.maxj; y++) {
|
||||
for (int x = 0; x < hrap_grid.maxi; x++) {
|
||||
datavals[x][y] = (DailyQcUtils.pcp.value[x][y] / 100.f);
|
||||
}
|
||||
}
|
||||
|
||||
/* output grid to file in Ascii format */
|
||||
dbuf = String.format("%s%s_%04d%02d%02d",
|
||||
DailyQcUtils.grid_file,
|
||||
|
|
|
@ -260,15 +260,9 @@ public class RadarDMDInterrogator extends RadarGraphicInterrogator implements
|
|||
break;
|
||||
case RANK:
|
||||
// Rank
|
||||
String ranks = currFeature
|
||||
.getValue(DMDAttributeIDs._2D_STRENGTH_RANK
|
||||
String rank = currFeature
|
||||
.getValue(DMDAttributeIDs.STRENGTH_RANK
|
||||
.toString());
|
||||
int tiltNum = 0;
|
||||
if ((ranks.length() > 0)
|
||||
&& !ranks.isEmpty()) {
|
||||
tiltNum = ranks.split(",").length - 1;
|
||||
}
|
||||
String rank = ranks.split(",")[tiltNum];
|
||||
rval.append("r" + rank + " ");
|
||||
break;
|
||||
case MSI:
|
||||
|
|
|
@ -55,6 +55,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 4, 2010 mnash Initial creation
|
||||
* 05/02/2013 DR 14587 D. Friedman Refactor to store multiple types.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -103,8 +104,22 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
|
|||
dataMap.put("Angle", radarRecord.getPrimaryElevationAngle().toString());
|
||||
|
||||
int dataValue = addParameters(radarRecord, latLon, dataMap);
|
||||
addValueToMap(dataValue, "", radarRecord, params, dataMap);
|
||||
|
||||
dataMap.put("numericValue", String.valueOf(dataValue));
|
||||
computeValues(radarRecord, dataMap, dataValue, params);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dataValue
|
||||
* @param baseName
|
||||
* @param dataMap
|
||||
*/
|
||||
protected void addValueToMap(int dataValue, String baseName,
|
||||
RadarRecord radarRecord, ColorMapParameters params,
|
||||
Map<String, String> dataMap) {
|
||||
String numericValueKey = baseName + "numericValue";
|
||||
dataMap.put(numericValueKey, String.valueOf(dataValue));
|
||||
String dataValueString = "";
|
||||
|
||||
if (radarRecord.getNumLevels() <= 16 && radarRecord.getNumLevels() != 0
|
||||
|
@ -123,7 +138,7 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
|
|||
units = UnitFormat.getUCUMInstance().format(dispUnit);
|
||||
}
|
||||
if (dataValue == 0) {
|
||||
dataMap.put("numericValue", null);
|
||||
dataMap.put(numericValueKey, null);
|
||||
dataValueString = "NO DATA";
|
||||
} else if (th0 instanceof Float) {
|
||||
double f0 = (Float) th0;
|
||||
|
@ -131,7 +146,7 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
|
|||
if (converter != null) {
|
||||
f0 = converter.convert(dataValue);
|
||||
}
|
||||
dataMap.put("numericValue", String.valueOf(f0));
|
||||
dataMap.put(numericValueKey, String.valueOf(f0));
|
||||
|
||||
if (dataValue < 15) {
|
||||
Object th1 = radarRecord.getDecodedThreshold(dataValue + 1);
|
||||
|
@ -178,16 +193,14 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
|
|||
// Handle cases where the the actual value is used
|
||||
// /////////////////////////////////////////////////////////
|
||||
if (dataValue == 0) {
|
||||
dataMap.put("numericValue", null);
|
||||
dataMap.put(numericValueKey, null);
|
||||
dataValueString = "NO DATA";
|
||||
} else {
|
||||
dataValueString = decodeValues(dataValue, dataMap, radarRecord,
|
||||
dataValueString = decodeValues(dataValue, baseName, dataMap, radarRecord,
|
||||
params);
|
||||
}
|
||||
}
|
||||
dataMap.put("Value", dataValueString);
|
||||
computeValues(radarRecord, dataMap, dataValue, params);
|
||||
return dataMap;
|
||||
dataMap.put(baseName + "Value", dataValueString);
|
||||
}
|
||||
|
||||
public void computeValues(RadarRecord radarRecord,
|
||||
|
@ -202,11 +215,11 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
|
|||
* @param dataMap
|
||||
* @return
|
||||
*/
|
||||
public String decodeValues(int dataValue, Map<String, String> dataMap,
|
||||
public String decodeValues(int dataValue, String baseName, Map<String, String> dataMap,
|
||||
RadarRecord radarRecord, ColorMapParameters params) {
|
||||
UnitConverter converter = getConverter(params, radarRecord);
|
||||
double dispVal = converter.convert(dataValue);
|
||||
dataMap.put("numericValue", String.valueOf(dispVal));
|
||||
dataMap.put(baseName + "numericValue", String.valueOf(dispVal));
|
||||
if (params.getDataMapping() != null) {
|
||||
for (DataMappingEntry entry : params.getDataMapping().getEntries()) {
|
||||
if (entry.getSample() == null) {
|
||||
|
|
|
@ -54,7 +54,7 @@ public class RadarEETInterrogator extends RadarRadialInterrogator implements
|
|||
* com.raytheon.uf.viz.core.drawables.ColorMapParameters)
|
||||
*/
|
||||
@Override
|
||||
public String decodeValues(int dataValue, Map<String, String> dataMap,
|
||||
public String decodeValues(int dataValue, String baseName, Map<String, String> dataMap,
|
||||
RadarRecord radarRecord, ColorMapParameters params) {
|
||||
dataValue -= 2;
|
||||
String d = "";
|
||||
|
@ -66,7 +66,7 @@ public class RadarEETInterrogator extends RadarRadialInterrogator implements
|
|||
} else {
|
||||
d = String.valueOf(dataValue);
|
||||
}
|
||||
dataMap.put("numericValue", d);
|
||||
dataMap.put(baseName + "numericValue", d);
|
||||
return String.format("%s %s", d,
|
||||
UnitFormat.getUCUMInstance().format(params.getDisplayUnit()));
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class RadarVILInterrogator extends RadarRasterInterrogator implements
|
|||
* (int, java.util.Map)
|
||||
*/
|
||||
@Override
|
||||
public String decodeValues(int dataValue, Map<String, String> dataMap,
|
||||
public String decodeValues(int dataValue, String baseName, Map<String, String> dataMap,
|
||||
RadarRecord radarRecord, ColorMapParameters params) {
|
||||
double decoded[] = new double[] { 0, 0, 0, 0, 0 };
|
||||
// TODO still doesn't return correct value
|
||||
|
|
|
@ -25,7 +25,9 @@ import javax.measure.converter.UnitConverter;
|
|||
import javax.measure.unit.SI;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarDataInterrogator;
|
||||
import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -36,6 +38,7 @@ import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 5, 2010 mnash Initial creation
|
||||
* 05/02/2013 DR 14587 D. Friedman Store base velocity in map.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -123,4 +126,14 @@ public class RadarVelocityInterrogator extends RadarRadialInterrogator
|
|||
dataMap.put("Shear", String.format("%.4f/s", shear));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> sample(RadarRecord radarRecord,
|
||||
Coordinate latLon, ColorMapParameters params) {
|
||||
Map<String, String> map = super.sample(radarRecord, latLon, params);
|
||||
int dataValue = interrogator.getDataValue(latLon,
|
||||
RadarDataInterrogator.DataType.BASE_VELOCITY);
|
||||
addValueToMap(dataValue, "baseVelocity-", radarRecord, params, map);
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ import com.raytheon.viz.radar.ui.xy.RadarXsectXYResource;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 4, 2010 mnash Initial creation
|
||||
* 03/04/2013 DCS51 zwang Handle GFM product
|
||||
* 05/02/2013 DR 14587 D. Friedman Add isVelocityProductCode
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -151,4 +152,8 @@ public class RadarProductFactory {
|
|||
}
|
||||
return resource;
|
||||
}
|
||||
|
||||
public static boolean isVelocityProductCode(int productCode) {
|
||||
return velocities.contains(productCode);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.IDecoderGettable.Amount;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.DrawableImage;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
|
@ -41,9 +43,11 @@ import com.raytheon.uf.viz.core.map.MapDescriptor;
|
|||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.viz.awipstools.capabilities.EAVCapability;
|
||||
import com.raytheon.viz.awipstools.common.EstimatedActualVelocity;
|
||||
import com.raytheon.viz.awipstools.common.IRadialVelocityToolSource;
|
||||
import com.raytheon.viz.radar.VizRadarRecord;
|
||||
import com.raytheon.viz.radar.interrogators.IRadarInterrogator;
|
||||
import com.raytheon.viz.radar.rsc.RadarImageResource;
|
||||
import com.raytheon.viz.radar.rsc.RadarProductFactory;
|
||||
import com.raytheon.viz.radar.rsc.RadarResourceData;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
|
@ -56,6 +60,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 29, 2010 mnash Initial creation
|
||||
* 05/02/2013 DR 14587 D. Friedman Implement IRadialVelocityToolSource
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,7 +68,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class RadarRadialResource extends RadarImageResource<MapDescriptor> {
|
||||
public class RadarRadialResource extends RadarImageResource<MapDescriptor> implements IRadialVelocityToolSource {
|
||||
|
||||
private static final String EAV_VALUE = "EAC.Value";
|
||||
|
||||
|
@ -214,4 +219,24 @@ public class RadarRadialResource extends RadarImageResource<MapDescriptor> {
|
|||
radarRecord, descriptor.getGridGeometry());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRadialVelocitySource() {
|
||||
int productCode = -1;
|
||||
try {
|
||||
// TODO: This duplicates logic in RadarResourceData.constructResource
|
||||
if (radarRecords != null && ! radarRecords.isEmpty()) {
|
||||
RadarRecord r = radarRecords.values().iterator().next();
|
||||
productCode = r.getProductCode();
|
||||
} else {
|
||||
RequestConstraint productCodeConstraint = getResourceData()
|
||||
.getMetadataMap().get("productCode");
|
||||
if (productCodeConstraint.getConstraintType() == ConstraintType.EQUALS)
|
||||
productCode = Integer.parseInt(productCodeConstraint
|
||||
.getConstraintValue());
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
// ignore
|
||||
}
|
||||
return RadarProductFactory.isVelocityProductCode(productCode);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
import javax.measure.unit.Unit;
|
||||
import javax.measure.unit.UnitFormat;
|
||||
|
||||
|
@ -53,6 +55,10 @@ import com.vividsolutions.jts.geom.Envelope;
|
|||
* Nov 09 2012 15586 Xiaochuan In dataRowFormat, set MSI maximum
|
||||
* size to 5.
|
||||
* MAR 05, 2013 15313 kshresth Added sampling for DMD
|
||||
*
|
||||
* MAY 01, 2013 15150 kshresth Added logic to match DMD Radar Graphic
|
||||
* Display and SCAN DMD Table Display
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mnash
|
||||
|
@ -154,9 +160,15 @@ public class GraphicDataUtil {
|
|||
.toString());
|
||||
|
||||
// Range @ Azimuth
|
||||
String range = setupConverter(currFeature,
|
||||
DMDAttributeIDs.BASE_RANGE.toString(),
|
||||
0, true);
|
||||
double range = Double
|
||||
.parseDouble(currFeature
|
||||
.getValue(DMDAttributeIDs.BASE_RANGE
|
||||
.toString()));
|
||||
UnitConverter converter = SI.KILOMETER
|
||||
.getConverterTo(NonSI.NAUTICAL_MILE);
|
||||
int rangeNm = (int) Math
|
||||
.round(converter.convert(range));
|
||||
|
||||
String azimuth = currFeature
|
||||
.getValue(DMDAttributeIDs.BASE_AZIMUTH
|
||||
.toString());
|
||||
|
@ -215,7 +227,7 @@ public class GraphicDataUtil {
|
|||
// put together the final string to display in
|
||||
// the table
|
||||
String fnlString = String.format(dataRowFormat,
|
||||
mid, range, azimuth, baseHeight, depth,
|
||||
mid, rangeNm, azimuth, baseHeight, depth,
|
||||
rank, msi, llrotv, llg2g, mxrotv,
|
||||
htmxrv);
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.regex.Pattern;
|
|||
* Initial creation
|
||||
* Aug 25, 2011 10719 rferrel Removed the no longer common ugcPtrn.
|
||||
* Aug 6, 2012 15219 Qinglu Lin For tmlPtrn, changed d{1,3}DEG to d{3}DEG.
|
||||
* May 1, 2013 15893 mgamazaychikov Changed listOfAreaNamePtrn.
|
||||
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,7 +57,7 @@ public interface IQCCheck {
|
|||
.compile("/[A-Za-z0-9]{5}.[0-3NU].(\\w{2}).\\d{6}T\\d{4}Z.\\d{6}T\\d{4}Z.\\d{6}T\\d{4}Z.\\w{2}/");
|
||||
|
||||
public static final Pattern listOfAreaNamePtrn = Pattern
|
||||
.compile("^((\\w{1,}\\s{1}\\w{2}-){1,})");
|
||||
.compile("^(\\w{1,}\\s{1}[\\w{1,}\\s{1}]*-{1,})");
|
||||
|
||||
public static final Pattern firstBulletPtrn = Pattern
|
||||
.compile("\\*\\s(.*)\\s(WARNING|ADVISORY)(\\sFOR(.*)|...)");
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
commandId="com.raytheon.viz.volumebrowser.volumeBrowserRef">
|
||||
</handler>
|
||||
</extension>
|
||||
<extension point="com.raytheon.uf.viz.core.alterBundle">
|
||||
<alterBundle id="tools" class="com.raytheon.viz.volumebrowser.ToolsAlterBundleContributor"/>
|
||||
</extension>
|
||||
<extension point="com.raytheon.uf.viz.core.alterBundle">
|
||||
<alterBundle id="grids" class="com.raytheon.viz.volumebrowser.GridAlterBundleContributor"/>
|
||||
</extension>
|
||||
|
|
|
@ -0,0 +1,443 @@
|
|||
/*****************************************************************************************
|
||||
* COPYRIGHT (c), 2007, RAYTHEON COMPANY
|
||||
* ALL RIGHTS RESERVED, An Unpublished Work
|
||||
*
|
||||
* RAYTHEON PROPRIETARY
|
||||
* If the end user is not the U.S. Government or any agency thereof, use
|
||||
* or disclosure of data contained in this source code file is subject to
|
||||
* the proprietary restrictions set forth in the Master Rights File.
|
||||
*
|
||||
* U.S. GOVERNMENT PURPOSE RIGHTS NOTICE
|
||||
* If the end user is the U.S. Government or any agency thereof, this source
|
||||
* code is provided to the U.S. Government with Government Purpose Rights.
|
||||
* Use or disclosure of data contained in this source code file is subject to
|
||||
* the "Government Purpose Rights" restriction in the Master Rights File.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* Use or disclosure of data contained in this source code file is subject to
|
||||
* the export restrictions set forth in the Master Rights File.
|
||||
******************************************************************************************/
|
||||
package com.raytheon.viz.volumebrowser;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.procedures.AlterBundleChangeEvent;
|
||||
import com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter;
|
||||
import com.raytheon.uf.viz.core.procedures.Bundle;
|
||||
import com.raytheon.uf.viz.core.procedures.IAlterBundleContributor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.IBaseLinesContainer;
|
||||
import com.raytheon.uf.viz.core.rsc.IPointsToolContainer;
|
||||
import com.raytheon.uf.viz.core.rsc.IResourceGroup;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.uf.viz.d2d.ui.dialogs.procedures.ProcedureDlg;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointUtilities;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.points.data.IPointNode;
|
||||
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
|
||||
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.volumebrowser.datacatalog.AbstractDataCatalog;
|
||||
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
|
||||
import com.raytheon.viz.volumebrowser.vbui.SelectedData;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.LineString;
|
||||
|
||||
/**
|
||||
* This class generates the alter bundle's contributions for points and lines.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Aug 08, 2012 #875 rferrel Generate menu entries for points.
|
||||
* Oct 03, 2012 #1248 rferrel Added listener for when points change.
|
||||
* May 03, 2013 DR14824 mgamazaychikov Added alterResource method
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author mschenke
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
||||
private static final String POINTS_PREFIX = "Point-";
|
||||
|
||||
private static final String LINES_PREFIX = "Line-";
|
||||
|
||||
private static final String POINTS_KEY = "point";
|
||||
|
||||
private static final String LINES_KEY = "line";
|
||||
|
||||
private static final String PLUGIN_KEY = "pluginName";
|
||||
|
||||
private static final String REPORTYPE_KEY = "reportType";
|
||||
|
||||
private IPointChangedListener pointChangedListener;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.procedures.IAlterBundleContributor#getAlterables
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String[]> getAlterables() {
|
||||
Map<String, String[]> alterables = new HashMap<String, String[]>();
|
||||
String[] linesValues = createLineArray();
|
||||
String[] pointsValues = createPointArray();
|
||||
|
||||
alterables.put(LINES_KEY, linesValues);
|
||||
alterables.put(POINTS_KEY, pointsValues);
|
||||
|
||||
return alterables;
|
||||
}
|
||||
|
||||
private final static Pattern pat = Pattern.compile(File.separator + "+");
|
||||
|
||||
private List<String> createChildrenList(PointsDataManager pdm,
|
||||
IPointNode parent) {
|
||||
List<String> childrenList = new ArrayList<String>();
|
||||
for (IPointNode node : pdm.getChildren(parent)) {
|
||||
if (node.isGroup()) {
|
||||
String value = node.getGroup().replace(
|
||||
PointUtilities.DELIM_CHAR, ' ')
|
||||
+ File.separator;
|
||||
value = pat.matcher(value).replaceAll(
|
||||
IAlterBundleContributor.MENU_SEPARATOR);
|
||||
childrenList.add(value);
|
||||
childrenList.addAll(createChildrenList(pdm, node));
|
||||
} else {
|
||||
String value = (node.getGroup() + File.separator
|
||||
+ POINTS_PREFIX + node.getName()).replace(
|
||||
PointUtilities.DELIM_CHAR, ' ');
|
||||
value = pat.matcher(value).replaceAll(
|
||||
IAlterBundleContributor.MENU_SEPARATOR);
|
||||
childrenList.add(value);
|
||||
}
|
||||
}
|
||||
return childrenList;
|
||||
}
|
||||
|
||||
private String[] createLineArray() {
|
||||
ToolsDataManager tdm = ToolsDataManager.getInstance();
|
||||
Collection<String> blNames = tdm.getBaselineNames();
|
||||
String[] lines = new String[blNames.size()];
|
||||
int i = 0;
|
||||
for (String line : blNames) {
|
||||
lines[i] = LINES_PREFIX + line;
|
||||
++i;
|
||||
}
|
||||
|
||||
Arrays.sort(lines);
|
||||
String[] linesValues = new String[lines.length + 2];
|
||||
linesValues[0] = ProcedureDlg.ORIGINAL;
|
||||
linesValues[1] = ProcedureDlg.CURRENT;
|
||||
System.arraycopy(lines, 0, linesValues, 2, lines.length);
|
||||
return linesValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return pointsValues
|
||||
*/
|
||||
private String[] createPointArray() {
|
||||
PointsDataManager pdm = PointsDataManager.getInstance();
|
||||
|
||||
List<String> pointsList = new ArrayList<String>();
|
||||
pointsList.add(ProcedureDlg.ORIGINAL);
|
||||
pointsList.add(ProcedureDlg.CURRENT);
|
||||
pointsList.add(IAlterBundleContributor.MI_SEPARATOR);
|
||||
pointsList.addAll(createChildrenList(pdm, null));
|
||||
String[] pointsValues = pointsList.toArray(new String[0]);
|
||||
return pointsValues;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.procedures.IAlterBundleContributor#alterBundle
|
||||
* (com.raytheon.uf.viz.core.procedures.Bundle, java.lang.String,
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void alterBundle(Bundle bundleToAlter, String alterKey,
|
||||
String alterValue) {
|
||||
if (alterValue != null) {
|
||||
if (POINTS_KEY.equals(alterKey)) {
|
||||
if (ProcedureDlg.CURRENT.equals(alterValue)) {
|
||||
for (AbstractRenderableDisplay display : bundleToAlter
|
||||
.getDisplays()) {
|
||||
replaceWithCurrentPoints(display.getDescriptor()
|
||||
.getResourceList());
|
||||
}
|
||||
} else if (ProcedureDlg.ORIGINAL.equals(alterValue) == false) {
|
||||
String point = alterValue.replace(POINTS_PREFIX, "");
|
||||
alterPoints(bundleToAlter, point);
|
||||
}
|
||||
} else if (LINES_KEY.equals(alterKey)) {
|
||||
if (ProcedureDlg.CURRENT.equals(alterValue)) {
|
||||
replaceWithCurrentLines(bundleToAlter);
|
||||
} else if (ProcedureDlg.ORIGINAL.equals(alterValue) == false) {
|
||||
String line = alterValue.replace(LINES_PREFIX, "");
|
||||
alterLines(bundleToAlter, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list
|
||||
*/
|
||||
private void replaceWithCurrentPoints(ResourceList list) {
|
||||
for (ResourcePair rp : list) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof IPointsToolContainer) {
|
||||
alterContainer((IPointsToolContainer) rData,
|
||||
((IPointsToolContainer) rData).getPointLetter());
|
||||
} else if (rData instanceof IResourceGroup) {
|
||||
replaceWithCurrentPoints(((IResourceGroup) rData)
|
||||
.getResourceList());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param b
|
||||
*/
|
||||
private void replaceWithCurrentLines(Bundle b) {
|
||||
for (AbstractRenderableDisplay display : b.getDisplays()) {
|
||||
IDescriptor desc = display.getDescriptor();
|
||||
if (desc instanceof IBaseLinesContainer) {
|
||||
String line = ((IBaseLinesContainer) desc).getBaseLine();
|
||||
if (line != null && line.startsWith("Line")) {
|
||||
alterContainer((IBaseLinesContainer) desc,
|
||||
line.replace("Line", ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bundleToAlter
|
||||
* @param point
|
||||
*/
|
||||
private void alterPoints(Bundle bundleToAlter, String point) {
|
||||
for (AbstractRenderableDisplay display : bundleToAlter.getDisplays()) {
|
||||
alterResourceList(display.getDescriptor().getResourceList(), point);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list
|
||||
* @param selectedString
|
||||
*/
|
||||
private void alterResourceList(ResourceList list, String selectedString) {
|
||||
for (ResourcePair rp : list) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof AbstractRequestableResourceData) {
|
||||
alterResource((AbstractRequestableResourceData) rData, POINTS_KEY,
|
||||
selectedString);
|
||||
alterContainer((IPointsToolContainer) rData, selectedString);
|
||||
} else if (rData instanceof IResourceGroup) {
|
||||
alterResourceList(((IResourceGroup) rData).getResourceList(),
|
||||
selectedString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void alterResource(AbstractRequestableResourceData data, String selectedKey,
|
||||
String selectedString) {
|
||||
if (selectedString == null) {
|
||||
return;
|
||||
}
|
||||
HashMap<String, RequestConstraint> metadataMap = data.getMetadataMap();
|
||||
HashMap<String, RequestConstraint> metadataMapOld = new HashMap<String, RequestConstraint>();
|
||||
// make a copy of original matedata map
|
||||
metadataMapOld.putAll(metadataMap);
|
||||
// obtain data catalog
|
||||
AbstractDataCatalog ac = getDataCatalog (metadataMap);
|
||||
if ( ac == null ) {
|
||||
return;
|
||||
}
|
||||
// change the parameters in the original metadata map
|
||||
ac.alterProductParameters(selectedKey, selectedString,
|
||||
(HashMap<String, RequestConstraint>) metadataMap);
|
||||
|
||||
// in addition to metadata map resource data needs to be modified
|
||||
// for CrossSectionResourceData
|
||||
if (data instanceof CrossSectionResourceData) {
|
||||
String theKeyToChange = null;
|
||||
Iterator<Map.Entry<String, RequestConstraint>> it = metadataMap
|
||||
.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
Map.Entry<String, RequestConstraint> pairs = (Map.Entry) it
|
||||
.next();
|
||||
String currentKey = (String) pairs.getKey();
|
||||
String currentValue = metadataMap.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (metadataMapOld.containsKey(currentKey)) {
|
||||
String oldValue = metadataMapOld.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (!oldValue.equalsIgnoreCase(currentValue)) {
|
||||
theKeyToChange = currentKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
String stationID = metadataMap.get(theKeyToChange)
|
||||
.getConstraintValue();
|
||||
List<String> stationIDs = Arrays.asList(stationID
|
||||
.split("\\s*,\\s*"));
|
||||
((CrossSectionResourceData) data).setStationIDs(stationIDs);
|
||||
}
|
||||
}
|
||||
|
||||
private AbstractDataCatalog getDataCatalog(
|
||||
HashMap<String, RequestConstraint> metadataMap) {
|
||||
String pluginName = null;
|
||||
String reportType = null;
|
||||
if (metadataMap.containsKey(PLUGIN_KEY)) {
|
||||
pluginName = metadataMap.get(PLUGIN_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (metadataMap.containsKey(REPORTYPE_KEY)) {
|
||||
reportType = metadataMap.get(REPORTYPE_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
String sourcesKey = pluginName + reportType;
|
||||
|
||||
SelectedData sd = new SelectedData(null, sourcesKey, null, null, null,
|
||||
null, null);
|
||||
return (AbstractDataCatalog) DataCatalogManager
|
||||
.getDataCatalogManager().getDataCatalog(sd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rData
|
||||
* @param selectedString
|
||||
*/
|
||||
private void alterContainer(IPointsToolContainer container,
|
||||
String selectedString) {
|
||||
Coordinate point = PointsDataManager.getInstance().getCoordinate(
|
||||
selectedString);
|
||||
container.setPointCoordinate(point);
|
||||
container.setPointLetter(selectedString);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bundleToAlter
|
||||
* @param line
|
||||
*/
|
||||
private void alterLines(Bundle bundleToAlter, String line) {
|
||||
for (AbstractRenderableDisplay display : bundleToAlter.getDisplays()) {
|
||||
if (display.getDescriptor() instanceof IBaseLinesContainer) {
|
||||
alterContainer((IBaseLinesContainer) display.getDescriptor(),
|
||||
line);
|
||||
ResourceList rl = display.getDescriptor().getResourceList();
|
||||
for (ResourcePair rp : rl) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof AbstractRequestableResourceData) {
|
||||
alterResource((AbstractRequestableResourceData) rData, LINES_KEY,
|
||||
line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param container
|
||||
* @param selectedString
|
||||
*/
|
||||
private void alterContainer(IBaseLinesContainer container,
|
||||
String selectedString) {
|
||||
LineString line = ToolsDataManager.getInstance().getBaseline(
|
||||
selectedString);
|
||||
container.setBaseLine(selectedString);
|
||||
container.setBaseLineString(line);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter#
|
||||
* getAlterables(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String[] getAlterables(String key) {
|
||||
if (key == POINTS_KEY) {
|
||||
return createPointArray();
|
||||
} else if (key == LINES_KEY) {
|
||||
return createLineArray();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter#
|
||||
* listenerSetup()
|
||||
*/
|
||||
@Override
|
||||
public void listenerSetup() {
|
||||
if (pointChangedListener == null) {
|
||||
pointChangedListener = new IPointChangedListener() {
|
||||
|
||||
@Override
|
||||
public void pointChanged() {
|
||||
notifyBundleListeners();
|
||||
}
|
||||
};
|
||||
PointsDataManager.getInstance().addPointsChangedListener(
|
||||
pointChangedListener);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter#
|
||||
* listenerShutdown()
|
||||
*/
|
||||
@Override
|
||||
public void listenerShutdown() {
|
||||
if (pointChangedListener != null) {
|
||||
PointsDataManager.getInstance().removePointsChangedListener(
|
||||
pointChangedListener);
|
||||
pointChangedListener = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Received notification of changes to points notify anyone interested in
|
||||
* the change.
|
||||
*/
|
||||
private void notifyBundleListeners() {
|
||||
AlterBundleChangeEvent event = new AlterBundleChangeEvent(
|
||||
new String[] { POINTS_KEY });
|
||||
fireAlterBundleChangeListener(event);
|
||||
}
|
||||
}
|
|
@ -77,6 +77,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* 07/31/2012 #875 rferrel Now uses points.
|
||||
* Feb 21, 2013 1617 bsteffen fixed vb sounding point selection for
|
||||
* points which contain the word Point
|
||||
* May 03, 2013 DR14824 mgamazaychikov Added alterProductParameters method
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -504,4 +505,17 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
|
|||
.startsWith("Point")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter product parameters
|
||||
*
|
||||
* @param selectedKey
|
||||
* @param selectedValue
|
||||
* @param productParameters
|
||||
*/
|
||||
public void alterProductParameters(
|
||||
String selectedKey,
|
||||
String selectedValue, HashMap<String, RequestConstraint> productParameters) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -136,6 +136,7 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* 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.
|
||||
* Apr 30, 2013 DR 16118 Qinglu Lin For reissue (followup NEW), called redrawFromWarned() in okPressed().
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -989,6 +990,11 @@ public class WarngenDialog extends CaveSWTDialog implements
|
|||
return;
|
||||
}
|
||||
|
||||
if (followupData != null && WarningAction.valueOf(followupData
|
||||
.getAct()) == WarningAction.NEW) {
|
||||
redrawFromWarned();
|
||||
}
|
||||
|
||||
if ((followupData == null || (WarningAction.valueOf(followupData
|
||||
.getAct()) == WarningAction.CON && warngenLayer
|
||||
.conWarnAreaChanged(followupData)))
|
||||
|
|
|
@ -172,6 +172,7 @@ import com.vividsolutions.jts.io.WKTReader;
|
|||
* 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/23/1013 DR 16064 Qinglu Lin Added removeDuplicateGid() and applies it in populateStrings().
|
||||
* 04/24/2013 1943 jsanchez Replaced used of areaConfig with areaSource.
|
||||
* </pre>
|
||||
*
|
||||
|
@ -2649,6 +2650,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
|||
Set<String> prefixes = new HashSet<String>(Arrays.asList(GeometryUtil
|
||||
.getGID(state.getWarningArea())));
|
||||
|
||||
prefixes = removeDuplicateGid(prefixes);
|
||||
|
||||
for (GeospatialData f : geoData.features) {
|
||||
Geometry geom = f.geometry;
|
||||
if (prefixes.contains(GeometryUtil.getPrefix(geom.getUserData()))) {
|
||||
|
@ -2954,4 +2957,46 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
|||
}
|
||||
return slope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Some counties/forecast zones have two GIDs, one is for the large portion of that
|
||||
* county and the other is for the small portion, e.g., inlets of a bay. Prince William
|
||||
* County, Virginia is such an example. As WarnGen needs to mark a hatched county with
|
||||
* only one W, one of the GIDs needs to be filtered out. The approach in the method is
|
||||
* to remove the GID for the area of smaller size.
|
||||
*/
|
||||
private Set<String> removeDuplicateGid(Set<String> prefixes) {
|
||||
|
||||
if (prefixes.size() < 2)
|
||||
return prefixes;
|
||||
|
||||
Map<String, Double> fipsSize = new HashMap<String, Double>();
|
||||
Map<String, String> namePrefix = new HashMap<String, String>();
|
||||
Iterator<String> iter = prefixes.iterator();
|
||||
String fips = null;
|
||||
String prefix = null;
|
||||
while (iter.hasNext()) {
|
||||
prefix = iter.next();
|
||||
double size = 0.0d;
|
||||
for (GeospatialData f : geoData.features) {
|
||||
fips = getFips(f);
|
||||
Geometry geom = f.geometry;
|
||||
if(prefix.equals(GeometryUtil.getPrefix(geom.getUserData()))) {
|
||||
size = geom.getArea();
|
||||
if (fipsSize.containsKey(fips)) {
|
||||
if (fipsSize.get(fips) < size) {
|
||||
fipsSize.put(fips, size);
|
||||
namePrefix.put(fips, prefix);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
fipsSize.put(fips, size);
|
||||
namePrefix.put(fips, prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new HashSet<String>(namePrefix.values());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -58,6 +58,8 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 29, 2013 DR 15715 dhuffman Near line 202; Transposed edex site and base precedence
|
||||
* per DR: loading was in reverse.
|
||||
* Apr 30, 2013 bsteffen Initial javadoc
|
||||
* Apr 30, 2013 1961 bsteffen Add ability to disable grib tables.
|
||||
*
|
||||
|
@ -199,8 +201,8 @@ public class GribModelLookup {
|
|||
|
||||
LocalizationFile[] modelFiles = PathManagerFactory.getPathManager()
|
||||
.listFiles(
|
||||
new LocalizationContext[] { edexStaticSite,
|
||||
edexStaticBase },
|
||||
new LocalizationContext[] { edexStaticBase,
|
||||
edexStaticSite },
|
||||
"grib" + IPathManager.SEPARATOR + "models", // Win32
|
||||
new String[] { ".xml" }, false, true);
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* routine.
|
||||
* 4 Dec 2012 #15569 lbousaidi fixed daily pp value when token is set to USE_REVCODE
|
||||
* 02 Feb 2012 #15845 lbousaidi added check for data that comes in as -999
|
||||
* 07 May 2013 #15880 lbousaidi changed pPE parameter because it was inserting to the
|
||||
* wrong hour field.
|
||||
* </pre>
|
||||
*
|
||||
* @author mnash
|
||||
|
@ -559,10 +561,10 @@ public class GagePP {
|
|||
|
||||
int minute = dt.get(Calendar.MINUTE);
|
||||
|
||||
if (((pPE.charAt(1) == 'P' && minute >= MINUTES_PER_HOUR
|
||||
- pOptions.getIntlppp()))
|
||||
|| (pPE.charAt(1) == 'C' && minute >= MINUTES_PER_HOUR
|
||||
- pOptions.getIntpc())) {
|
||||
if (rec.getPhysicalElement().getCode().charAt(1) == 'C'
|
||||
&& minute >= MINUTES_PER_HOUR - pOptions.getIntpc()
|
||||
|| (pPE.charAt(1) == 'P'
|
||||
&& minute >= MINUTES_PER_HOUR - pOptions.getIntlppp())) {
|
||||
hour++;
|
||||
dt.add(Calendar.HOUR_OF_DAY, 1);
|
||||
rec.setObsTime(dt.getTime());
|
||||
|
|
|
@ -52,6 +52,8 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 5, 2008 1649 snaples Initial creation
|
||||
* May 7, 2013 15880 lbousaidi changed minute_offset to offset in
|
||||
* in write_1_HourValue routine.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -253,7 +255,7 @@ public final class GagePPWrite {
|
|||
pHid.setTs(ts);
|
||||
pHid.setObsdate(obsDate);
|
||||
pHourpc.setId(pHid);
|
||||
pHourpc.setMinuteOffset(new String(minute_offset));
|
||||
pHourpc.setMinuteOffset(new String(offset));
|
||||
pHourpc.setHourlyQc(new String(qc));
|
||||
PrecipUtils.set_hour_slot_value(pHourpc, hr, newDataValue);
|
||||
rec = pHourpc;
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
further_licensing_information.
|
||||
-->
|
||||
<requestPatterns xmlns:ns2="group">
|
||||
<regex>AWIPS_*</regex>
|
||||
<regex>FAA_*</regex>
|
||||
<regex>WWLLN_*</regex>
|
||||
</requestPatterns>
|
|
@ -21,6 +21,7 @@ package com.raytheon.edex.plugin.warning.gis;
|
|||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -65,10 +66,16 @@ import com.raytheon.uf.edex.database.cluster.ClusterLockUtils.LockState;
|
|||
import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
||||
import com.raytheon.uf.edex.database.dao.CoreDao;
|
||||
import com.raytheon.uf.edex.database.dao.DaoConfig;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
import com.vividsolutions.jts.geom.GeometryCollection;
|
||||
import com.vividsolutions.jts.geom.GeometryCollectionIterator;
|
||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||
import com.vividsolutions.jts.geom.LineString;
|
||||
import com.vividsolutions.jts.geom.LinearRing;
|
||||
import com.vividsolutions.jts.geom.MultiPolygon;
|
||||
import com.vividsolutions.jts.geom.Point;
|
||||
import com.vividsolutions.jts.geom.Polygon;
|
||||
import com.vividsolutions.jts.geom.prep.PreparedGeometry;
|
||||
import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
|
||||
import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
|
||||
|
@ -85,6 +92,7 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
|
|||
* Jul 18, 2011 rjpeter Initial creation
|
||||
* Mar 29, 2012 #14691 Qinglu Lin Added returned value of getFeArea() of
|
||||
* AreaConfiguration to areaFields List.
|
||||
* May 7, 2013 15690 Qinglu Lin Added convertToMultiPolygon() and updated queryGeospatialData().
|
||||
* </pre>
|
||||
*
|
||||
* @author rjpeter
|
||||
|
@ -382,6 +390,36 @@ public class GeospatialDataGenerator {
|
|||
SpatialQueryResult[] features = SpatialQueryFactory.create().query(
|
||||
areaSource, areaFields.toArray(new String[areaFields.size()]),
|
||||
null, map, SearchMode.WITHIN);
|
||||
|
||||
// clip against County Warning Area
|
||||
String cwaSource = "cwa";
|
||||
List<String> cwaAreaFields = new ArrayList<String>(Arrays.asList("wfo", "gid"));
|
||||
HashMap<String, RequestConstraint> cwaMap = new HashMap<String, RequestConstraint>(
|
||||
2);
|
||||
cwaMap.put("wfo", new RequestConstraint(site, ConstraintType.LIKE));
|
||||
SpatialQueryResult[] cwaFeatures = SpatialQueryFactory.create().query(
|
||||
cwaSource, cwaAreaFields.toArray(new String[cwaAreaFields.size()]),
|
||||
null, cwaMap, SearchMode.WITHIN);
|
||||
Geometry multiPolygon = null;
|
||||
Geometry clippedGeom = null;
|
||||
for (int i = 0; i < features.length; i++) {
|
||||
multiPolygon = null;
|
||||
for (int j = 0; j < cwaFeatures.length; j++) {
|
||||
clippedGeom = features[i].geometry.intersection(cwaFeatures[j].geometry);
|
||||
if (clippedGeom instanceof GeometryCollection) {
|
||||
GeometryCollection gc = (GeometryCollection)clippedGeom;
|
||||
if (multiPolygon != null)
|
||||
multiPolygon = multiPolygon.union(convertToMultiPolygon(gc));
|
||||
else
|
||||
multiPolygon = convertToMultiPolygon(gc);
|
||||
}
|
||||
}
|
||||
if (multiPolygon != null)
|
||||
features[i].geometry = multiPolygon;
|
||||
else if (clippedGeom != null)
|
||||
features[i].geometry = clippedGeom;
|
||||
}
|
||||
|
||||
topologySimplifyQueryResults(features);
|
||||
|
||||
// convert to GeospatialData
|
||||
|
@ -398,6 +436,66 @@ public class GeospatialDataGenerator {
|
|||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a GeometryCollection to a MultiPolygon.
|
||||
* @param gc
|
||||
*/
|
||||
private static MultiPolygon convertToMultiPolygon(GeometryCollection gc) {
|
||||
GeometryCollectionIterator iter = new GeometryCollectionIterator(gc);
|
||||
Set<Polygon> polygons = new HashSet<Polygon>();
|
||||
MultiPolygon mp = null;
|
||||
iter.next();
|
||||
while (iter.hasNext()) {
|
||||
Object o = iter.next();
|
||||
if (o instanceof MultiPolygon) {
|
||||
if (mp == null)
|
||||
mp = (MultiPolygon)o;
|
||||
else
|
||||
mp = (MultiPolygon)mp.union((MultiPolygon)o);
|
||||
} else if (o instanceof Polygon) {
|
||||
polygons.add((Polygon)o);
|
||||
} else if (o instanceof LineString || o instanceof Point) {
|
||||
LinearRing lr = null;
|
||||
Coordinate[] coords = null;
|
||||
if (o instanceof LineString) {
|
||||
Coordinate[] cs = ((LineString) o).getCoordinates();
|
||||
if (cs.length < 4) {
|
||||
coords = new Coordinate[4];
|
||||
for (int j = 0; j< cs.length; j++)
|
||||
coords[j] = new Coordinate(cs[j]);
|
||||
for (int j = cs.length; j < 4; j++)
|
||||
coords[j] = new Coordinate(cs[3-j]);
|
||||
} else {
|
||||
coords = new Coordinate[cs.length+1];
|
||||
for (int j = 0; j < cs.length; j++)
|
||||
coords[j] = new Coordinate(cs[j]);
|
||||
coords[cs.length] = new Coordinate(cs[0]);
|
||||
}
|
||||
} else {
|
||||
coords = new Coordinate[4];
|
||||
for (int i = 0; i < 4; i++)
|
||||
coords[i] = ((Point)o).getCoordinate();
|
||||
}
|
||||
lr = (((Geometry)o).getFactory()).createLinearRing(coords);
|
||||
Polygon poly = (new GeometryFactory()).createPolygon(lr, null);
|
||||
polygons.add((Polygon)poly);
|
||||
} else {
|
||||
statusHandler.handle(Priority.WARN,
|
||||
"Unprocessed Geometry object: " + o.getClass().getName());
|
||||
}
|
||||
}
|
||||
if (mp == null && polygons.size() == 0)
|
||||
return null;
|
||||
if (polygons.size() > 0) {
|
||||
Polygon[] p = polygons.toArray(new Polygon[0]);
|
||||
if (mp != null)
|
||||
mp = (MultiPolygon)mp.union(new MultiPolygon(p, gc.getFactory()));
|
||||
else
|
||||
mp = new MultiPolygon(p, gc.getFactory());
|
||||
}
|
||||
return mp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simplifies the overall geometries using a single collection to preserve
|
||||
* boundaries. Geometries are updated in place.
|
||||
|
|
|
@ -19,16 +19,21 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.dataplugin.ffmp;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
|
@ -38,6 +43,8 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.serialization.adapters.FloatWKBReader;
|
||||
import com.raytheon.uf.common.serialization.adapters.FloatWKBWriter;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -128,9 +135,44 @@ public class HucLevelGeometriesFactory {
|
|||
|
||||
if (f.exists()) {
|
||||
try {
|
||||
File file = f.getFile();
|
||||
byte[] bytes = FileUtil.file2bytes(file, false);
|
||||
if (bytes[0] == (byte) 0x1f && bytes[1] == (byte) 0x8b) {
|
||||
// GZIP magic number is present, before 13.4.1 these
|
||||
// files were compressed and stored in a different
|
||||
// format, to maintain backwards compatibility we check
|
||||
// for compression and deserialize the old way. This
|
||||
// code can be removed any time after 13.5.1.
|
||||
System.out.println("Decompressing geometry files.");
|
||||
InputStream is = new ByteArrayInputStream(bytes);
|
||||
is = new GZIPInputStream(is, bytes.length);
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream(
|
||||
bytes.length * 3 / 2);
|
||||
byte[] buffer = new byte[1024 * 8];
|
||||
int numRead = 0;
|
||||
while ((numRead = is.read(buffer)) >= 0) {
|
||||
os.write(buffer, 0, numRead);
|
||||
}
|
||||
bytes = os.toByteArray();
|
||||
map = (Map<Long, Geometry>) SerializationUtil
|
||||
.transformFromThrift(FileUtil.file2bytes(
|
||||
f.getFile(), true));
|
||||
.transformFromThrift(Map.class, bytes);
|
||||
// save them back the new way.
|
||||
persistGeometryMap(dataKey, cwa, huc, map);
|
||||
} else {
|
||||
Map<Long, byte[]> serializableMap = (Map<Long, byte[]>) SerializationUtil
|
||||
.transformFromThrift(Map.class, bytes);
|
||||
FloatWKBReader reader = new FloatWKBReader(
|
||||
new GeometryFactory());
|
||||
map = new HashMap<Long, Geometry>(
|
||||
serializableMap.size());
|
||||
for (Entry<Long, byte[]> entry : serializableMap
|
||||
.entrySet()) {
|
||||
InputStream in = new ByteArrayInputStream(
|
||||
entry.getValue());
|
||||
Geometry geom = reader.readGeometry(in);
|
||||
map.put(entry.getKey(), geom);
|
||||
}
|
||||
}
|
||||
int sizeGuess = Math.max(
|
||||
Math.abs(pfafs.size() - map.size()), 10);
|
||||
pfafsToGenerate = new ArrayList<Long>(sizeGuess);
|
||||
|
@ -347,13 +389,23 @@ public class HucLevelGeometriesFactory {
|
|||
|
||||
protected synchronized void persistGeometryMap(String dataKey, String cwa,
|
||||
String huc, Map<Long, Geometry> map) throws Exception {
|
||||
|
||||
LocalizationContext lc = pathManager.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
LocalizationFile lf = pathManager.getLocalizationFile(lc,
|
||||
getGeomPath(dataKey, cwa, huc));
|
||||
FileUtil.bytes2File(SerializationUtil.transformToThrift(map),
|
||||
lf.getFile(), true);
|
||||
FloatWKBWriter writer = new FloatWKBWriter();
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(1024);
|
||||
Map<Long, byte[]> serializableMap = new HashMap<Long, byte[]>();
|
||||
for (Entry<Long, Geometry> entry : map.entrySet()) {
|
||||
writer.writeGeometry(entry.getValue(), bos);
|
||||
serializableMap.put(entry.getKey(), bos.toByteArray());
|
||||
bos.reset();
|
||||
}
|
||||
byte[] bytes = SerializationUtil.transformToThrift(serializableMap);
|
||||
FileUtil.bytes2File(bytes, lf.getFile(), false);
|
||||
lf.save();
|
||||
|
||||
}
|
||||
|
||||
protected synchronized String getGeomPath(String dataKey, String cwa,
|
||||
|
|
|
@ -35,6 +35,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 21, 2011 mschenke Initial creation
|
||||
* 05/02/2013 DR 14587 D. Friedman Store base velocity
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,6 +45,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
|
||||
public class RadarDataInterrogator {
|
||||
|
||||
public enum DataType { BASE_VELOCITY }
|
||||
|
||||
private double lastRange;
|
||||
|
||||
private double lastAzimuth;
|
||||
|
@ -75,12 +78,20 @@ public class RadarDataInterrogator {
|
|||
}
|
||||
|
||||
public int getDataValue(RadarRecord record, Coordinate latLon) {
|
||||
return getDataValue(record, latLon, (DataType) null);
|
||||
}
|
||||
|
||||
public int getDataValue(RadarRecord record, Coordinate latLon, DataType dataType) {
|
||||
this.record = record;
|
||||
return getDataValue(latLon);
|
||||
return getDataValue(latLon, dataType);
|
||||
}
|
||||
|
||||
public int getDataValue(Coordinate latLon) {
|
||||
int[] rval = getDataValues(new Coordinate[] { latLon });
|
||||
return getDataValue(latLon, null);
|
||||
}
|
||||
|
||||
public int getDataValue(Coordinate latLon, DataType dataType) {
|
||||
int[] rval = getDataValues(new Coordinate[] { latLon }, dataType);
|
||||
if (rval != null && rval.length > 0) {
|
||||
return rval[0];
|
||||
}
|
||||
|
@ -88,6 +99,10 @@ public class RadarDataInterrogator {
|
|||
return 0;
|
||||
}
|
||||
|
||||
public int[] getDataValues(Coordinate[] latLonArray) {
|
||||
return getDataValues(latLonArray, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to return the data value for the lat/lon passed in. Used for raster
|
||||
* and radial data. Use the getGraphicDataValue() method for graphic data.
|
||||
|
@ -95,7 +110,7 @@ public class RadarDataInterrogator {
|
|||
* @param latLon
|
||||
* @return
|
||||
*/
|
||||
public int[] getDataValues(Coordinate[] latLonArray) {
|
||||
public int[] getDataValues(Coordinate[] latLonArray, DataType dataType) {
|
||||
|
||||
double[] input = new double[latLonArray.length * 2];
|
||||
double[] output = new double[input.length];
|
||||
|
@ -207,7 +222,7 @@ public class RadarDataInterrogator {
|
|||
if (this.lastRadialIndex >= 0 && this.lastBin >= startBin
|
||||
&& this.lastRadialIndex < record.getNumRadials()
|
||||
&& this.lastBin < endBin) {
|
||||
if (record.srmData != null) {
|
||||
if (record.srmData != null && dataType != DataType.BASE_VELOCITY) {
|
||||
rval[index] = RadarRecordUtil.getSRMDataValue(
|
||||
record, this.lastRadialIndex, this.lastBin
|
||||
- startBin) & 0xFF;
|
||||
|
|
|
@ -228,8 +228,6 @@ fi
|
|||
cd ../${POSTGIS_SRC_DIR}
|
||||
_POSTGRESQL_ROOT=${RPM_BUILD_ROOT}/awips2/postgresql
|
||||
_POSTGRESQL_BIN=${_POSTGRESQL_ROOT}/bin
|
||||
# disable doc since it attempts to download files from
|
||||
# the internet
|
||||
./configure \
|
||||
--with-pgconfig=${_POSTGRESQL_BIN}/pg_config \
|
||||
--with-geosconfig=${_POSTGRESQL_BIN}/geos-config \
|
||||
|
@ -241,9 +239,25 @@ RC="$?"
|
|||
if [ ! "${RC}" = "0" ]; then
|
||||
exit 1
|
||||
fi
|
||||
# disable doc since it attempts to download files from
|
||||
# the internet
|
||||
echo "#Do Nothing" > doc/Makefile.in
|
||||
echo "docs:" > doc/Makefile
|
||||
echo "" >> doc/Makefile
|
||||
echo "docs-install:" >> doc/Makefile
|
||||
echo "" >> doc/Makefile
|
||||
echo "docs-uninstall:" >> doc/Makefile
|
||||
echo "" >> doc/Makefile
|
||||
echo "comments-install:" >> doc/Makefile
|
||||
echo "" >> doc/Makefile
|
||||
echo "comments-uninstall:" >> doc/Makefile
|
||||
echo "" >> doc/Makefile
|
||||
echo "clean:" >> doc/Makefile
|
||||
echo "" >> doc/Makefile
|
||||
make
|
||||
RC="$?"
|
||||
if [ ! "${RC}" = "0" ]; then
|
||||
# run make twice - the first time may fail due to doc
|
||||
make
|
||||
if [ $? -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
make install
|
||||
|
|
|
@ -375,11 +375,6 @@ if [ "${1}" = "-qpid" ]; then
|
|||
fi
|
||||
|
||||
if [ "${1}" = "-ldm" ]; then
|
||||
# Ensure that the user has root privileges.
|
||||
if [ ! ${UID} = 0 ]; then
|
||||
echo "ERROR: You must have root privileges to build ldm."
|
||||
exit 1
|
||||
fi
|
||||
buildRPM "awips2-ldm"
|
||||
|
||||
exit 0
|
Loading…
Add table
Reference in a new issue