Merge branch 'omaha_14.3.1' into omaha_14.4.1

Conflicts:
	cave/com.raytheon.viz.core.gl/META-INF/MANIFEST.MF
	cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java
	cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/colordialog/ColorBar.java
	cots/org.geotools/.classpath
	cots/org.geotools/META-INF/MANIFEST.MF
	cots/org.geotools/build.properties
	edexOsgi/com.raytheon.edex.common/META-INF/MANIFEST.MF
	edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java
	edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java
	edexOsgi/com.raytheon.uf.common.derivparam/utility/common_static/base/derivedParameters/definitions/GH.xml
	edexOsgi/com.raytheon.uf.common.derivparam/utility/common_static/base/derivedParameters/definitions/RH.xml
	edexOsgi/com.raytheon.uf.common.style/src/com/raytheon/uf/common/style/level/Level.java
	edexOsgi/com.raytheon.uf.common.topo/src/com/raytheon/uf/common/topo/TopoQuery.java
	edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ContextManager.java

Former-commit-id: 518822ed83 [formerly 518822ed83 [formerly f8cb49d46f88b801a682a34a3b7056bde1ab2569]]
Former-commit-id: b6af2db9f5
Former-commit-id: 14b1ea307f
This commit is contained in:
Steve Harris 2014-05-22 14:31:06 -05:00
commit d226dfb021
52 changed files with 1129 additions and 261 deletions

View file

@ -181,6 +181,7 @@ import com.vividsolutions.jts.geom.Point;
* Jan 21, 2014 DR 15874 gzhang Use getValue() for QPFSCAN independent.
* Feb 19, 2014 2819 randerso Removed unnecessary .clone() call
* Mar 3, 2014 2804 mschenke Set back up clipping pane
* Apr 30, 2014 DR 16148 gzhang Filter Basin Dates for Trend and Table Gap.
* May 05, 2014 3026 mpduff Display Hpe bias source.
* </pre>
*
@ -3153,6 +3154,9 @@ public class FFMPResource extends
Date oldestRefTime = getOldestTime();
Date mostRecentRefTime = getPaintTime().getRefTime();
Date barrierTime = getTableTime();// DR 16148
Date minUriTime = getTimeOrderedKeys().get(0);// DR 16148
// grabs the basins we need
try {
rateBasin = monitor.getGraphRateBasin(getProduct(), getSiteKey(),
@ -3165,6 +3169,9 @@ public class FFMPResource extends
if (rateBasin != null) {
for (Date date : rateBasin.getValues().keySet()) {
if (date.before(minUriTime) || date.before(barrierTime) || date.after(mostRecentRefTime))
continue;// DR 16148
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
date);
fgd.setRate(dtime, (double) rateBasin.getValue(date));
@ -3190,6 +3197,9 @@ public class FFMPResource extends
for (Date date : qpeBasin.getValues().keySet()) {
if (date.before(minUriTime) || date.before(barrierTime) || date.after(mostRecentRefTime))
continue;// DR 16148
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
date);
double currVal = qpeBasin.getAccumValue(date,

View file

@ -318,7 +318,7 @@
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 02APR2014 17211 zhao (code obtained from the listserver via Virgil that implements a new rule regarding CB, TS etc)
#
# May 12, 2014 16928 zhao Modified check_prev_time()
#
#
import exceptions, re, time, types
@ -939,6 +939,8 @@ class Decoder(tpg.VerboseParser):
try:
if t['from'] <= max(period['prev']['time']['from'], self._cutoff):
add_msg(t, 'error', 49)
elif t['from'] <= self._taf['vtime']['from']:
add_msg(t, 'error', 49)
if 'ocnl' in period and t['from'] < period['ocnl']['time']['to']:
add_msg(t, 'error', 50)
period['prev']['time']['to'] = t['from']

View file

@ -101,6 +101,8 @@ import com.vividsolutions.jts.geom.LineString;
* 01-28-2014 DR16465 mgamazaychikov Fixed the problem with anchor point when frame
* count changes; made line width configurable.
* 04-07-2014 DR 17232 D. Friedman Make sure pivot indexes are valid.
* 04-24-2014 DR 16356 Qinglu Lin Updated generateTrackInfo(), generateNewTrackInfo(),
* and createTrack().
*
* </pre>
*
@ -691,6 +693,14 @@ public class StormTrackDisplay implements IRenderable {
if (cachedTrack != null) {
cachedTrack.dispose();
}
if (StormTrackState.trackType.equals("lineOfStorms") && state.justSwitchedToLOS) {
GeodeticCalculator gc = new GeodeticCalculator();
Coordinate[] coords = state.dragMeGeom.getCoordinates();
gc.setStartingGeographicPoint(coords[0].x, coords[0].y);
gc.setDestinationGeographicPoint(coords[coords.length - 1].x,
coords[coords.length - 1].y);
state.angle = adjustAngle(gc.getAzimuth() - 90);
}
generateTrackInfo(state, paintProps);
if (state.mode == Mode.TRACK) {
createTrack(target, paintProps);
@ -703,6 +713,9 @@ public class StormTrackDisplay implements IRenderable {
state.lineWidth, state.lineStyle);
paintLabels(target, paintProps);
}
if (StormTrackState.trackType.equals("lineOfStorms") && state.justSwitchedToLOS) {
state.angle = StormTrackState.oneStormAngle;
}
}
/**
@ -781,6 +794,10 @@ public class StormTrackDisplay implements IRenderable {
currentState.pointMoved = false;
currentState.originalTrack = false;
moved = true;
if (StormTrackState.trackType.equals("lineOfStorms") &&
currentState.justSwitchedToLOS) {
currentState.justSwitchedToLOS = false;
}
}
currentDisplayedTimes = trackUtil.getDataTimes(paintProps
@ -959,6 +976,7 @@ public class StormTrackDisplay implements IRenderable {
state.futurePoints = futurePoints;
state.angle = angle;
StormTrackState.oneStormAngle = angle;
state.speed = speed;
postData(state);
@ -995,7 +1013,11 @@ public class StormTrackDisplay implements IRenderable {
coords[coords.length - 1].y);
angle = adjustAngle(gc.getAzimuth() - 90);
} else {
angle = adjustAngle(std.getMotionDirection());
if (state.justSwitchedToOS) {
angle = StormTrackState.oneStormAngle;
} else {
angle = adjustAngle(std.getMotionDirection());
}
}
state.angle = angle;
state.speed = speed;
@ -1182,6 +1204,11 @@ public class StormTrackDisplay implements IRenderable {
compiler.handle(gf.createLineString(coords));
double angle = state.angle;
if(!state.justSwitchedToOS) {
if (StormTrackState.trackType.equals("oneStorm")) {
StormTrackState.oneStormAngle = angle;
}
}
// Draw ticks, X and Arrow
for (int i = 0; i < orig.length - 1; ++i) {
GeodeticCalculator gc = new GeodeticCalculator();
@ -1189,6 +1216,10 @@ public class StormTrackDisplay implements IRenderable {
gc.setDestinationGeographicPoint(orig[i + 1].x, orig[i + 1].y);
angle = gc.getAzimuth();
if (state.justSwitchedToLOS) {
angle = 90.0;
state.justSwitchedToLOS = false;
}
if (i == state.displayedPivotIndex) {
double tickLen = SQRT_2 * tickLengthInMeters;

View file

@ -47,6 +47,8 @@ import com.vividsolutions.jts.geom.Point;
* 11/29/2012 15571 Qinglu Lin Added compuateCurrentStormCenter();
* 15Mar2013 15693 mgamazaychikov Added magnification.
* 06-24-2013 DR 16317 D. Friedman Handle "motionless" track.
* 04-24-2014 DR 16356 Qinglu Lin Added newWarnGen, oneStormAngle, justSwitchedToLOS,
* justSwitchedToOS, and trackType.
*
* </pre>
*
@ -198,6 +200,16 @@ public class StormTrackState {
private boolean initiallyMotionless;
public static boolean newWarnGen = true;
public static double oneStormAngle = Double.NaN;
public boolean justSwitchedToLOS = false;
public boolean justSwitchedToOS = false;
public static String trackType = null;
/** Compute the coordinate of the storm center at the time defined by dataTime via interpolation. */
public boolean compuateCurrentStormCenter(Coordinate coord, DataTime dateTime) {
if (futurePoints == null) return false;

View file

@ -362,6 +362,12 @@
id="com.raytheon.viz.gfe.SiteActivation"
name="GFE Site Activation">
</command>
<command
categoryId="com.raytheon.viz.gfe.GFECategory"
description="Coordinate Conversion"
id="com.raytheon.viz.gfe.CoordinateConversion"
name="GFE Coordinate Conversion">
</command>
<category
description="GFE Edit Tools"
id="com.raytheon.viz.ui.modalTool.gfe"
@ -975,6 +981,10 @@
</reference>
</activeWhen>
</handler>
<handler
class="com.raytheon.viz.gfe.actions.CoordinateConversionHandler"
commandId="com.raytheon.viz.gfe.CoordinateConversion">
</handler>
<handler
class="com.raytheon.viz.gfe.export.image.GfeExportImageHandler"
commandId="com.raytheon.uf.viz.image.export.save">
@ -1143,6 +1153,13 @@
label="Site Activation..."
style="push">
</command>
<!-- Commented out for now. May re-enable when DR #15463 is worked
<command
commandId="com.raytheon.viz.gfe.CoordinateConversion"
label="Coordinate Conversion..."
style="push">
</command>
-->
</menu>
<menu label="WeatherElement" mnemonic="W">
<visibleWhen>

View file

@ -0,0 +1,83 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.gfe.actions;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
import com.raytheon.viz.gfe.dialogs.CoordinateConversionDialog;
/**
* Handler to display the Coordinate Conversion Dialog
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 13, 2014 #3069 randerso Added to help debug GeoTools 10.5 issues.
* May partially address Dimensions DR 15463
* plugin.xml menu entry commented out so can't be activated
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class CoordinateConversionHandler extends AbstractHandler {
private CoordinateConversionDialog dialog;
/*
* (non-Javadoc)
*
* @see
* org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
* ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
DataManager dm = DataManagerUIFactory.getCurrentInstance();
if (dm == null) {
return null;
}
if ((dialog == null) || (dialog.getShell() == null)
|| dialog.isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
dialog = new CoordinateConversionDialog(shell, dm);
dialog.setBlockOnOpen(false);
dialog.open();
} else {
dialog.bringToTop();
}
return null;
}
}

View file

@ -0,0 +1,307 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.gfe.dialogs;
import java.text.DecimalFormat;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.opengis.metadata.spatial.PixelOrientation;
import com.raytheon.uf.common.dataplugin.gfe.config.ProjectionData;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Coordinate Conversion Dialog
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 13, 2014 #3069 randerso Added to help debug GeoTools 10.5 issues.
* May partially address Dimensions DR 15463.
* plugin.xml menu entry comnmented out so can't be activated
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class CoordinateConversionDialog extends CaveJFACEDialog {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(CoordinateConversionDialog.class);
private DataManager dataMgr;
private GridLocation gloc;
private ProjectionData awipsProj;
private DecimalFormat df;
private Text lonText;
private Text latText;
private Text awipsXText;
private Text awipsYText;
private Text gfeXText;
private Text gfeYText;
/**
* @param parentShell
* @param dataMgr
*/
public CoordinateConversionDialog(Shell parentShell, DataManager dataMgr) {
super(parentShell);
this.dataMgr = dataMgr;
gloc = this.dataMgr.getParmManager().compositeGridLocation();
awipsProj = gloc.getProjection();
df = new DecimalFormat("###0.####;-###0.####");
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
* .Shell)
*/
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("Coordinate Conversion");
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveJFACEDialog#createDialogArea(org.eclipse
* .swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite comp = (Composite) super.createDialogArea(parent);
((GridLayout) comp.getLayout()).numColumns = 3;
// listener to validate numeric entry and update computed fields
KeyListener keyListener = new KeyListener() {
@Override
public void keyReleased(KeyEvent e) {
if (e.character != '.') {
Object source = e.getSource();
if ((source == lonText) || (source == latText)) {
updateLonLat();
} else if ((source == awipsXText) || (source == awipsYText)) {
updateAwips();
} else if ((source == gfeXText) || (source == gfeYText)) {
updateGfe();
}
}
}
@Override
public void keyPressed(KeyEvent e) {
if (!Character.isISOControl(e.character)) {
Text source = (Text) e.getSource();
String text = source.getText();
Point selection = source.getSelection();
text = text.substring(0, selection.x) + e.character
+ text.substring(selection.y);
try {
Double.parseDouble(text);
} catch (NumberFormatException e1) {
e.doit = false;
getShell().getDisplay().beep();
}
}
}
};
Label label = new Label(comp, SWT.RIGHT);
GridData layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
label.setLayoutData(layoutData);
label.setText("Lon/Lat");
lonText = new Text(comp, SWT.RIGHT | SWT.SINGLE | SWT.BORDER);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
lonText.setLayoutData(layoutData);
lonText.addKeyListener(keyListener);
latText = new Text(comp, SWT.RIGHT | SWT.SINGLE | SWT.BORDER);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
latText.setLayoutData(layoutData);
latText.addKeyListener(keyListener);
label = new Label(comp, SWT.RIGHT);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
label.setLayoutData(layoutData);
label.setText(gloc.getProjection().getProjectionID());
awipsXText = new Text(comp, SWT.RIGHT | SWT.SINGLE | SWT.BORDER);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
awipsXText.setLayoutData(layoutData);
awipsXText.addKeyListener(keyListener);
awipsYText = new Text(comp, SWT.RIGHT | SWT.SINGLE | SWT.BORDER);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
awipsYText.setLayoutData(layoutData);
awipsYText.addKeyListener(keyListener);
label = new Label(comp, SWT.RIGHT);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
label.setLayoutData(layoutData);
label.setText(gloc.getSiteId());
gfeXText = new Text(comp, SWT.RIGHT | SWT.SINGLE | SWT.BORDER);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gfeXText.setLayoutData(layoutData);
gfeXText.addKeyListener(keyListener);
gfeYText = new Text(comp, SWT.RIGHT | SWT.SINGLE | SWT.BORDER);
layoutData = new GridData(SWT.FILL, SWT.CENTER, true, false);
gfeYText.setLayoutData(layoutData);
gfeYText.addKeyListener(keyListener);
gfeXText.setText("0");
gfeYText.setText("0");
updateGfe();
return comp;
}
private double getDoubleValue(Text text) {
String s = text.getText();
if (s.isEmpty()) {
return 0;
} else {
return Double.parseDouble(s);
}
}
private void updateLonLat() {
double lon = getDoubleValue(lonText);
double lat = getDoubleValue(latText);
Coordinate lonLat = new Coordinate(lon, lat);
// lonText.setText(df.format(lon));
// latText.setText(df.format(lat));
try {
Coordinate gridCell = MapUtil.latLonToGridCoordinate(lonLat,
PixelOrientation.CENTER, gloc);
gfeXText.setText(df.format(gridCell.x));
gfeYText.setText(df.format(gloc.getNy() - gridCell.y - 1));
} catch (Exception e) {
statusHandler.error(e.getLocalizedMessage(), e);
gfeXText.setText("");
gfeYText.setText("");
}
try {
Coordinate awips = awipsProj.latLonToGridCoordinate(lonLat);
awipsXText.setText(df.format(awips.x));
awipsYText.setText(df.format(awips.y));
} catch (Exception e) {
statusHandler.error(e.getLocalizedMessage(), e);
awipsXText.setText("");
awipsYText.setText("");
}
}
private void updateAwips() {
double x = getDoubleValue(awipsXText);
double y = getDoubleValue(awipsYText);
// awipsXText.setText(df.format(x));
// awipsYText.setText(df.format(y));
Coordinate awips = new Coordinate(x, y);
Coordinate lonLat;
try {
lonLat = awipsProj.gridCoordinateToLatLon(awips);
lonText.setText(df.format(lonLat.x));
latText.setText(df.format(lonLat.y));
try {
Coordinate gridCell = MapUtil.latLonToGridCoordinate(lonLat,
PixelOrientation.CENTER, gloc);
gfeXText.setText(df.format(gridCell.x));
gfeYText.setText(df.format(gloc.getNy() - gridCell.y - 1));
} catch (Exception e) {
statusHandler.error(e.getLocalizedMessage(), e);
gfeXText.setText("");
gfeYText.setText("");
}
} catch (Exception e) {
statusHandler.error(e.getLocalizedMessage(), e);
lonText.setText("");
latText.setText("");
gfeXText.setText("");
gfeYText.setText("");
}
}
private void updateGfe() {
double x = getDoubleValue(gfeXText);
double y = getDoubleValue(gfeYText);
Coordinate gridCell = new Coordinate(x, gloc.getNy() - y - 1);
// gfeXText.setText(df.format(x));
// gfeYText.setText(df.format(y));
Coordinate lonLat = gloc.latLonCenter(gridCell);
lonText.setText(df.format(lonLat.x));
latText.setText(df.format(lonLat.y));
try {
Coordinate awips = awipsProj.latLonToGridCoordinate(lonLat);
awipsXText.setText(df.format(awips.x));
awipsYText.setText(df.format(awips.y));
} catch (Exception e) {
statusHandler.error(e.getLocalizedMessage(), e);
awipsXText.setText("");
awipsYText.setText("");
}
}
}

View file

@ -157,6 +157,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* aren't being corrected.
* 02/05/2014 17022 ryu Modified loadDraft() to fix merging of WMO heading and AWIPS ID.
* 03/25/2014 #2884 randerso Added xxxid to check for disabling editor
* 05/12/2014 16195 zhao Modified widgetSelected() for "Auto Wrap" option widget
*
* </pre>
*
@ -865,7 +866,8 @@ public class ProductEditorComp extends Composite implements
autoWrapMI.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
textComp.setAutoWrapMode(autoWrapMI.getSelection());
wrapMode = !wrapMode;
textComp.setAutoWrapMode(wrapMode);
}
});

