13.4.1-6 baseline
Former-commit-id:5544c4a072
[formerly6fcbb5ae6b
] [formerly8379977673
] [formerly16fe8cc5a2
[formerly8379977673
[formerly f30c650b1c406889c38a5f82bbeda3605adbd9a5]]] Former-commit-id:16fe8cc5a2
Former-commit-id: f649c7ad7b4bf50f9a110308d2253393bb3d2506 [formerly979700c302
] Former-commit-id:5be793f2f9
This commit is contained in:
parent
450dbb7e8d
commit
5568ada76b
30 changed files with 1043 additions and 139 deletions
|
@ -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(?P<incc>(?:\s*\n)*(?:INCLUDING THE (?:CITIES|CITY) OF...)?)'
|
||||
cityh = r'(?<=-\n(?!.*-\n))(?P<incc>(?:.*\n))'
|
||||
|
||||
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)
|
||||
|
|
|
@ -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,73 +399,123 @@ public class MenuItemComposite extends Composite {
|
|||
return;
|
||||
}
|
||||
|
||||
// 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)
|
||||
for (Listener list : item.getListeners(SWT.Selection)) {
|
||||
Event event = new Event();
|
||||
event.type = SWT.Selection;
|
||||
event.widget = item;
|
||||
list.handleEvent(event);
|
||||
}
|
||||
|
||||
if (isDisposed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// handles the check boxes, if clicking the check box
|
||||
// need to not do this (because SWT does it already)
|
||||
// otherwise do it
|
||||
if (firstItem instanceof Button
|
||||
&& firstItem.getStyle() == SWT.CHECK) {
|
||||
if (e.widget != firstItem) {
|
||||
((Button) firstItem).setSelection(!((Button) firstItem)
|
||||
.getSelection());
|
||||
}
|
||||
}
|
||||
|
||||
// Handle radio selection changing...
|
||||
Control[] siblings = getParent().getChildren();
|
||||
for (int i = 0; i < siblings.length; i++) {
|
||||
final MenuItemComposite mic = (MenuItemComposite) siblings[i];
|
||||
if (mic.separator == false
|
||||
&& mic.getItem().getStyle() == SWT.RADIO) {
|
||||
try {
|
||||
MenuItemComposite parent = null;
|
||||
// check whether a Label is clicked or a
|
||||
// MenuItemComposite
|
||||
if (e.widget instanceof MenuItemComposite) {
|
||||
parent = (MenuItemComposite) e.widget;
|
||||
} else {
|
||||
parent = (MenuItemComposite) ((Control) e.widget)
|
||||
.getParent();
|
||||
}
|
||||
// check that the radio groups match
|
||||
if (mic.getData("radioGroup").equals(
|
||||
parent.getData("radioGroup"))) {
|
||||
if (!parent.getItem()
|
||||
.getText()
|
||||
.replaceAll("&", "")
|
||||
.equals(mic.getItem().getText().replaceAll(
|
||||
"&", ""))) {
|
||||
mic.getItem().setSelection(false);
|
||||
((Button) mic.firstItem)
|
||||
.setSelection(false);
|
||||
} else {
|
||||
mic.getItem().setSelection(true);
|
||||
((Button) mic.firstItem).setSelection(true);
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException e1) {
|
||||
e1.printStackTrace();
|
||||
/*
|
||||
* 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)
|
||||
for (Listener list : item.getListeners(SWT.Selection)) {
|
||||
Event event = new Event();
|
||||
event.type = SWT.Selection;
|
||||
event.widget = item;
|
||||
list.handleEvent(event);
|
||||
}
|
||||
|
||||
if (isDisposed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// handles the check boxes, if clicking the check box
|
||||
// need to not do this (because SWT does it already)
|
||||
// otherwise do it
|
||||
if (firstItem instanceof Button
|
||||
&& firstItem.getStyle() == SWT.CHECK) {
|
||||
if (e.widget != firstItem) {
|
||||
((Button) firstItem).setSelection(!((Button) firstItem)
|
||||
.getSelection());
|
||||
}
|
||||
}
|
||||
|
||||
// Handle radio selection changing...
|
||||
Control[] siblings = getParent().getChildren();
|
||||
for (int i = 0; i < siblings.length; i++) {
|
||||
final MenuItemComposite mic = (MenuItemComposite) siblings[i];
|
||||
if (mic.separator == false
|
||||
&& mic.getItem().getStyle() == SWT.RADIO) {
|
||||
try {
|
||||
MenuItemComposite parent = null;
|
||||
// check whether a Label is clicked or a
|
||||
// MenuItemComposite
|
||||
if (e.widget instanceof MenuItemComposite) {
|
||||
parent = (MenuItemComposite) e.widget;
|
||||
} else {
|
||||
parent = (MenuItemComposite) ((Control) e.widget)
|
||||
.getParent();
|
||||
}
|
||||
// check that the radio groups match
|
||||
if (mic.getData("radioGroup").equals(
|
||||
parent.getData("radioGroup"))) {
|
||||
if (!parent.getItem()
|
||||
.getText()
|
||||
.replaceAll("&", "")
|
||||
.equals(mic.getItem().getText().replaceAll(
|
||||
"&", ""))) {
|
||||
mic.getItem().setSelection(false);
|
||||
((Button) mic.firstItem)
|
||||
.setSelection(false);
|
||||
} else {
|
||||
mic.getItem().setSelection(true);
|
||||
((Button) mic.firstItem).setSelection(true);
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
if (arrow != null) {
|
||||
|
|
|
@ -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
|
||||
.toString());
|
||||
int tiltNum = 0;
|
||||
if ((ranks.length() > 0)
|
||||
&& !ranks.isEmpty()) {
|
||||
tiltNum = ranks.split(",").length - 1;
|
||||
}
|
||||
String rank = ranks.split(",")[tiltNum];
|
||||
String rank = currFeature
|
||||
.getValue(DMDAttributeIDs.STRENGTH_RANK
|
||||
.toString());
|
||||
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>
|
||||
|
@ -503,5 +504,18 @@ public abstract class AbstractDataCatalog implements IDataCatalog {
|
|||
return ((plane != null) && (plane.startsWith("Line") || plane
|
||||
.startsWith("Point")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Alter product parameters
|
||||
*
|
||||
* @param selectedKey
|
||||
* @param selectedValue
|
||||
* @param productParameters
|
||||
*/
|
||||
public void alterProductParameters(
|
||||
String selectedKey,
|
||||
String selectedValue, HashMap<String, RequestConstraint> productParameters) {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.
|
@ -48,6 +48,23 @@ import com.raytheon.uf.common.util.mapping.Alias;
|
|||
import com.raytheon.uf.common.util.mapping.AliasList;
|
||||
import com.raytheon.uf.common.util.mapping.MultipleMappingException;
|
||||
|
||||
/**
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class GribModelLookup {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GribModelLookup.class);
|
||||
|
@ -181,8 +198,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);
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
further_licensing_information.
|
||||
-->
|
||||
<requestPatterns xmlns:ns2="group">
|
||||
<regex>AWIPS_*</regex>
|
||||
<regex>FAA_*</regex>
|
||||
<regex>WWLLN_*</regex>
|
||||
</requestPatterns>
|
||||
</requestPatterns>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -375,6 +375,11 @@ 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
|
||||
|
|
|
@ -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