View file

@ -25,6 +25,7 @@ import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IRenderable;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
@ -46,6 +47,9 @@ import com.vividsolutions.jts.geom.Geometry;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 5, 2008 chammack Initial creation
* May 15, 2014 #3069 randerso Made labelSpacing settable.
* Fixed label coordinates after ReferencedGeometry
* was made non-destructive.
*
* </pre>
*
@ -63,6 +67,8 @@ public class JTSRenderable implements IRenderable {
private RGB color = ColorUtil.WHITE;
private int labelSpacing = 50;
/**
* @return the color
*/
@ -93,6 +99,10 @@ public class JTSRenderable implements IRenderable {
this.lineWidth = lineWidth;
}
public void setLabelSpacing(int labelSpacing) {
this.labelSpacing = labelSpacing;
}
private float lineWidth = 1.0f;
public JTSRenderable() {
@ -127,17 +137,17 @@ public class JTSRenderable implements IRenderable {
@Override
public void paint(IGraphicsTarget target, PaintProperties paintProps)
throws VizException {
EditToolPaintProperties etpp = (EditToolPaintProperties) paintProps;
IDescriptor descriptor = ((EditToolPaintProperties) paintProps)
.getDescriptor();
if (this.wireframeShape == null) {
this.wireframeShape = target.createWireframeShape(true,
etpp.getDescriptor());
this.wireframeShape = target.createWireframeShape(true, descriptor);
}
if (!this.pendingGeometies.isEmpty()) {
JTSCompiler jtsCompiler = new JTSCompiler(null, wireframeShape,
etpp.getDescriptor());
descriptor);
while (!this.pendingGeometies.isEmpty()) {
Geometry geom = this.pendingGeometies.remove();
jtsCompiler.handle(geom);
@ -146,10 +156,11 @@ public class JTSRenderable implements IRenderable {
String label = (String) geom.getUserData();
double[] coord = new double[2];
int numCoords = geom.getNumPoints();
for (int j = 0; j < numCoords; j += 50) {
for (int j = 0; j < numCoords; j += this.labelSpacing) {
Coordinate c = geom.getCoordinates()[j];
coord[0] = c.x;
coord[1] = c.y;
coord = descriptor.worldToPixel(coord);
this.wireframeShape.addLabel(label, coord);
}
}

View file

@ -117,6 +117,8 @@ import com.vividsolutions.jts.geom.LineString;
* drawing and calculating new grid.
* Aug 08, 2012 #621 dgilling Fix ConcurrentModificationException
* in handling of renderables field.
* May 15, 2014 #3069 randerso Changed to compute contour label spacing variable
* based on subsample setting
*
* </pre>
*
@ -212,7 +214,7 @@ public class ContourTool extends AbstractFreeformTool implements
Point gridSize = gloc.gridSize();
int newX = ((gridSize.x - 1) / subFactor) + 1;
int newY = ((gridSize.y - 1) / subFactor) + 1;
if (newX <= 5 || newY <= 5) {
if ((newX <= 5) || (newY <= 5)) {
int tmpX = gridSize.x / 5;
int tmpY = gridSize.y / 5;
subFactor = Math.min(tmpX, tmpY);
@ -228,14 +230,14 @@ public class ContourTool extends AbstractFreeformTool implements
}
private RemapGrid getToLowRes() {
if (toLowRes == null && currentGrid != null) {
if ((toLowRes == null) && (currentGrid != null)) {
computeRemaps();
}
return toLowRes;
}
private RemapGrid getToHiRes() {
if (toHiRes == null && currentGrid != null) {
if ((toHiRes == null) && (currentGrid != null)) {
computeRemaps();
}
return toHiRes;
@ -319,9 +321,6 @@ public class ContourTool extends AbstractFreeformTool implements
refresh();
}
/**
*
*/
private void replaceCLines(List<CLine> contours) {
clearRenderables();
@ -335,6 +334,7 @@ public class ContourTool extends AbstractFreeformTool implements
JTSRenderable renderable = new JTSRenderable();
renderable.setLineWidth(2.0f);
renderable.setColor(contourColor);
renderable.setLabelSpacing(200 / subSample);
for (CLine contour : contours) {
LineString ls = contour.getLineString();
if (ls == null) {
@ -1141,8 +1141,8 @@ public class ContourTool extends AbstractFreeformTool implements
sumLoc.x += coords.get(i).x;
sumLoc.y += coords.get(i).y;
}
sumLoc.x = sumLoc.x / (end - start + 1);
sumLoc.y = sumLoc.y / (end - start + 1);
sumLoc.x = sumLoc.x / ((end - start) + 1);
sumLoc.y = sumLoc.y / ((end - start) + 1);
return sumLoc;
} else {
int i;
@ -1154,8 +1154,8 @@ public class ContourTool extends AbstractFreeformTool implements
sumLoc.x += coords.get(i).x;
sumLoc.y += coords.get(i).y;
}
sumLoc.x = sumLoc.x / (start - end + 1);
sumLoc.y = sumLoc.y / (start - end + 1);
sumLoc.x = sumLoc.x / ((start - end) + 1);
sumLoc.y = sumLoc.y / ((start - end) + 1);
return sumLoc;
}
}
@ -1182,7 +1182,7 @@ public class ContourTool extends AbstractFreeformTool implements
double distance = line.getCoordinateN(0).distance(
line.getCoordinateN(line.getNumPoints() - 1));
if (distance < 3 * (cellSize.x + cellSize.y) / 2) {
if (distance < ((3 * (cellSize.x + cellSize.y)) / 2)) {
return true;
}
@ -1260,7 +1260,7 @@ public class ContourTool extends AbstractFreeformTool implements
public void addContextMenuItems(IMenuManager menuManager, int x, int y) {
Parm activeParm = dataManager.getSpatialDisplayManager()
.getActivatedParm();
if (activeParm != null
if ((activeParm != null)
&& activeParm.getGridInfo().getGridType()
.equals(GridType.SCALAR)) {
@ -1668,7 +1668,7 @@ public class ContourTool extends AbstractFreeformTool implements
@Override
public void gridDataChanged(ParmID parmId, TimeRange validTime) {
if (currentGrid != null
if ((currentGrid != null)
&& currentGrid.getParm().getParmID().equals(parmId)
&& currentGrid.getGridTime().equals(validTime)) {
initializeContourData(getGrid());
@ -1681,7 +1681,7 @@ public class ContourTool extends AbstractFreeformTool implements
@Override
public void parmInventoryChanged(Parm parm, TimeRange affectedTimeRange) {
if (currentGrid != null
if ((currentGrid != null)
&& parm.getParmID().equals(currentGrid.getParm().getParmID())
&& affectedTimeRange.contains(currentGrid.getGridTime())) {
initializeContourData(getGrid());

View file

@ -60,6 +60,7 @@ import com.raytheon.viz.gfe.smartscript.FieldDefinition.FieldType;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 30, 2012 randerso Initial creation
* May 12, 2014 16167 ryu Fix sizing and accessibility of content.
*
* </pre>
*
@ -72,7 +73,7 @@ public class DialogAreaComposite extends ScrolledComposite {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(DialogAreaComposite.class);
private static final double MAX_HEIGHT_RATIO = 0.85;
private static final double MAX_HEIGHT_RATIO = 0.80;
private static final double MAX_WIDTH_RATIO = 0.85;
@ -225,30 +226,27 @@ public class DialogAreaComposite extends ScrolledComposite {
}
}
Point compositeSize = varFrame.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int xSize = compositeSize.x;
int ySize = compositeSize.y;
this.setMinSize(new Point(xSize, ySize));
this.setExpandHorizontal(true);
this.setExpandVertical(true);
Rectangle monitorBounds = this.getDisplay().getPrimaryMonitor()
.getBounds();
int maxXSize = (int) (monitorBounds.width * MAX_WIDTH_RATIO);
int maxYSize = (int) (monitorBounds.height * MAX_HEIGHT_RATIO);
Point compositeSize = varFrame.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int xSize = compositeSize.x;
int ySize = compositeSize.y;
if (xSize > maxXSize) {
xSize = maxXSize;
}
if (ySize > maxYSize) {
ySize = maxYSize;
}
maxXSize = Math.min(maxXSize, xSize);
maxYSize = Math.min(maxYSize, ySize);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.heightHint = ySize;
gd.widthHint = xSize;
gd.heightHint = maxYSize;
gd.widthHint = maxXSize;
this.setLayoutData(gd);
this.setMinSize(new Point(xSize, ySize));
this.setExpandHorizontal(true);
this.setExpandVertical(true);
// Make sure widgets are scrolled into view when they gain focus
// see:
// http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/ScrollSWTwidgetsintoviewwhentheygetfocus.htm

View file

@ -71,6 +71,7 @@ import com.raytheon.viz.hydrocommon.util.DbUtils;
* May 30 2012 14967 wkwock overload insertRejectedData method
* Feb 22 2013 14676 lbousaidi check when producttime is null
* Mar 25, 2013 1781 mpduff Constrain time series table query with a start time.
* May 12 2014 16705 lbousaidi update revision and shef_qual_code in edit routine.
* </pre>
*
* @author dhladky
@ -1167,6 +1168,8 @@ public class TimeSeriesDataManager extends HydroDataManager {
SqlBuilder sql = new SqlBuilder(tablename);
sql.setSqlType(SqlBuilder.UPDATE);
sql.addDouble("value", data.getValue());
sql.addString("shef_qual_code", "M");
sql.addInt("revision", 1);
sql.addString("postingTime", HydroConstants.DATE_FORMAT.format(now));
if (data.getProductTime() == null) {
sql.addString(

View file

@ -71,10 +71,13 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 4, 2008 lvenable Initial creation
* Sep 4, 2008 lvenable Initial creation
* Dec 11, 2008 1787 askripsk Connect to DB
* Apr 18, 2013 1790 rferrel Make dialog non-blocking.
* Mar 31, 2014 #2970 lvenable Put dispose checks in the runAsync calls.
* May 1, 2014 17096 xwei By default the first item of the data
* list is selected
*
*
* </pre>
*
@ -642,7 +645,7 @@ public class DataIngestFilterDlg extends CaveSWTDialog {
typeSrcLbl.setEnabled(false);
typeSrcLbl.setLayoutData(gd);
gd = new GridData();
gd = new GridData(SWT.FILL, SWT.CENTER, false, true);
gd.horizontalSpan = 3;
typeSrcFilterCbo = new Combo(filterGroup, SWT.DROP_DOWN | SWT.READ_ONLY);
typeSrcFilterCbo.select(0);
@ -1045,6 +1048,8 @@ public class DataIngestFilterDlg extends CaveSWTDialog {
if (ingestDataList.getItemCount() > 0) {
updateDialogState(DialogStates.DATA_AVAILABLE);
ingestDataList.select(0);
updateSelectedInformation();
} else {
updateDialogState(DialogStates.NO_DATA);
}

View file

@ -37,6 +37,8 @@ import com.raytheon.viz.hydrocommon.data.DataIngestFilterData;
* ------------ ---------- ----------- --------------------------
* Dec 11, 2008 1787 askripsky Initial Creation
* Apr 18, 2013 1790 rferrel Code clean up with non-blocking dialogs.
* May 1, 2014 17096 xwei Updated the filter list SQL statement
*
*
* </pre>
*
@ -220,7 +222,7 @@ public class DataIngestFilterDataManager {
StringBuffer whereClause = new StringBuffer();
if (filterByLocation) {
whereClause.append("lid like '%" + selectedLocation + "%'");
whereClause.append( "lid='" + selectedLocation + "'" );
}
if (filterByPE && (selectedPE.size() > 0)) {

View file

@ -22,6 +22,7 @@ package com.raytheon.viz.mpe.ui.actions;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
@ -58,6 +59,8 @@ import com.raytheon.viz.mpe.ui.MPEDisplayManager;
* Dec 11, 2012 mschenke Initial creation
* Feb 2, 2014 16201 snaples Added saved data flag support
*
* Apr29, 2014 16308 lbousaidi transmit RFC Bias when an hour
* MPE is saved via the GUI.
* </pre>
*
* @author mschenke
@ -256,13 +259,21 @@ public class SaveBestEstimate {
boolean transmit_bias_on_save = appsDefaults.getBoolean(
"transmit_bias_on_save", true);
if (transmit_rfc_bias && transmit_bias_on_save) {
// sprintf ( command_string, "%s/transmit_rfc_bias %s",
// precip_proc_bin_dir, cdate );
// UFStatus.handle(Priority.VERBOSE, Activator.PLUGIN_ID,
// StatusConstants.CATEGORY_MPE, null,
// String.format("Invoking transmit_rfc_bias script using command:\n"
// "%s\n", command_string ));
// system ( command_string );
Date currentDate = MPEDisplayManager.getCurrent().getCurrentEditDate();
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHH");
String transmitDate = formatter.format(currentDate);
String scriptDir = appsDefaults.getToken("pproc_bin");
String scriptName = "transmit_rfc_bias";
ProcessBuilder pb = new ProcessBuilder(scriptDir + "/" + scriptName,
transmitDate);
try {
pb.start();
} catch (IOException e) {
e.printStackTrace();
}
}
MPEDisplayManager.getCurrent().setSavedData(true);
}

View file

@ -23,6 +23,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.TimeZone;
@ -32,10 +33,10 @@ import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@ -72,6 +73,7 @@ import com.raytheon.viz.mpe.ui.radartable.ReadBiasTableParam;
* Feb 2, 2014 16201 snaples Added saved data flag support
* Apr 4, 2014 17223 snaples Updated other_office_id and rfc_bias to object
* array so that called procedure can update and return values properly.
* May 1, 2014 16626 snaples Updated the Manual Bias button to allow revert to original value.
*
* </pre>
*
@ -148,6 +150,10 @@ public class RadarBiasTableDialog extends Dialog {
Button[] manEdit = null;
Text[] lbTxts = null;
private final Map<String, Integer> biasChgs = new HashMap<String, Integer>();
static {
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
pgsdf.setTimeZone(TimeZone.getTimeZone("GMT"));
@ -343,7 +349,7 @@ public class RadarBiasTableDialog extends Dialog {
dt = pgsdf.format(dt3);
rsList = new HashMap<String, MPERadarData>(radIds.length);
rsList = MPEDataManager.getInstance().readRadarData(dt3);
Text[] lbTxts = new Text[radIds.length];
lbTxts = new Text[radIds.length];
manEdit = new Button[radIds.length];
for (int i = 0; i < radIds.length; i++) {
@ -398,9 +404,10 @@ public class RadarBiasTableDialog extends Dialog {
});
bias = String.format("%-1.2f", radarresultdata.getRwBiasValUsed());
oldbias[i] = (float) radarresultdata.getRwBiasValUsed();
editbias[i] = 0.0f;
editbias[i] = oldbias[i];
bias = String.format("%-1.2f", editbias[i]);
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
final Text lbiasTxt = new Text(biasListComp, SWT.SINGLE
@ -419,17 +426,16 @@ public class RadarBiasTableDialog extends Dialog {
lbiasTxt.setData(i);
lbiasTxt.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
@Override
public void modifyText(ModifyEvent e) {
final int ei = (Integer) lbiasTxt.getData();
try {
float parsedFloat = Float.parseFloat(lbiasTxt.getText());
editbias[ei] = parsedFloat;
manEdit[ei].setSelection(!mbiasBtn.getSelection());
manEdit[ei].setText("YES");
lbiasTxt.setBackground(getParent().getDisplay()
.getSystemColor(SWT.COLOR_WHITE));
biasChgs.put(radIds[ei], ei);
applyBtn.setEnabled(true);
} catch (NumberFormatException e1) {
lbiasTxt.setBackground(getParent().getDisplay()
@ -442,16 +448,36 @@ public class RadarBiasTableDialog extends Dialog {
lbTxts[i] = lbiasTxt;
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
mbiasBtn = new Button(biasListComp, SWT.TOGGLE | SWT.READ_ONLY);
// mbiasBtn.setEnabled(false);
final Button mbiasBtn = new Button(biasListComp, SWT.TOGGLE);
mbias = ("n".equalsIgnoreCase(radarresultdata.getEditBias()) || radarresultdata
.getEditBias() == null) ? "NO" : "YES";
mbiasBtn.setText(mbias);
mbiasBtn.setLayoutData(gd);
mbiasBtn.setData(i);
mbiasBtn.setSelection(false);
manEdit[i] = mbiasBtn;
mbiasBtn.addSelectionListener(new SelectionAdapter() {
/**
* (non-Javadoc)
*
* @see
* org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse
* .swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
final int ai = (Integer) mbiasBtn.getData();
if ("YES".equalsIgnoreCase(mbiasBtn.getText())) {
manEdit[ai].setSelection(false);
editbias[ai] = oldbias[ai];
lbTxts[ai].setText(String.format("%-1.2f", editbias[ai]));
biasChgs.put(radIds[ai], ai);
applyBtn.setEnabled(false);
manEdit[ai].setText("NO");
}
}
});
gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
Label acoefLbl = new Label(biasListComp, SWT.CENTER);
if (abzerocoef.mlt_zrcoef == 0.0) {
@ -515,29 +541,27 @@ public class RadarBiasTableDialog extends Dialog {
final float memspan = -99.0f;
ArrayList<Rwradarresult> rwr = new ArrayList<Rwradarresult>();
Rwradarresult rwrr = new Rwradarresult();
for (int i = 0; i < radIds.length; i++) {
if (radIds[i].equals("ZZZ")) {
continue;
}
if (manEdit[i] != null
&& "YES".equalsIgnoreCase(manEdit[i].getText())) {
where = String.format("WHERE radid='%s' AND obstime='%s'",
radIds[i], obstime);
rwr = (ArrayList<Rwradarresult>) IHFSDbGenerated
.GetRWRadarResult(where);
if (rwr.size() != 0) {
rwrr = rwr.get(0);
} else {
continue;
}
rwrr.setEditBias("y");
rwrr.setMemSpanUsed((double) memspan);
rwrr.setRwBiasValUsed((double) editbias[i]);
IHFSDbGenerated.UpdateRWRadarResult(rwrr);
} else {
continue;
}
Iterator<String> bi = biasChgs.keySet().iterator();
while (bi.hasNext()) {
String rid = bi.next();
where = String.format("WHERE radid='%s' AND obstime='%s'",rid, obstime);
rwr = (ArrayList<Rwradarresult>) IHFSDbGenerated.GetRWRadarResult(where);
if (rwr.size() != 0) {
rwrr = rwr.get(0);
} else {
continue;
}
int indexval = biasChgs.get(rid);
if("YES".equalsIgnoreCase(manEdit[indexval].getText())){
rwrr.setEditBias("y");
rwrr.setMemSpanUsed((double) memspan);
} else {
rwrr.setEditBias("n");
}
rwrr.setRwBiasValUsed((double) editbias[indexval]);
IHFSDbGenerated.UpdateRWRadarResult(rwrr);
}
biasChgs.clear();
return;
}
}

View file

@ -24,6 +24,8 @@ import java.util.Date;
import java.util.List;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Cursor;
@ -60,6 +62,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Sep 11, 2013 #2353 lvenable Fixed cursor memory leak.
* Jan 29, 2014 16561 snaples Updated processDrawPrecipValue to remove polygon wireframe after setting value.
* Feb 2, 2014 16201 snaples Added saved data flag support
* Apr 28, 2014 16707 snaples Added code to save and set location of dialog box when moved.
*
*
* </pre>
@ -114,6 +117,12 @@ public class DrawPolygonDlg extends CaveSWTDialog {
/** The polygon resource */
private final MPEPolygonResource resource;
/** Point to hold location of dialog */
private static org.eclipse.swt.graphics.Point dlgLoc = null;
/** Status of dialog opened or not */
private boolean dialogOpened = false;
/**
* Constructor.
*
@ -144,13 +153,28 @@ public class DrawPolygonDlg extends CaveSWTDialog {
}
@Override
protected void initializeComponents(Shell shell) {
protected void initializeComponents(final Shell shell) {
setReturnValue(false);
boldFont = new Font(shell.getDisplay(), "Monospace", 10, SWT.BOLD);
font = new Font(shell.getDisplay(), "Monospace", 10, SWT.NORMAL);
// Initialize all of the controls and layoutsendCal
initializeComponents();
shell.addControlListener(new ControlAdapter() {
@Override
public void controlMoved(ControlEvent e) {
if (!dialogOpened) {
return;
}
if (dlgLoc == null) {
return;
}
dlgLoc.x = shell.getBounds().x;
dlgLoc.y = shell.getBounds().y;
}
});
}
/**
@ -162,6 +186,18 @@ public class DrawPolygonDlg extends CaveSWTDialog {
createCloseBtn();
}
@Override
protected void opened() {
if (dlgLoc == null) {
dlgLoc = new org.eclipse.swt.graphics.Point(shell.getBounds().x, shell.getBounds().y);
}
else {
shell.setLocation(dlgLoc);
}
dialogOpened = true;
}
/**
* Create the persistent group.
*/

View file

@ -19,6 +19,7 @@
**/
package com.raytheon.viz.mpe.core;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@ -38,6 +39,7 @@ import com.raytheon.uf.common.dataplugin.shef.tables.Hourlypp;
import com.raytheon.uf.common.dataplugin.shef.tables.Pseudogageval;
import com.raytheon.uf.common.dataplugin.shef.tables.Rawpp;
import com.raytheon.uf.common.dataplugin.shef.util.ShefConstants;
import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions;
import com.raytheon.viz.hydrocommon.whfslib.GagePPOptions.shef_dup;
@ -56,6 +58,8 @@ import com.raytheon.viz.mpe.core.MPEDataManager.MPEGageData;
* Jan 02, 2013 15565 snaples Fixed problem with wrong time being sent to mpe_fieldgen
* Mar 14, 2013 1457 mpduff Fixed memory leak.
* Jun 18, 2013 16053 snaples Removed check for Radar Edit flag
* Apr 24, 2014 16308 lbousaidi added the ability to send RFC Bias across the WAN
* after Mpe fieldgen run.
* </pre>
*
* @author snaples
@ -293,6 +297,22 @@ public class RegenHrFlds {
e.printStackTrace();
}
/*-------------------------------------------------------------------------*/
/* send RFC Bias across the WAN if the tokens TRANSMIT_BIAS_ON_RERUN
* and MPE_TRANSMIT_BIAS are both ON. The script rerun_mpe_fieldgen
* only run transmit_rfc_bias but it doesn't rerun mpe_fieldgen
/*-------------------------------------------------------------------------*/
AppsDefaults appsDefaults = AppsDefaults.getInstance();
String scriptDir = appsDefaults.getToken("pproc_bin");
String scriptName ="rerun_mpe_fieldgen";
String transmitRun= dr.format(datetime);
ProcessBuilder pb = new ProcessBuilder(scriptDir + "/" + scriptName ,hour,
transmitRun);
try {
pb.start();
} catch (IOException e) {
e.printStackTrace();
}
MPEDataManager.getInstance().clearEditGages();
shell.setCursor(null);
}

View file

@ -99,6 +99,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* 11/26/2012 14526 mgamazaychikov Added traverse listener for RETURN key
* 10/07/2013 16664 mgamazaychikov Added padProdDesignatorText method
* 11/21/2013 16633 mgamazaychikov Improved consistency between AFOS PIL and WMO Heading fields.
* 08May2014 16041 kshrestha Save unofficial text products from text editor.
*
* </pre>
*
* @author lvenable
@ -646,6 +648,7 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
return;
}
boolean sendEnabled = true;
boolean unOfficialProd = false;
if (!isProductValid()) {
// Notify the user that the product may not be valid.
//
@ -665,6 +668,9 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
}
parentEditor.enableSend(false);
sendEnabled = false;
if(isAfosPilComplete()) {
unOfficialProd = true;
}
} else {
parentEditor.enableSend(true);
}
@ -672,7 +678,7 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
// call the set methods
parentEditor.setCurrentWmoId(wmoTtaaiiTF.getText());
parentEditor.setCurrentSiteId(ccccTF.getText());
if (sendEnabled) {
if (sendEnabled || (sendEnabled == false && unOfficialProd == true)) {
parentEditor.setCurrentWsfoId(wsfoIdTF.getText());
parentEditor.setCurrentProdCategory(prodCatTF.getText());
parentEditor.setCurrentProdDesignator(prodDesignatorTF.getText());

View file

@ -335,7 +335,9 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 10Dec2013 2601 mpduff Fix NullPointerException.
* 28Jan2014 DR14595 mgamazaychikov Added template loading and editing functionality.
* 14Mar2014 DR 17175 D. Friedman Get correct time zone for MND header time sync.
* 08May2014 DR 16041 kshrestha Save unofficial text products from text editor.
* 13May2014 2536 bclement moved WMO Header to common, switched from TimeTools to TimeUtil
*
* </pre>
*
* @author lvenable
@ -4394,7 +4396,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
.getProductCategory(token)
+ tdm.getProductDesignator(token);
// Set the header text field.
if (bbbid.equals("NOR")) {
if (bbbid.equals("NOR") || tdm.getAfosPil(token) != null) {
String wmoId = tdm.getWmoId(token);
wmoId = (wmoId.length() > 0 ? wmoId : "-");
String siteId = tdm.getSiteId(token);
@ -5295,8 +5297,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
if (!isAutoSave) {
if (!resend) {
// If not a resend, set the DDHHMM field to the current time
if (productText.startsWith("- -") && productText.contains("DDHHMM")) {
productText = getUnofficeProduct(currentDate);
} else {
productText = replaceDDHHMM(productText, currentDate);
}
VtecObject vtecObj = VtecUtil.parseMessage(productText);
if (warnGenFlag) {
/*
@ -8626,4 +8631,34 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
modifiedText = removeSoftReturns(modifiedText);
return modifiedText;
}
private String getUnofficeProduct(String currDate)
{
StdTextProduct textProd = TextDisplayModel.getInstance().getStdTextProduct(token);
String header = headerTF.getText();
String nnn = textProd.getNnnid();
String xxx = textProd.getXxxid();
String nnnXxx = nnn + xxx;
String site = SiteMap.getInstance().getSite4LetterId(
textProd.getCccid());
String wmoId = textProd.getCccid() + nnnXxx + " "
+ getAddressee() + "\nTTAA00 " + site;
header = header.replaceFirst("\n" + nnnXxx, "");
header = header.replaceFirst("-", "ZCZC");
header = header.replaceFirst("-", wmoId);
if (currDate != null)
header = header.replaceFirst("DDHHMM", currDate);
else
header = header.replaceFirst("DDHHMM", textProd.getHdrtime());
String body = textEditor.getText().toUpperCase();
header = header + "\n\n"+body +"\n!--not sent--!";
return header;
}
}

View file

@ -42,6 +42,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 24, 2010 jsanchez Initial creation
* Apr 25, 2014 DR 16668 D. Friedman Only notify on NEW products.
*
* </pre>
*
@ -83,7 +84,7 @@ public class NotifyExpiration {
}
VtecObject vtecObject = VtecUtil.parseMessage(warning);
if (vtecObject == null) {
if (vtecObject == null || !"NEW".equals(vtecObject.getAction())) {
return;
}
Calendar expire = vtecObject.getEndTime();

View file

@ -51,6 +51,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* Sep 21, 2010 2187 cjeanbap Removed hard coded values of
* tables names.
* Dec 20, 2010 7210 cjeanbap Added non-blocking dialog.
* Apr 25, 2014 DR 16668 D. Friedman Handle partial cancellations
* </pre>
*
* @author jsanchez
@ -114,8 +115,6 @@ public class NotifyExpirationTask extends TimerTask {
req.setMode(ActiveTableMode.OPERATIONAL);
}
/* textNotifyExpiration.tcl ln 76: Only queries for a CAN */
req.setAct("CAN");
req.setSiteID(office);
req.setPhensigList(phenSig);
req.setEtn(etn);
@ -127,22 +126,32 @@ public class NotifyExpirationTask extends TimerTask {
activeTable = resp.getActiveTable();
} catch (VizException e) {
statusHandler.handle(Priority.ERROR,
"Error querying active table for CAN." + office + "."
"Error querying active table for " + office + "."
+ phenSig + "." + etn, e);
}
if (activeTable != null && activeTable.size() > 0) {
ActiveTableRecord record = activeTable.get(0);
/*
* textNotifyExpiration.tcl ln 97: If any of the found products are
* less than 48 hours old,return true.
*/
if (record != null
&& (System.currentTimeMillis()
- record.getIssueTime().getTimeInMillis() < TWO_DAYS)) {
return true;
if (activeTable != null) {
boolean haveCAN = false;
for (ActiveTableRecord record : activeTable) {
if (record != null) {
/*
* textNotifyExpiration.tcl ln 106: If any of the found products are
* less than 48 hours old,return true.
*/
if ("CAN".equals(record.getAct())
&& (System.currentTimeMillis()
- record.getIssueTime().getTimeInMillis() < TWO_DAYS)) {
haveCAN = true;
} else if ("CON".equals(record.getAct())) {
/* If there CANs and the event is still active, there
* should be some CONs. Thus, it is not necessary to
* check for every other kind of non-terminal action.
*/
return false;
}
}
}
return haveCAN;
}
return false;

View file

@ -58,6 +58,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil;
* 07 NOV 2012 15003 mgamazaychikov Do not perform QC check on standalone MWS headline.
* 21 MAY 2013 16200 Qinglu Lin Prevent countyOrZoneCounter from being increased for a line
* that has no word County/Parish/Municipality in it.
* 13 MAY 2014 17177 Qinglu Lin Updated runQC().
*
* </pre>
*
@ -305,7 +306,7 @@ public class TextSegmentCheck implements IQCCheck {
// second bullet
if (line.startsWith("*") && nb == 2) {
m = secondBulletPtrn.matcher(line);
if (m.find()) {
if (m.find() || line.contains("* UNTIL NOON") || line.contains("* UNTIL MIDNIGHT")) {
secondBulletFound = true;
insideFirstBullet = false;
continue;

View file

@ -42,6 +42,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil;
* Initial creation
* Aug 25, 2011 10719 rferrel ugcPtrn now local to file.
* Mar 14, 2014 DR 17175 D. Friedman Get correct time zone from times.
* May 13, 2014 DR 17177 Qinglu Lin Updated runQC().
* </pre>
*
* @version 1.0
@ -89,7 +90,9 @@ public class TimeConsistentCheck implements IQCCheck {
}
// Event ending time (second bullet) vs Expiration
m = secondBulletPtrn.matcher(body);
String newBody = body.replaceAll("UNTIL NOON", "UNTIL 1200 PM");
newBody = newBody.replaceAll("UNTIL MIDNIGHT", "UNTIL 1200 AM");
m = secondBulletPtrn.matcher(newBody);
if (m.find()) {
TimeZone timeZone = TextWarningConstants.timeZoneShortNameMap
.get(m.group(4));

View file

@ -1198,6 +1198,7 @@
</Level>
<Level displayName="Wet Bulb 0" key="WetBulb0" group="S">
<DatabaseLevel levelName="TW0" levelOneValue="0" />
<DatabaseLevel levelName="WBZ" levelOneValue="0" />
</Level>
<Level displayName="Low Wet Bulb 0" key="LowWetBulb0" group="S"> <!-- Lowest Level of the wet bulb zero -->
<DatabaseLevel levelName="LLTW" levelOneValue="0" />

View file

@ -68,6 +68,7 @@
<vbSource key="ENPWAVE253" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="EPwave10" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GFE" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GFS199" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GFSGuide" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GFSLAMPTstorm" name="GFSLAMP-Grid" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="GLERL" category="SfcGrid" views="PLANVIEW TIMESERIES" />

View file

@ -152,6 +152,8 @@ import com.vividsolutions.jts.geom.Polygon;
* Sep 24, 2013 #2401 lvenable Fixed font memory leak.
* Oct 01, 2013 DR16612 m.gamazaychikov Fixed inconsistencies with track locking and updateListSelected method
* Oct 29, 2013 DR 16734 D. Friedman If redraw-from-hatched-area fails, don't allow the polygon the be used.
* Apr 24, 2014 DR 16356 Qinglu Lin Updated selectOneStorm() and selectLineOfStorms().
* May 09, 2014 DR16694 m.gamazaychikov Fixed disabled duration menu after creating text for a COR SVS.
* </pre>
*
* @author chammack
@ -1250,6 +1252,7 @@ public class WarngenDialog extends CaveSWTDialog implements
warngenLayer.resetState();
warngenLayer.getStormTrackState().duration = ((DurationData) durationList
.getData(durationList.getItem(durationList.getSelectionIndex()))).minutes;
durationList.setEnabled(warngenLayer.getConfiguration().isEnableDuration());
if (lineOfStorms.getSelection()) {
selectLineOfStorms();
} else {
@ -1323,6 +1326,8 @@ public class WarngenDialog extends CaveSWTDialog implements
*/
private void selectOneStorm() {
if (warngenLayer.state.followupData == null) {
warngenLayer.resetState();
warngenLayer.reset("oneStorm");
warngenLayer.clearWarningGeometries();
warngenLayer.getStormTrackState().dragMeLine = null;
warngenLayer.getStormTrackState().dragMeGeom = null;
@ -1338,6 +1343,8 @@ public class WarngenDialog extends CaveSWTDialog implements
*/
private void selectLineOfStorms() {
if (warngenLayer.state.followupData == null) {
warngenLayer.resetState();
warngenLayer.reset("lineOfStorms");
warngenLayer.clearWarningGeometries();
warngenLayer.getStormTrackState().dragMeLine = null;
warngenLayer.getStormTrackState().dragMeGeom = null;

View file

@ -205,10 +205,11 @@ import com.vividsolutions.jts.io.WKTReader;
* 02/07/2014 DR16090 m.gamazaychikov Added GeomMetaDataUpdateNotificationObserver class to get notification
* when geometry file get updated to re-read them in.
* 02/19/2014 2819 randerso Removed unnecessary .clone() call
* 03/17/2014 DR16309 Qinglu Lin Updated getWarningAreaFromPolygon(); changed searchCountyGeospatialDataAccessor) to
* 03/17/2014 DR 16309 Qinglu Lin Updated getWarningAreaFromPolygon(); changed searchCountyGeospatialDataAccessor) to
* searchGeospatialDataAccessor() and updated it; changed getCountyGeospatialDataAcessor()
* to getGeospatialDataAcessor(); changed getAllCountyUgcs() to getAllUgcs(); changed
* getUgcsForWatches() to getUgcsForCountyWatches().
* 04/23/2014 DR 16356 Qinglu Lin Updated initializeState() and added reset().
* </pre>
*
* @author mschenke
@ -737,6 +738,11 @@ public class WarngenLayer extends AbstractStormTrackResource {
// Default angle for POINT
displayState.labelMode = LabelMode.TIME;
state.angle = 60;
if (StormTrackState.newWarnGen) {
StormTrackState.oneStormAngle = state.angle;
StormTrackState.trackType = "oneStorm";
StormTrackState.newWarnGen = false;
}
state.speed = 35;
state.dragMePoint = null;
state.resetAnchor = true;
@ -3493,4 +3499,17 @@ public class WarngenLayer extends AbstractStormTrackResource {
return hatchedArea;
}
}
public void reset(String trackType) {
if (trackType.equals("oneStorm")) {
getStormTrackState().justSwitchedToOS = true;
getStormTrackState().justSwitchedToLOS = false;
StormTrackState.trackType = "oneStorm";
getStormTrackState().angle = StormTrackState.oneStormAngle;
} else if (trackType.equals("lineOfStorms")) {
getStormTrackState().justSwitchedToOS = false;
getStormTrackState().justSwitchedToLOS = true;
StormTrackState.trackType = "lineOfStorms";
}
}
}

View file

@ -54,6 +54,7 @@ import com.raytheon.viz.warngen.gis.AffectedAreas;
* bulletIndices(), header(), firstBullet(), secondBullet(), getImmediateCausesPtrn();
* updated body(), header(), and secondBullet();
* Mar 13, 2013 DR 15892 D. Friedman Fix bullet parsing.
* May 13, 2014 DR 17177 Qinglu Lin Updated secondBullet().
*
* </pre>
*
@ -255,14 +256,14 @@ abstract public class AbstractLockingBehavior implements ICommonPatterns {
* Locks the second bullet.
*/
private void secondBullet() {
// LOCK_END should not be found at the beginning since the previous line
// should be blank.
String secondBullet =
"\\* UNTIL \\d{3,4} (AM|PM) \\w{3,4}( \\w{6,9}){0,1}(\\/\\d{3,4} (AM|PM) \\w{3,4}( \\w{6,9}){0,1}\\/){0,1}"
+ newline;
Pattern secondBulletPtrn = Pattern.compile(secondBullet,
Pattern.MULTILINE);
find(secondBulletPtrn.matcher(text));
// LOCK_END should not be found at the beginning since the previous line
// should be blank.
String secondBullet =
"\\* UNTIL (\\d{3,4} (AM|PM)|NOON|MIDNIGHT) \\w{3,4}( \\w{6,9}){0,1}(\\/(\\d{3,4} (AM|PM)|NOON|MIDNIGHT) \\w{3,4}( \\w{6,9}){0,1}\\/){0,1}"
+ newline;
Pattern secondBulletPtrn = Pattern.compile(secondBullet,
Pattern.MULTILINE);
find(secondBulletPtrn.matcher(text));
}
/**

Binary file not shown.

Binary file not shown.

View file

@ -37,13 +37,13 @@ import org.hibernate.criterion.Restrictions;
import com.raytheon.edex.plugin.gfe.smartinit.SmartInitRecordPK.State;
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
import com.raytheon.uf.edex.database.cluster.ClusterTask;
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;
/**
* TODO Add Description
* SmartInit Transactions
*
* <pre>
*
@ -51,6 +51,8 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 12, 2010 njensen Initial creation
* May 20, 2014 #3069 randerso Added validTime to sort order when
* choosing next smartInit to run
*
* </pre>
*
@ -104,8 +106,8 @@ public class SmartInitTransactions {
LockOptions.UPGRADE);
// double check to make sure another process hasn't
// already grabbed it and the run didn't finish
if (record != null
&& record.getInsertTime().getTime() < timeOutCheck) {
if ((record != null)
&& (record.getInsertTime().getTime() < timeOutCheck)) {
logger.info("Running smartInit " + record.getId()
+ " timed out. Rerunning smartInit.");
record.setInsertTime(new Date(System
@ -120,8 +122,9 @@ public class SmartInitTransactions {
// query the pending table for available inits
Criteria pendingCrit = sess.createCriteria(SmartInitRecord.class);
pendingCrit.addOrder(Order.asc("priority")).addOrder(
Order.asc("insertTime"));
pendingCrit.addOrder(Order.asc("priority"))
.addOrder(Order.asc("insertTime"))
.addOrder(Order.asc("id.validTime"));
long pendingTimeRest = System.currentTimeMillis()
- pendingInitMinTimeMillis;
@ -151,8 +154,8 @@ public class SmartInitTransactions {
record.getId(), LockOptions.UPGRADE);
// double check its still valid
if (record != null
&& record.getInsertTime().getTime() <= pendingTimeRest) {
if ((record != null)
&& (record.getInsertTime().getTime() <= pendingTimeRest)) {
sess.delete(record);
// can we update primary key in place?? or do we need to
// delete then add

View file

@ -342,9 +342,9 @@
<dt>6</dt>
</info>
<info>
<title>Guam-GFS</title>
<title>Guam-GFSDNG</title>
<datasetId>GFS199</datasetId>
<dt>6</dt>
<dt>3</dt>
</info>
<info>
<title>RAP13</title>

View file

@ -81,6 +81,7 @@ import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
* Nov 11, 2008 1684 chammack Camel refactor.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Sep 17, 2013 2378 njensen Improve 3/6 hr precip decoding
* May 12, 2014 DR 17151 D. Friedman Fix 6hr min/max temp decoding.
* May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage
* </pre>
*
@ -260,16 +261,17 @@ public class MetarDecoder extends AbstractDecoder {
record.setMessageData(message);
message = cleanMessage(message);
String trailingData = null;
String remarks = null;
int cutPos = message.indexOf(" RMK ");
if (cutPos >= 0) {
trailingData = message.substring(cutPos);
remarks = message.substring(cutPos);
// Now truncate the message data.
message = message.substring(0, cutPos);
} else {
trailingData = message;
remarks = "";
}
trailingData = trailingData + " ";
StringBuilder trailingData = new StringBuilder(remarks);
trailingData.append(' ');
StringBuilder obsMsg = new StringBuilder(message);
@ -736,6 +738,7 @@ public class MetarDecoder extends AbstractDecoder {
pkTim.add(Calendar.DAY_OF_MONTH, -1);
}
record.setPkWndTime(pkTim);
trailingData.delete(matcher.start(), matcher.end());
}
// Gets the temperature and dew point in tenths precision

View file

@ -131,6 +131,7 @@
<doTry>
<pipeline>
<bean ref="shefDecoder" method="decode" />
<bean ref="processUtil" method="log"/>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
@ -150,6 +151,7 @@
<pipeline>
<bean ref="stringToFile" />
<bean ref="shefDecoder" method="decode" />
<bean ref="processUtil" method="log"/>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>

View file

@ -112,8 +112,8 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
* data can be posted to appropriate pe-based tables only if the data
* type is not READING like in A1 code.
* 02/18/2014 16572 l. Bousaidi only apply adjust factor to non missing values.
* 04/24/2014 16904 lbousaidi gross check should be applied to adjusted value.
* May 14, 2014 2536 bclement removed TimeTools usage
*
* </pre>
*
* @author mduff
@ -649,6 +649,8 @@ public class PostShef {
adjustRawValue(locId, data);
}
dataValue = data.getStringValue();
/*
* multiply non-missing values of discharge values and unspecified
* height values by 1000 to change units

View file

@ -97,6 +97,7 @@ import com.raytheon.uf.common.util.FileUtil;
* populate the display label.
* Apr 01, 2014 2862 rferrel Moved purge only routines to ArchivePurgeManager.
* Apr 29, 2014 3036 rferrel Check for missing archive root directories.
* May 22, 2014 3181 rferrel Add check for valid array index.
* </pre>
*
* @author rferrel
@ -658,6 +659,14 @@ public class ArchiveConfigManager {
tmpDirs.clear();
int subExprIndex = 0;
/*
* Will never match when pattern's directories shorter then
* directories being scanned.
*/
if ((tokens.length - rootFileDepth) > subExpr.length) {
continue DIR_PATTERN_LOOP;
}
for (int i = rootFileDepth; i < tokens.length; i++) {
Pattern subPattern = Pattern.compile("^"
+ subExpr[subExprIndex++] + "$");

View file

@ -20,7 +20,6 @@
package com.raytheon.uf.common.dataplugin.gfe.config;
import java.awt.Point;
import java.util.HashMap;
import javax.persistence.Column;
import javax.persistence.Embeddable;
@ -29,14 +28,15 @@ import javax.persistence.Enumerated;
import javax.persistence.Transient;
import org.geotools.coverage.grid.GeneralGridEnvelope;
import org.geotools.coverage.grid.GridGeometry2D;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.referencing.operation.DefaultMathTransformFactory;
import org.geotools.referencing.operation.builder.GridToEnvelopeMapper;
import org.opengis.metadata.spatial.PixelOrientation;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.datum.PixelInCell;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.NoninvertibleTransformException;
import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
@ -58,6 +58,9 @@ import com.vividsolutions.jts.geom.Coordinate;
* 08/06/13 #1571 randerso Added hibernate annotations
* Removed constructor with int for ProjectionType
* 10/22/13 #2361 njensen Remove XML annotations
* 05/14/2014 #3069 randerso Changed to store math transforms and CRS instead of
* GridGeometry2D since GeoTools now changes the supplied
* math transform when creating GridGeometry2D
*
* </pre>
*
@ -145,22 +148,13 @@ public class ProjectionData {
private CoordinateReferenceSystem crs;
@Transient
private GridGeometry2D gridGeometry;
private MathTransform gridToLatLon;
@Transient
private MathTransform crsToLatLon;
private MathTransform latLonToGrid;
@Transient
private MathTransform latLonToCrs;
@Transient
private HashMap<PixelOrientation, MathTransform> gridToLatLon;
@Transient
private HashMap<PixelOrientation, MathTransform> latLonToGrid;
@Transient
private HashMap<PixelOrientation, MathTransform> gridToCrs;
private MathTransform gridToCrs;
@Transient
private boolean initialized;
@ -175,10 +169,6 @@ public class ProjectionData {
gridPointLL = new Point();
gridPointUR = new Point();
gridToLatLon = new HashMap<PixelOrientation, MathTransform>();
latLonToGrid = new HashMap<PixelOrientation, MathTransform>();
gridToCrs = new HashMap<PixelOrientation, MathTransform>();
initialized = false;
}
@ -255,24 +245,25 @@ public class ProjectionData {
ge.setRange(1, Math.min(output[1], output[3]),
Math.max(output[1], output[3]));
// NOTE: the LL + 1 is a kludge to work around an apparent geotools
// issue
// GeoTools 10.5 kludge to say upper right is non-inclusive
GeneralGridEnvelope gr = new GeneralGridEnvelope(new int[] {
getGridPointLL().x + 1, getGridPointLL().y + 1 },
new int[] { getGridPointUR().x, getGridPointUR().y }, true);
getGridPointLL().x, getGridPointLL().y }, new int[] {
getGridPointUR().x, getGridPointUR().y }, false);
// GeoTools 10.5 kludge to use CELL_CORNER instead of CELL_CENTER
GridToEnvelopeMapper mapper = new GridToEnvelopeMapper();
mapper.setEnvelope(ge);
mapper.setGridRange(gr);
mapper.setPixelAnchor(PixelInCell.CELL_CENTER);
mapper.setPixelAnchor(PixelInCell.CELL_CORNER);
mapper.setReverseAxis(new boolean[] { false, false });
mt = mapper.createTransform();
gridToCrs = mapper.createTransform();
gridGeometry = new GridGeometry2D(PixelInCell.CELL_CORNER, mt, ge,
null);
MathTransform crsToLatLon = MapUtil.getTransformToLatLon(getCrs());
crsToLatLon = MapUtil.getTransformToLatLon(getCrs());
latLonToCrs = MapUtil.getTransformFromLatLon(getCrs());
DefaultMathTransformFactory dmtf = new DefaultMathTransformFactory();
gridToLatLon = dmtf.createConcatenatedTransform(gridToCrs,
crsToLatLon);
latLonToGrid = getGridToLatLon().inverse();
initialized = true;
@ -388,71 +379,96 @@ public class ProjectionData {
}
/**
* Return the lat/lon of the specified corner or center of a grid cell
* Return the lat/lon of the specified grid cell
*
* @param gridCoord
* coordinates of the grid cell
* @param orientation
* desired corner or center
* @return the lat/lon
* @throws FactoryException
* @throws TransformException
*/
public Coordinate gridCoordinateToLatLon(Coordinate gridCoord,
PixelOrientation orientation) {
public Coordinate gridCoordinateToLatLon(Coordinate gridCoord)
throws FactoryException, TransformException {
Coordinate latLon = new Coordinate();
MathTransform mt = gridToLatLon.get(orientation);
try {
if (mt == null) {
init();
DefaultMathTransformFactory dmtf = new DefaultMathTransformFactory();
mt = dmtf.createConcatenatedTransform(
gridGeometry.getGridToCRS(orientation), crsToLatLon);
gridToLatLon.put(orientation, mt);
}
double[] output = new double[2];
mt.transform(new double[] { gridCoord.x, gridCoord.y }, 0, output,
0, 1);
latLon.x = output[0];
latLon.y = output[1];
} catch (Exception e) {
statusHandler.error(
"Error computing grid coordinate to lat/lon transform", e);
}
MathTransform mt = getGridToLatLon();
double[] output = new double[2];
mt.transform(new double[] { gridCoord.x, gridCoord.y }, 0, output, 0, 1);
latLon.x = output[0];
latLon.y = output[1];
return latLon;
}
/**
* Return the math transform from grid coordinate to the specified corner or
* center lat/lon
* Return the grid coordinate of the specified lat/lon
*
* @param orientation
* desired corner or center
* @return the transform
* @param latLon
* lat/lon to be converted
* @return the grid coordinate
* @throws FactoryException
* @throws TransformException
*/
public MathTransform getGridToCrs(PixelOrientation orientation) {
MathTransform mt = gridToCrs.get(orientation);
if (mt == null) {
init();
mt = gridGeometry.getGridToCRS(orientation);
gridToCrs.put(orientation, mt);
}
return mt;
public Coordinate latLonToGridCoordinate(Coordinate latLon)
throws FactoryException, TransformException {
Coordinate gridCoord = new Coordinate();
MathTransform mt = getLatLonToGrid();
double[] output = new double[2];
mt.transform(new double[] { latLon.x, latLon.y }, 0, output, 0, 1);
gridCoord.x = output[0];
gridCoord.y = output[1];
return gridCoord;
}
/**
* Convert a grid cell coordinate to the native CRS coordinate of this
* projection
* Return the math transform from grid coordinate to lat/lon
*
* @return the transform
* @throws FactoryException
*/
public MathTransform getGridToLatLon() throws FactoryException {
if (gridToLatLon == null) {
init();
}
return gridToLatLon;
}
/**
* Return the math transform from lat/lon to grid coordinate
*
* @return the transform
* @throws FactoryException
* @throws NoninvertibleTransformException
*/
public MathTransform getLatLonToGrid() throws FactoryException,
NoninvertibleTransformException {
if (latLonToGrid == null) {
init();
}
return latLonToGrid;
}
/**
* Return the math transform from grid coordinate to the native CRS
*
* @return the transform
*/
public MathTransform getGridToCrs() {
if (gridToCrs == null) {
init();
}
return gridToCrs;
}
/**
* Convert a grid cell coordinate to the native CRS of this projection
*
* @param gridCoord
* grid cell coordinate
* @param orientation
* desired corner or center of the grid cell
* @return native CRS coordinate
*/
public Coordinate gridCoordinateToCrs(Coordinate gridCoord,
PixelOrientation orientation) {
public Coordinate gridCoordinateToCrs(Coordinate gridCoord) {
Coordinate crsCoordinate = new Coordinate();
MathTransform mt = getGridToCrs(orientation);
MathTransform mt = getGridToCrs();
try {
double[] output = new double[2];
mt.transform(new double[] { gridCoord.x, gridCoord.y }, 0, output,

View file

@ -100,6 +100,9 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
* 09/30/13 #2333 mschenke Added method to construct from {@link IGridGeometryProvider}
* 10/22/13 #2361 njensen Remove XML annotations
* 04/11/14 #2947 bsteffen Remove ISpatialObject constructor.
* 05/14/2014 #3069 randerso Changed to store math transforms and CRS instead of
* GridGeometry2D since GeoTools now changes the supplied
* math transform when creating GridGeometry2D
*
*
*
@ -121,7 +124,7 @@ public class GridLocation extends PersistableDataObject<String> implements
* reshaped using numpy for performance
*
*/
private static class PythonNumpyLatLonGrid implements INumpyable {
static class PythonNumpyLatLonGrid implements INumpyable {
private float[] data;
public PythonNumpyLatLonGrid(int nx, int ny, float[] data) {
@ -276,10 +279,8 @@ public class GridLocation extends PersistableDataObject<String> implements
Coordinate ur = new Coordinate(this.origin.x + this.extent.x,
this.origin.y + this.extent.y);
Coordinate llCrs = this.projection.gridCoordinateToCrs(ll,
PixelOrientation.CENTER);
Coordinate urCrs = this.projection.gridCoordinateToCrs(ur,
PixelOrientation.CENTER);
Coordinate llCrs = this.projection.gridCoordinateToCrs(ll);
Coordinate urCrs = this.projection.gridCoordinateToCrs(ur);
// construct the grid geometry that covers the GFE grid
GeneralEnvelope ge = new GeneralEnvelope(2);
@ -289,29 +290,29 @@ public class GridLocation extends PersistableDataObject<String> implements
ge.setRange(1, Math.min(llCrs.y, urCrs.y),
Math.max(llCrs.y, urCrs.y));
// GeoTools 10.5 kludge to use nx-1, ny-1 non-inclusive
GeneralGridEnvelope gr = new GeneralGridEnvelope(
new int[] { 1, 1 }, new int[] { this.nx, this.ny }, false);
new int[] { 0, 0 }, new int[] { this.nx - 1, this.ny - 1 },
false);
// GeoTools 10.5 kludge to use CELL_CORNER instead of CELL_CENTER
GridToEnvelopeMapper mapper = new GridToEnvelopeMapper();
mapper.setEnvelope(ge);
mapper.setGridRange(gr);
mapper.setPixelAnchor(PixelInCell.CELL_CENTER);
mapper.setReverseAxis(new boolean[] { false, false });
MathTransform mt = mapper.createTransform();
GridGeometry2D gridGeom = new GridGeometry2D(
PixelInCell.CELL_CORNER, mt, ge, null);
mapper.setPixelAnchor(PixelInCell.CELL_CORNER);
mapper.setReverseAxis(new boolean[] { false, true });
MathTransform gridToCrs = mapper.createTransform();
// set up the transform from grid coordinates to lon/lat
DefaultMathTransformFactory dmtf = new DefaultMathTransformFactory();
mt = dmtf.createConcatenatedTransform(
gridGeom.getGridToCRS(PixelOrientation.UPPER_LEFT),
MapUtil.getTransformToLatLon(crsObject));
MathTransform gridToLatLon = dmtf.createConcatenatedTransform(
gridToCrs, MapUtil.getTransformToLatLon(crsObject));
// transform grid corner points to Lat/Lon
double[] latLon = new double[8];
mt.transform(new double[] { 0, this.ny, 0, 0, this.nx, 0, this.nx,
this.ny }, 0, latLon, 0, 4);
double[] gridCells = new double[] { -0.5, -0.5, -0.5,
this.ny - 0.5, this.nx - 0.5, this.ny - 0.5, this.nx - 0.5,
-0.5 };
gridToLatLon.transform(gridCells, 0, latLon, 0, 4);
Coordinate[] corners = new Coordinate[] {
MapUtil.getCoordinate(latLon[0], latLon[1]),
@ -700,9 +701,7 @@ public class GridLocation extends PersistableDataObject<String> implements
public String toString() {
String s = "[SiteID =" + siteId + ",ProjID="
+ getCrs().getName().getCode() + ",gridSize=(" + nx + ',' + ny
+ "),loc=" + this.geometry.getGeometryType();
// if (proj())
// s += "," + proj()->pdata();
+ "), loc=[o=" + this.origin + ", e=" + this.extent + "]";
s += ']';
return s;
}
@ -1008,43 +1007,56 @@ public class GridLocation extends PersistableDataObject<String> implements
// new Coordinate(9, 9), "CST6CDT");
GridLocation gloc = new GridLocation("OAX", grid211,
new Point(145, 145), new Coordinate(45.0, 30.0),
new Coordinate(9, 9), "CST6CDT");
new Point(417, 289), new Coordinate(41.0, 29.0),
new Coordinate(13, 9), "CST6CDT");
System.out.println(gloc.getSiteId());
Coordinate gridCoord = new Coordinate();
Coordinate latLon = new Coordinate();
PixelOrientation orientation = PixelOrientation.CENTER;
gridCoord.x = 0;
gridCoord.y = 0;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord, orientation, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
System.out.println("geometry: " + gloc.getGeometry());
gridCoord.x = 0;
gridCoord.y = gloc.getNy() - 1;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord, orientation, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
try {
gridCoord.x = 0;
gridCoord.y = 0;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord,
PixelOrientation.CENTER, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
gridCoord.x = gloc.getNx() - 1;
gridCoord.y = gloc.getNy() - 1;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord, orientation, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
gridCoord.x = 0;
gridCoord.y = gloc.getNy() - 1;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord,
PixelOrientation.CENTER, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
gridCoord.x = gloc.getNx() - 1;
gridCoord.y = 0;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord, orientation, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
gridCoord.x = gloc.getNx() - 1;
gridCoord.y = gloc.getNy() - 1;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord,
PixelOrientation.CENTER, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
PythonNumpyLatLonGrid latLonGrid = gloc.getLatLonGrid();
float[] data = (float[]) latLonGrid.getNumpy()[0];
for (int x = 0; x < gloc.getNx(); x++) {
for (int y = 0; y < gloc.getNy(); y++) {
int idx = 2 * ((x * gloc.ny) + y);
float lon = data[idx];
float lat = data[idx + 1];
System.out.println(x + "," + y + " " + lon + ", " + lat);
gridCoord.x = gloc.getNx() - 1;
gridCoord.y = 0;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord,
PixelOrientation.CENTER, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
GridGeometry2D gridGeometry = MapUtil.getGridGeometry(gloc);
System.out.println(gridGeometry.getEnvelope2D().toString());
System.out.println(gridGeometry.toString());
PythonNumpyLatLonGrid latLonGrid = gloc.getLatLonGrid();
float[] data = (float[]) latLonGrid.getNumpy()[0];
for (int x = 0; x < gloc.getNx(); x++) {
for (int y = 0; y < gloc.getNy(); y++) {
int idx = 2 * ((x * gloc.ny) + y);
float lon = data[idx];
float lat = data[idx + 1];
System.out.println(x + "," + y + " " + lon + ", " + lat);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}

View file

@ -0,0 +1,120 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.common.dataplugin.gfe.db.objects;
import java.awt.Point;
import org.geotools.coverage.grid.GridGeometry2D;
import org.opengis.metadata.spatial.PixelOrientation;
import com.raytheon.uf.common.dataplugin.gfe.config.ProjectionData;
import com.raytheon.uf.common.dataplugin.gfe.config.ProjectionData.ProjectionType;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridLocation.PythonNumpyLatLonGrid;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.vividsolutions.jts.geom.Coordinate;
/**
* GridLocation unit test
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 20, 2014 #3069 randerso Initial creation
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class GridLocationTest {
/**
* @param args
*/
public static void main(String[] args) {
ProjectionData grid211 = new ProjectionData("Grid211",
ProjectionType.LAMBERT_CONFORMAL, new Coordinate(-133.459,
12.190), new Coordinate(-49.385, 57.290),
new Coordinate(-95.0, 25.0), 25.0f, 25.0f, new Point(1, 1),
new Point(93, 65), 0.0f, 0.0f, 0.0f);
// GridLocation gloc = new GridLocation("ABR", grid211,
// new Point(145, 145), new Coordinate(45.0, 35.0),
// new Coordinate(9, 9), "CST6CDT");
GridLocation gloc = new GridLocation("OAX", grid211,
new Point(417, 289), new Coordinate(41.0, 29.0),
new Coordinate(13, 9), "CST6CDT");
System.out.println(gloc.getSiteId());
Coordinate gridCoord = new Coordinate();
Coordinate latLon = new Coordinate();
System.out.println("geometry: " + gloc.getGeometry());
try {
gridCoord.x = 0;
gridCoord.y = 0;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord,
PixelOrientation.CENTER, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
gridCoord.x = 0;
gridCoord.y = gloc.getNy() - 1;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord,
PixelOrientation.CENTER, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
gridCoord.x = gloc.getNx() - 1;
gridCoord.y = gloc.getNy() - 1;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord,
PixelOrientation.CENTER, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
gridCoord.x = gloc.getNx() - 1;
gridCoord.y = 0;
latLon = MapUtil.gridCoordinateToLatLon(gridCoord,
PixelOrientation.CENTER, gloc);
System.out.println(gridCoord.x + "," + gridCoord.y + " " + latLon);
GridGeometry2D gridGeometry = MapUtil.getGridGeometry(gloc);
System.out.println(gridGeometry.getEnvelope2D().toString());
System.out.println(gridGeometry.toString());
PythonNumpyLatLonGrid latLonGrid = gloc.getLatLonGrid();
float[] data = (float[]) latLonGrid.getNumpy()[0];
for (int x = 0; x < gloc.getNx(); x++) {
for (int y = 0; y < gloc.getNy(); y++) {
int idx = 2 * ((x * gloc.ny) + y);
float lon = data[idx];
float lat = data[idx + 1];
System.out.println(x + "," + y + " " + lon + ", " + lat);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

View file

@ -40,7 +40,7 @@ import com.raytheon.uf.common.style.level.SingleLevel;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 30, 2007 chammack Initial Creation.
*
* May 1, 2014 DCS 027 MPorricelli Add WBZ level
* </pre>
*
* @author chammack
@ -83,6 +83,8 @@ public class GridLevelTranslator {
level = new SingleLevel(Level.LevelType.TEMP);
} else if (levelType.equalsIgnoreCase("FRZ")) {
level = new SingleLevel(Level.LevelType.FRZ);
} else if (levelType.equalsIgnoreCase("WBZ")) {
level = new SingleLevel(Level.LevelType.WBZ);
} else {
return new SingleLevel(Level.LevelType.DEFAULT);
}

View file

@ -70,7 +70,7 @@
<alias base="ETA">NAM80</alias>
<alias base="GFS160">AK-GFS</alias>
<alias base="GFS161">SJU-GFS</alias>
<alias base="GFS199">Guam-GFS</alias>
<alias base="GFS199">Guam-GFSDNG</alias>
<alias base="GFS201">GFS360</alias>
<alias base="GFS212">GFS40</alias>
<alias base="GFS213">GFS90</alias>

View file

@ -4174,6 +4174,7 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
<parameter>GH</parameter>
<singleLevel units="FRZ" />
<singleLevel units="TW0" />
<singleLevel units="WBZ" />
</paramLevelMatches>
<contourStyle>
<displayUnits>ft</displayUnits>

View file

@ -4907,6 +4907,7 @@
<parameter>GH</parameter>
<singleLevel units="FRZ" />
<singleLevel units="TW0" />
<singleLevel units="WBZ" />
</paramLevelMatches>
<imageStyle>
<displayUnits>ft</displayUnits>

View file

@ -11,6 +11,7 @@
##### Evan Bookbinder 05-05-2013 handleClosesPoints and 3rd bullet changes (OVER & now)
##### Evan Bookbinder 09-20-2013 Fixed rural area otherPoints in pathcast section, added rural phrase
##### Qinglu Lin 03-17-2014 DR 16309. Updated inserttorwatches and insertsvrwatches.
##### Qinglu Lin 05-13-2014 DR 17177. Updated secondBullet.
####################################################################################################
#*
Mile Marker Test Code
@ -1142,10 +1143,13 @@ ${partOfArea}${area.name}...
######### MACRO TO GENERATE SECOND BULLET (UNTIL XXXX AMPM TZ (DAY) IN WARNINGS ##########
#macro(secondBullet $dateUtil $expire $timeFormat $localtimezone $secondtimezone $duration)
#if(${duration} >= 360)
UNTIL ${dateUtil.format(${expire}, ${timeFormat.plain}, 15, ${localtimezone})}##
#set($text = "UNTIL ${dateUtil.format(${expire}, ${timeFormat.plain}, 15, ${localtimezone})}")
#else
UNTIL ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}##
#set($text = "UNTIL ${dateUtil.format(${expire}, ${timeFormat.clock}, 15, ${localtimezone})}")
#end
#set($text = $text.replace("1200 PM", "NOON"))
#set($text = $text.replace("1200 AM", "MIDNIGHT"))
${text}##
#if(${secondtimezone})
#if(${duration} >= 360)
/${dateUtil.format(${expire}, ${timeFormat.plain}, 15, ${secondtimezone})}/##

View file

@ -16,3 +16,4 @@ PR+ \ MUNICIPALITIES
PUERTO RICO+ \ MUNICIPALITIES
DEFAULT+ \ COUNTIES
DEFAULT \ COUNTY
CITY \

View file

@ -72,6 +72,9 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
* Mar 07, 2013 1587 bsteffen rewrite static data generation.
* Mar 14, 2013 1587 bsteffen Fix persisting to datastore.
* Apr 14, 2014 DR 16752 MPorricelli Add ensembleid to hash key to allow
* creation of static data for all perturbations
* of Ensemble models
* Apr 21, 2014 2060 njensen Remove dependency on grid dataURI column
*
* </pre>
@ -447,11 +450,14 @@ public class StaticDataGenerator {
private final int coverageid;
private final String ensembleid;
public CacheKey(GridRecord record) {
this.datasetid = record.getDatasetId();
this.refTime = record.getDataTime().getRefTime();
this.forecastTime = record.getDataTime().getFcstTime();
this.coverageid = record.getLocation().getId();
this.ensembleid = record.getEnsembleId();
}
@Override
@ -464,6 +470,8 @@ public class StaticDataGenerator {
result = (prime * result) + forecastTime;
result = (prime * result)
+ ((refTime == null) ? 0 : refTime.hashCode());
result = (prime * result)
+ ((ensembleid == null) ? 0 : ensembleid.hashCode());
return result;
}
@ -499,6 +507,13 @@ public class StaticDataGenerator {
} else if (!refTime.equals(other.refTime)) {
return false;
}
if (ensembleid == null) {
if (other.ensembleid != null) {
return false;
}
} else if (!ensembleid.equals(other.ensembleid)) {
return false;
}
return true;
}

View file

@ -732,6 +732,12 @@
<versionsToKeep>5</versionsToKeep>
<modTimeToWait>00-00:15:00</modTimeToWait>
</rule>
<!-- Purge rule for the GFS199 (Guam-GFSDNG) model -->
<rule>
<keyValue>GFS199</keyValue>
<versionsToKeep>4</versionsToKeep>
<modTimeToWait>00-01:00:00</modTimeToWait>
</rule>
<!-- Purge rules for the Multi-grid Hurricane Wave Models -->
<rule>

View file

@ -58,6 +58,7 @@ import conf.TDBConfig as config
# 10/29/10 7354 cjeanbap Updated if-statement to handle None
# 12/07/10 7656 cjeanbap Retrieve environment variable.
# 04/07/11 8686 cjeanbap Fixed $ACTION has -i associated
# 05/12/14 16954 kshrestha Added Multiple flag functionality for textdb
##############################################################################
class TextDB:
@ -226,6 +227,7 @@ class TextDB:
msg = MSG.Message(True)
msg.initializeMessage(False)
commands = self.commands['command']
isJoin = False
for command in commands:
data = self.commands[command]
message = config.message[command]
@ -233,6 +235,8 @@ class TextDB:
for tuple in message[config.MSG_START:]:
key = tuple[config.MSG_KEY]
value = tuple[config.MSG_VALUE]
if ((key == "SUBOP") and (value == "JOIN")):
isJoin = True
if isinstance(value,types.IntType):
if args == config.MSG_VAR_ARGS:
for item in data:
@ -242,6 +246,9 @@ class TextDB:
if ((key == "SITE") and (self.commands.get("site_node") is not None) and (len(self.commands.get("site_node")) == 0)):
val = str(os.getenv("sitename"))
msg.addProperty(name=key,value=val,replace=True)
elif(isJoin == True):
msg.addProperty(name=key,value=data,replace=True)
isJoin = False
else:
msg.addProperty(name=key,value=data[value],replace=True)
else:
@ -472,7 +479,7 @@ class TextDB:
subJoins = self.commands.get(key)
length = len(self.commands.get(key))
#specifically looking for config.flags of subJoins
if length == 6:
if length <= 6:
for pos in range(0, length, 2):
value = config.flags.get(subJoins[pos])[0]
try:

View file

@ -42,6 +42,7 @@
# include path to python lib.
# 11/02/12 1236 dgilling Add --forcepractice flag to
# bypass test mode check.
# 05/09/12 16215 m.gamazaychikov Added quotes around $flag.
##############################################################################
# this allows you to run this script from outside of ./bin
@ -59,11 +60,11 @@ export PYTHONPATH=${RUN_FROM_DIR}/src:$PYTHONPATH
forcePractice="FALSE"
declare -a parsedArgs
for flag in $@; do
if [ $flag == "--forcepractice" ]; then
for flag in "$@"; do
if [ "$flag" == "--forcepractice" ]; then
forcePractice="TRUE"
else
parsedArgs=("${parsedArgs[@]}" $flag)
parsedArgs=("${parsedArgs[@]}" "$flag")
fi
done

View file

@ -12,8 +12,11 @@
# This allows you to call this script from outside of ./standard/bin
RUN_FROM_DIR=`dirname $0`
. $RUN_FROM_DIR/../../set_hydro_env
export MPE_TRANSMIT_BIAS=$(get_apps_defaults mpe_transmit_bias)
export TRANSMIT_BIAS_ON_RERUN=$(get_apps_defaults transmit_bias_on_rerun)
export PPROC_BIN=$(get_apps_defaults pproc_bin)
#
# Transmit the RFC bias message if the user has
# elected to do so on reruns.
#
@ -21,6 +24,8 @@ if [[ "$MPE_TRANSMIT_BIAS" = "ON" && "$TRANSMIT_BIAS_ON_RERUN" = "YES" ]]
then
year=`echo $2 | cut -c5-8`
monthday=`echo $2 | cut -c1-4`
hour=`echo $1`
echo $year$monthday$1
$PPROC_BIN/transmit_rfc_bias $year$monthday$1
fi

View file

@ -43,13 +43,13 @@ RUN_FROM_DIR=`dirname $0`
# These lines are commented out because this script will be run
# from mpe_editor using mpe_editor's environment. If this script
# is run stand alone, these lines must be uncommented.
export FXA_HOME=/awips/fxa
. $FXA_HOME/readenv.sh
. $RUN_FROM_DIR/../../set_hydro_env
export RFC_BIAS_OUTPUT_DIR=$(get_apps_defaults rfc_bias_output_dir)
export PROCESS_BIAS_LOG_DIR=$(get_apps_defaults process_bias_log_dir)
export MPE_TRANSMIT_BIAS=$(get_apps_defaults mpe_transmit_bias)
export PPROC_BIN=$(get_apps_defaults pproc_bin)
export FXA_LOCAL_SITE=$(get_apps_defaults fxa_local_site)
export SYS_JAVA_DIR=$(get_apps_defaults sys_java_dir)
# set java classpath
export CLASSPATH=$DB_DRIVER_PATH:$PPROC_BIN/bias_trans.jar