Merge branch 'omaha_14.3.1' into omaha_14.4.1

Conflicts:
	edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIFieldConverter.java
	edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Cape.py
	edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Dcape.py
	edexOsgi/com.raytheon.uf.common.derivparam.python/utility/common_static/base/derivedParameters/functions/Filter.py
	edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ContextManager.java
	edexOsgi/com.raytheon.uf.edex.ingest/res/spring/persist-ingest.xml

Former-commit-id: 03908ba8ae [formerly ddd6e35478] [formerly e37e40ed19] [formerly b7a1bda98c [formerly e37e40ed19 [formerly 396a7cbfefed07cd25e4f8b1f028c566a06e4065]]]
Former-commit-id: b7a1bda98c
Former-commit-id: d3c134610c7a2e642c723287f1d8135b292eb22c [formerly 9591532ffd]
Former-commit-id: 7a7c1167c2
This commit is contained in:
Steve Harris 2014-05-07 16:01:53 -05:00
commit f1032ccc05
19 changed files with 370 additions and 207 deletions

View file

@ -37,6 +37,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Apr 3, 2012 mnash Initial creation * Apr 3, 2012 mnash Initial creation
* Jan 30, 2014 2698 bclement changed UserId to VenueParticipant * Jan 30, 2014 2698 bclement changed UserId to VenueParticipant
* May 05, 2014 3076 bclement added DISPOSE_ALL
* *
* </pre> * </pre>
* *
@ -48,7 +49,7 @@ import com.vividsolutions.jts.geom.Coordinate;
public class CollaborationDrawingEvent { public class CollaborationDrawingEvent {
public static enum CollaborationEventType { public static enum CollaborationEventType {
DRAW, ERASE, REDO, UNDO, CLEAR, LOCK_USERS, UNLOCK_USERS, CLEAR_ALL, NEW_USER_ARRIVED; DRAW, ERASE, REDO, UNDO, CLEAR, CLEAR_ALL, LOCK_USERS, UNLOCK_USERS, DISPOSE_ALL, NEW_USER_ARRIVED;
} }
@DynamicSerializeElement @DynamicSerializeElement

View file

@ -19,6 +19,9 @@
**/ **/
package com.raytheon.uf.viz.collaboration.display.rsc.telestrator; package com.raytheon.uf.viz.collaboration.display.rsc.telestrator;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -64,6 +67,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Jan 30, 2014 2698 bclement changed UserId to VenueParticipant * Jan 30, 2014 2698 bclement changed UserId to VenueParticipant
* Feb 13, 2014 2751 bclement VenueParticipant refactor * Feb 13, 2014 2751 bclement VenueParticipant refactor
* Mar 18, 2014 2895 njensen Fix concurrent mod exception on dispose * Mar 18, 2014 2895 njensen Fix concurrent mod exception on dispose
* May 05, 2014 3076 bclement old CLEAR_ALL is now DISPOSE_ALL,
* added clearLayers() and getAllDrawingLayers()
* *
* </pre> * </pre>
* *
@ -129,7 +134,7 @@ public class CollaborationDrawingResource extends
CollaborationDrawingEvent event = new CollaborationDrawingEvent( CollaborationDrawingEvent event = new CollaborationDrawingEvent(
resourceData.getDisplayId()); resourceData.getDisplayId());
event.setUserName(myUser); event.setUserName(myUser);
event.setType(CollaborationEventType.CLEAR_ALL); event.setType(CollaborationEventType.DISPOSE_ALL);
sendEvent(event); sendEvent(event);
} }
@ -205,6 +210,18 @@ public class CollaborationDrawingResource extends
} }
} }
/**
* Clear all drawing layers. Does not generate any collaboration events.
* This is not "undoable".
*/
private void clearLayers() {
synchronized (layerMap) {
for (DrawingToolLayer layer : layerMap.values()) {
layer.clearAllDrawingData();
}
}
}
/** /**
* @return the myUser * @return the myUser
*/ */
@ -249,6 +266,23 @@ public class CollaborationDrawingResource extends
return null; return null;
} }
/**
* A collection of drawing layers for resource
*
* @return empty collection if there are no layers
*/
public Collection<DrawingToolLayer> getAllDrawingLayers() {
Collection<DrawingToolLayer> rval;
if (layerMap != null) {
synchronized (layerMap) {
rval = new ArrayList<DrawingToolLayer>(layerMap.values());
}
} else {
rval = Collections.emptyList();
}
return rval;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -377,9 +411,12 @@ public class CollaborationDrawingResource extends
case UNDO: case UNDO:
layer.undo(); layer.undo();
break; break;
case CLEAR_ALL: case DISPOSE_ALL:
disposeLayers(); disposeLayers();
break; break;
case CLEAR_ALL:
clearLayers();
break;
case NEW_USER_ARRIVED: case NEW_USER_ARRIVED:
CollaborationDrawingToolLayer myLayer = (CollaborationDrawingToolLayer) getDrawingLayerFor(getMyUser()); CollaborationDrawingToolLayer myLayer = (CollaborationDrawingToolLayer) getDrawingLayerFor(getMyUser());
InitialCollaborationData dataBundle = new InitialCollaborationData( InitialCollaborationData dataBundle = new InitialCollaborationData(

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

View file

@ -21,6 +21,7 @@ package com.raytheon.uf.viz.collaboration.ui.session;
**/ **/
import java.util.Collection; import java.util.Collection;
import java.util.Collections;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
import java.util.Map; import java.util.Map;
@ -101,6 +102,7 @@ import com.raytheon.viz.ui.input.EditableManager;
* Mar 11, 2014 2865 lvenable Added null checks in threads * Mar 11, 2014 2865 lvenable Added null checks in threads
* Mar 18, 2014 2895 njensen Fix lockAction enable/disable logic * Mar 18, 2014 2895 njensen Fix lockAction enable/disable logic
* Apr 15, 2014 2822 bclement only allow transfer leader if participant is using shared display * Apr 15, 2014 2822 bclement only allow transfer leader if participant is using shared display
* May 05, 2014 3076 bclement added clear all action
* *
* </pre> * </pre>
* *
@ -140,6 +142,8 @@ public class CollaborationSessionView extends SessionView implements
private ActionContributionItem lockAction; private ActionContributionItem lockAction;
private ActionContributionItem clearAllAction;
private ControlContribution noEditorAction; private ControlContribution noEditorAction;
private ISharedDisplaySession session; private ISharedDisplaySession session;
@ -181,6 +185,21 @@ public class CollaborationSessionView extends SessionView implements
return null; return null;
} }
/**
* @see CollaborationDrawingResource#getAllDrawingLayers()
* @return empty collection if no layers are found
*/
private Collection<DrawingToolLayer> getAllLayers() {
Collection<DrawingToolLayer> rval;
CollaborationDrawingResource resource = getCurrentDrawingResource();
if (resource != null) {
rval = resource.getAllDrawingLayers();
} else {
rval = Collections.emptyList();
}
return rval;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *
@ -354,7 +373,15 @@ public class CollaborationSessionView extends SessionView implements
lockAction.getAction().setImageDescriptor( lockAction.getAction().setImageDescriptor(
IconUtil.getImageDescriptor(Activator.getDefault().getBundle(), IconUtil.getImageDescriptor(Activator.getDefault().getBundle(),
"lock.gif")); "lock.gif"));
clearAllAction = new ActionContributionItem(new Action("Clear All") {
@Override
public void run() {
clearAllDrawingLayers();
}
});
clearAllAction.getAction().setImageDescriptor(
IconUtil.getImageDescriptor(Activator.getDefault().getBundle(),
"clear_all.gif"));
noEditorAction = new ControlContribution("noEditorAction") { noEditorAction = new ControlContribution("noEditorAction") {
@Override @Override
@ -383,12 +410,30 @@ public class CollaborationSessionView extends SessionView implements
mgr.insert(mgr.getSize() - 1, redoAction); mgr.insert(mgr.getSize() - 1, redoAction);
mgr.insert(mgr.getSize() - 1, clearAction); mgr.insert(mgr.getSize() - 1, clearAction);
mgr.insert(mgr.getSize() - 1, eraseAction); mgr.insert(mgr.getSize() - 1, eraseAction);
mgr.insert(mgr.getSize() - 1, new Separator());
mgr.insert(mgr.getSize() - 1, lockAction); mgr.insert(mgr.getSize() - 1, lockAction);
mgr.insert(mgr.getSize() - 1, clearAllAction);
mgr.insert(mgr.getSize() - 1, new Separator()); mgr.insert(mgr.getSize() - 1, new Separator());
updateToolItems(); updateToolItems();
} }
/**
* Clear all drawing layers and send clear all event
*/
private void clearAllDrawingLayers() {
for (DrawingToolLayer layer : getAllLayers()) {
layer.clearAllDrawingData();
}
CollaborationDrawingResource resource = getCurrentDrawingResource();
CollaborationDrawingEvent event = new CollaborationDrawingEvent(
resource.getResourceData().getDisplayId());
event.setType(CollaborationEventType.CLEAR_ALL);
event.setUserName(resource.getMyUser());
resource.sendEvent(event);
updateToolItems();
}
private void toggleDrawMode(DrawMode mode) { private void toggleDrawMode(DrawMode mode) {
if (mode != DrawMode.NONE) { if (mode != DrawMode.NONE) {
CollaborationDrawingResource resource = getCurrentDrawingResource(); CollaborationDrawingResource resource = getCurrentDrawingResource();
@ -411,6 +456,20 @@ public class CollaborationSessionView extends SessionView implements
} }
} }
/**
* @return true if any drawing layer has been drawn on
*/
private boolean anyLayerHasDrawing() {
boolean anyCanClear = false;
for (DrawingToolLayer dtl : getAllLayers()) {
if (dtl.hasDrawing()) {
anyCanClear = true;
break;
}
}
return anyCanClear;
}
public void updateToolItems() { public void updateToolItems() {
ToolBarManager mgr = (ToolBarManager) getViewSite().getActionBars() ToolBarManager mgr = (ToolBarManager) getViewSite().getActionBars()
.getToolBarManager(); .getToolBarManager();
@ -419,24 +478,21 @@ public class CollaborationSessionView extends SessionView implements
mgr.insert(0, noEditorAction); mgr.insert(0, noEditorAction);
} }
CollaborationDrawingResource currentResource = getCurrentDrawingResource(); CollaborationDrawingResource currentResource = getCurrentDrawingResource();
DrawingToolLayer layer = null; DrawingToolLayer layer = getCurrentLayer();
if (currentResource != null) {
layer = currentResource.getDrawingLayerFor(currentResource
.getMyUser());
}
if (layer != null && currentResource.isSessionLeader()) { if (layer != null && currentResource.isSessionLeader()) {
lockAction.getAction().setEnabled(true); lockAction.getAction().setEnabled(true);
clearAllAction.getAction().setEnabled(anyLayerHasDrawing());
} else { } else {
lockAction.getAction().setEnabled(false); lockAction.getAction().setEnabled(false);
clearAllAction.getAction().setEnabled(false);
} }
// enable/disable toolbar buttons based on locked // enable/disable toolbar buttons based on locked
if (layer != null if (layer != null
&& (locked == false || currentResource.isSessionLeader())) { && (locked == false || currentResource.isSessionLeader())) {
drawAction.getAction().setEnabled(true); drawAction.getAction().setEnabled(true);
undoAction.getAction().setEnabled(layer.canUndo()); undoAction.getAction().setEnabled(layer.canUndo());
redoAction.getAction().setEnabled(layer.canRedo()); redoAction.getAction().setEnabled(layer.canRedo());
clearAction.getAction().setEnabled(layer.canClear()); clearAction.getAction().setEnabled(layer.hasDrawing());
eraseAction.getAction().setEnabled(true); eraseAction.getAction().setEnabled(true);
switch (layer.getDrawMode()) { switch (layer.getDrawMode()) {
case DRAW: case DRAW:

View file

@ -65,6 +65,8 @@ import com.vividsolutions.jts.geom.TopologyException;
* May 23, 2012 mschenke Initial creation * May 23, 2012 mschenke Initial creation
* May 23, 2012 2646 bsteffen Fix NPE in project. * May 23, 2012 2646 bsteffen Fix NPE in project.
* Apr 03, 2014 2967 njensen Fix error when erasing the last part of a line * Apr 03, 2014 2967 njensen Fix error when erasing the last part of a line
* May 05, 2014 3076 bclement added clearAllDrawingData() and disposeWireframeShape()
* renamed canClear() to hasDrawing()
* *
* </pre> * </pre>
* *
@ -331,15 +333,7 @@ public class DrawingToolLayer implements IRenderable {
* Disposes the data in the layer * Disposes the data in the layer
*/ */
public void dispose() { public void dispose() {
synchronized (currentData) { clearAllDrawingData();
if (wireframeShape != null) {
wireframeShape.dispose();
}
currentData.geometries.clear();
currentDrawingLine = null;
undoStack.clear();
redoStack.clear();
}
} }
/** /**
@ -503,7 +497,7 @@ public class DrawingToolLayer implements IRenderable {
* *
* @return * @return
*/ */
public boolean canClear() { public boolean hasDrawing() {
return currentData.geometries.size() > 0 || redoStack.size() > 0; return currentData.geometries.size() > 0 || redoStack.size() > 0;
} }
@ -535,6 +529,20 @@ public class DrawingToolLayer implements IRenderable {
} }
} }
/**
* Clears the current display and the undo and redo stacks. This operation
* is not "undoable"
*/
public void clearAllDrawingData() {
synchronized (currentData) {
disposeWireframeShape();
currentData.geometries.clear();
currentDrawingLine = null;
undoStack.clear();
redoStack.clear();
}
}
/** /**
* Pushes currentData on pushStack and pops next frame from popStack and * Pushes currentData on pushStack and pops next frame from popStack and
* puts in currentData * puts in currentData
@ -568,6 +576,13 @@ public class DrawingToolLayer implements IRenderable {
StackFrame oldData = new StackFrame(new ArrayList<Geometry>( StackFrame oldData = new StackFrame(new ArrayList<Geometry>(
currentData.geometries)); currentData.geometries));
stack.push(oldData); stack.push(oldData);
disposeWireframeShape();
}
/**
* disposes and sets wireframeShape to null if not already null
*/
private void disposeWireframeShape() {
if (wireframeShape != null) { if (wireframeShape != null) {
wireframeShape.dispose(); wireframeShape.dispose();
wireframeShape = null; wireframeShape = null;

View file

@ -91,6 +91,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Changes for non-blocking LoadSaveDeleteSelectDlg. * Changes for non-blocking LoadSaveDeleteSelectDlg.
* Mar 28, 2013 #1790 rferrel Bug fix for non-blocking dialogs. * Mar 28, 2013 #1790 rferrel Bug fix for non-blocking dialogs.
* Apr, 15, 2013 #1911 dhladky dialog wouldn't open every time to retrieve file. * Apr, 15, 2013 #1911 dhladky dialog wouldn't open every time to retrieve file.
* May 05, 2014 #3109 lvenable Removed code that sets the cursor on Cave because it doesn't need
* to be set.
* *
* </pre> * </pre>
* *
@ -310,8 +312,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction,
public FFFGDlg(Shell parentShell) { public FFFGDlg(Shell parentShell) {
super(parentShell, SWT.DIALOG_TRIM, CAVE.INDEPENDENT_SHELL super(parentShell, SWT.DIALOG_TRIM, CAVE.INDEPENDENT_SHELL
| CAVE.DO_NOT_BLOCK); | CAVE.DO_NOT_BLOCK);
this.getParent().setCursor(
this.getParent().getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
setText("Forced Flash Flood Guidance"); setText("Forced Flash Flood Guidance");
sourceCompArray = new ArrayList<SourceComp>(); sourceCompArray = new ArrayList<SourceComp>();
@ -808,15 +809,9 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction,
applyBtn.addSelectionListener(new SelectionAdapter() { applyBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
getParent().setCursor(
getParent().getDisplay().getSystemCursor(
SWT.CURSOR_WAIT));
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
applyDataAction(); applyDataAction();
updateFileStatusLabel(false); updateFileStatusLabel(false);
getParent().setCursor(
getParent().getDisplay().getSystemCursor(
SWT.CURSOR_ARROW));
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_ARROW)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
saveFileAs(); saveFileAs();
@ -886,6 +881,7 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction,
* -1 = error, 0 = information message * -1 = error, 0 = information message
* @param message * @param message
*/ */
@Override
public void setStatusMsg(int status, String message) { public void setStatusMsg(int status, String message) {
if (message == null) { if (message == null) {
statusLbl.setText(""); statusLbl.setText("");
@ -2223,10 +2219,6 @@ public class FFFGDlg extends CaveSWTDialog implements ISourceCompAction,
sc.populateSourceComp(); sc.populateSourceComp();
statusLbl.setText(""); statusLbl.setText("");
this.getParent()
.setCursor(
this.getParent().getDisplay()
.getSystemCursor(SWT.CURSOR_ARROW));
} }
/* /*

View file

@ -28,7 +28,8 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.viz.datacube;bundle-version="1.14.0", com.raytheon.uf.viz.datacube;bundle-version="1.14.0",
com.raytheon.uf.common.dataplugin.level, com.raytheon.uf.common.dataplugin.level,
com.raytheon.uf.common.comm, com.raytheon.uf.common.comm,
com.raytheon.uf.common.numeric com.raytheon.uf.common.numeric,
com.raytheon.viz.alerts
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.viz.satellite, Export-Package: com.raytheon.viz.satellite,
com.raytheon.viz.satellite.rsc com.raytheon.viz.satellite.rsc

View file

@ -53,6 +53,9 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.alerts.AlertMessage;
import com.raytheon.viz.alerts.IAlertObserver;
import com.raytheon.viz.alerts.observers.ProductAlertObserver;
/** /**
* Inventory of available satellite data. sectorID is used for source and * Inventory of available satellite data. sectorID is used for source and
@ -65,13 +68,15 @@ import com.raytheon.uf.common.time.DataTime;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------- -------- ----------- -------------------------- * ------------- -------- ----------- --------------------------
* Apr 09, 2014 2947 bsteffen Initial creation * Apr 09, 2014 2947 bsteffen Initial creation
* May 06, 2014 3117 bsteffen Update for new data.
* *
* </pre> * </pre>
* *
* @author bsteffen * @author bsteffen
* @version 1.0 * @version 1.0
*/ */
public class SatelliteInventory extends AbstractInventory { public class SatelliteInventory extends AbstractInventory implements
IAlertObserver {
private static final IUFStatusHandler statusHandler = UFStatus private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(SatelliteInventory.class); .getHandler(SatelliteInventory.class);
@ -88,6 +93,10 @@ public class SatelliteInventory extends AbstractInventory {
private Level level; private Level level;
public SatelliteInventory() {
ProductAlertObserver.addObserver(SATELLITE, this);
}
@Override @Override
public List<DataTime> timeAgnosticQuery(Map<String, RequestConstraint> query) { public List<DataTime> timeAgnosticQuery(Map<String, RequestConstraint> query) {
/* Returning null means no data will be time agnostic. */ /* Returning null means no data will be time agnostic. */
@ -226,4 +235,26 @@ public class SatelliteInventory extends AbstractInventory {
} }
} }
@Override
public void alertArrived(Collection<AlertMessage> alertMessages) {
if (dataTree == null) {
return;
}
for (AlertMessage message : alertMessages) {
String sector = message.decodedAlert.get(SECTOR_ID).toString();
String pe = message.decodedAlert.get(PHYSICALELEMENT).toString();
if (dataTree.getParameterNode(sector, pe) == null) {
/*
* When a sector or element arrives that is not known reinit the
* tree to ensure no nodes are missing.
*/
try {
initTree(derParLibrary);
} catch (DataCubeException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
return;
}
}
}
} }

View file

@ -100,6 +100,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* rules. * rules.
* Apr 09, 2014 2947 bsteffen Improve flexibility of sat derived * Apr 09, 2014 2947 bsteffen Improve flexibility of sat derived
* parameters, implement ImageProvider * parameters, implement ImageProvider
* May 06, 2014 njensen Improve error message
* *
* </pre> * </pre>
* *
@ -257,7 +258,7 @@ public class SatResource extends
initializeFirstFrame((SatelliteRecord) pdo); initializeFirstFrame((SatelliteRecord) pdo);
} catch (VizException e) { } catch (VizException e) {
throw new IllegalStateException( throw new IllegalStateException(
"Unable to initialize the satellite resource"); "Unable to initialize the satellite resource", e);
} }
initialized = true; initialized = true;
} }

View file

@ -1,2 +1,2 @@
# The number of smart init threads to use # The number of smart init threads to use
smartinit.threads=2 smartinit.threads=1

View file

@ -86,8 +86,35 @@
--> -->
<!-- <!--
Text routes Text routes.
If an internal route (see ContextManager.INTERNAL_ENDPOINT_TYPES) is being sent data from another internal
route in the same context it needs to come after the route that sends it data for proper startup/shutdown order.
--> -->
<route id="textUndecodedIngestRoute">
<from uri="jms-durable:queue:Ingest.Text?concurrentConsumers=2" />
<setHeader headerName="pluginName">
<constant>text</constant>
</setHeader>
<doTry>
<pipeline>
<bean ref="stringToFile" />
<bean ref="textDecoder" method="decodeFile" />
<bean ref="processUtil" method="log"/>
<multicast>
<!-- This route needs to go to Mark's -->
<to uri="direct:textToWatchWarn"/>
<to uri="direct:textSerializeRoute" />
<to uri="direct:textPurgeAccumulate" />
<to uri="vm:autoFaxRoute" />
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:text?level=INFO"/>
</doCatch>
</doTry>
</route>
<route id="textDirectDecodedIngestRoute"> <route id="textDirectDecodedIngestRoute">
<from uri="direct-vm:textDirectDecodedIngestRoute" /> <from uri="direct-vm:textDirectDecodedIngestRoute" />
<setHeader headerName="pluginName"> <setHeader headerName="pluginName">
@ -134,31 +161,6 @@
</doTry> </doTry>
</route> </route>
<route id="textUndecodedIngestRoute">
<from uri="jms-durable:queue:Ingest.Text?concurrentConsumers=2" />
<setHeader headerName="pluginName">
<constant>text</constant>
</setHeader>
<doTry>
<pipeline>
<bean ref="stringToFile" />
<bean ref="textDecoder" method="decodeFile" />
<bean ref="processUtil" method="log"/>
<multicast>
<!-- This route needs to go to Mark's -->
<to uri="direct:textToWatchWarn"/>
<to uri="direct:textSerializeRoute" />
<to uri="direct:textPurgeAccumulate" />
<to uri="vm:autoFaxRoute" />
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:text?level=INFO"/>
</doCatch>
</doTry>
</route>
<route id="textToWatchWarnRoute"> <route id="textToWatchWarnRoute">
<from uri="direct:textToWatchWarn" /> <from uri="direct:textToWatchWarn" />
<bean ref="textDecoder" method="transformToProductIds" /> <bean ref="textDecoder" method="transformToProductIds" />

View file

@ -36,6 +36,7 @@ import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.gridcoverage.GridCoverage; import com.raytheon.uf.common.gridcoverage.GridCoverage;
import com.raytheon.uf.common.gridcoverage.convert.GridCoverageConverter; import com.raytheon.uf.common.gridcoverage.convert.GridCoverageConverter;
import com.raytheon.uf.common.parameter.Parameter; import com.raytheon.uf.common.parameter.Parameter;
import com.raytheon.uf.common.parameter.ParameterConverter;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@ -106,7 +107,7 @@ public class GridInfoRecord extends PersistableDataObject<Integer> {
@ManyToOne @ManyToOne
@PrimaryKeyJoinColumn @PrimaryKeyJoinColumn
@DataURI(position = 4, embedded = true) @DataURI(position = 4, converter = ParameterConverter.class)
@DynamicSerializeElement @DynamicSerializeElement
private Parameter parameter; private Parameter parameter;

View file

@ -34,7 +34,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
@ -71,7 +70,6 @@ public class Parameter extends PersistableDataObject implements
@Id @Id
@DynamicSerializeElement @DynamicSerializeElement
@XmlElement @XmlElement
@DataURI(position = 0)
private String abbreviation; private String abbreviation;
@Column(nullable = false) @Column(nullable = false)

View file

@ -0,0 +1,59 @@
/**
* 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.parameter;
import com.raytheon.uf.common.dataplugin.annotations.DataURIFieldConverter;
import com.raytheon.uf.common.parameter.lookup.ParameterLookup;
/**
* A DataURIFieldConverter that ensures that a String parameter abbreviation
* will be looked up to potentially contain all the fields.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 6, 2014 2060 njensen Initial creation
*
* </pre>
*
* @author njensen
* @version 1.0
*/
public class ParameterConverter implements DataURIFieldConverter<Parameter> {
@Override
public String toString(Parameter field) {
return field.getAbbreviation();
}
@Override
public Parameter fromString(String string) {
Parameter p = ParameterLookup.getInstance().getParameter(string);
if (p == null) {
p = new Parameter(string);
}
return p;
}
}

View file

@ -2,11 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: DatUtils Plug-in Bundle-Name: DatUtils Plug-in
Bundle-SymbolicName: com.raytheon.uf.edex.dat.utils Bundle-SymbolicName: com.raytheon.uf.edex.dat.utils
Bundle-Version: 1.12.1174.qualifier Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.uf.common.dataplugin.ffmp, Import-Package: com.raytheon.uf.common.dataplugin.grid,
com.raytheon.uf.common.dataplugin.grid,
com.raytheon.uf.common.dataplugin.scan.data, com.raytheon.uf.common.dataplugin.scan.data,
com.raytheon.uf.common.localization, com.raytheon.uf.common.localization,
com.raytheon.uf.common.monitor.xml, com.raytheon.uf.common.monitor.xml,
@ -14,7 +13,6 @@ Import-Package: com.raytheon.uf.common.dataplugin.ffmp,
org.apache.commons.logging org.apache.commons.logging
Export-Package: com.raytheon.uf.edex.dat.utils Export-Package: com.raytheon.uf.edex.dat.utils
Require-Bundle: com.raytheon.edex.common;bundle-version="1.12.2", Require-Bundle: com.raytheon.edex.common;bundle-version="1.12.2",
com.raytheon.uf.common.dataplugin.ffmp;bundle-version="1.12.2",
com.raytheon.uf.common.monitor;bundle-version="1.12.2", com.raytheon.uf.common.monitor;bundle-version="1.12.2",
com.raytheon.uf.common.dataplugin.shef;bundle-version="1.12.1174", com.raytheon.uf.edex.menus;bundle-version="1.0.0",
com.raytheon.uf.edex.menus;bundle-version="1.0.0" com.raytheon.uf.common.parameter

View file

@ -1,5 +1,3 @@
package com.raytheon.uf.edex.dat.utils;
/** /**
* This software was developed and / or modified by Raytheon Company, * This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government. * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
@ -19,6 +17,9 @@ package com.raytheon.uf.edex.dat.utils;
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.uf.edex.dat.utils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;

View file

@ -19,10 +19,13 @@
**/ **/
package com.raytheon.uf.edex.ohd.pproc; package com.raytheon.uf.edex.ohd.pproc;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.grid.GridConstants;
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage; import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
/** /**
* TODO Add Description * Filters URIs for Satellite Precip and generates an xmrg file if the filter
* matches.
* *
* <pre> * <pre>
* *
@ -32,6 +35,7 @@ import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
* Sep 10, 2009 snaples Initial creation * Sep 10, 2009 snaples Initial creation
* Feb 12, 2010 4635 snaples Updated to match more generically. * Feb 12, 2010 4635 snaples Updated to match more generically.
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin * Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
* May 05, 2014 2060 njensen Cleanup
* *
* </pre> * </pre>
* *
@ -41,22 +45,22 @@ import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
public class SatPreURIFilter { public class SatPreURIFilter {
DataURINotificationMessage message; private static final String AUTOSPE = "AUTOSPE";
String outpath = ""; private String startFilter;
static final String AUTOSPE = "AUTOSPE"; private SatPrecipFileBuilder builder;
public SatPreURIFilter() { public SatPreURIFilter() throws Exception {
startFilter = DataURI.SEPARATOR + GridConstants.GRID;
builder = new SatPrecipFileBuilder();
} }
public void matchURI(DataURINotificationMessage msg) { public void matchURI(DataURINotificationMessage msg) throws Exception {
message = msg; if (msg instanceof DataURINotificationMessage) {
if (message instanceof DataURINotificationMessage) {
String uri = ""; String uri = "";
for (String data : message.getDataURIs()) { for (String data : msg.getDataURIs()) {
if (data.startsWith("/grid")) { if (data.startsWith(startFilter)) {
if (data.contains(AUTOSPE)) { if (data.contains(AUTOSPE)) {
uri = data; uri = data;
break; break;
@ -68,10 +72,7 @@ public class SatPreURIFilter {
} }
} }
if (uri.length() > 1) { if (uri.length() > 1) {
SatPrecipFileBuilder sb = new SatPrecipFileBuilder(uri); builder.createSatPre(uri);
sb.createSatPre();
} else {
return;
} }
} }
} }

View file

@ -22,42 +22,43 @@ package com.raytheon.uf.edex.ohd.pproc;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.TimeZone;
import javax.measure.converter.UnitConverter; import javax.measure.converter.UnitConverter;
import javax.measure.unit.SI; import javax.measure.unit.SI;
import javax.measure.unit.Unit; import javax.measure.unit.Unit;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.datastorage.IDataStore; import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.datastorage.records.ShortDataRecord;
import com.raytheon.uf.common.hydro.spatial.HRAP; import com.raytheon.uf.common.hydro.spatial.HRAP;
import com.raytheon.uf.common.hydro.spatial.HRAPCoordinates; import com.raytheon.uf.common.hydro.spatial.HRAPCoordinates;
import com.raytheon.uf.common.mpe.util.XmrgFile; import com.raytheon.uf.common.mpe.util.XmrgFile;
import com.raytheon.uf.common.mpe.util.XmrgFile.XmrgHeader; import com.raytheon.uf.common.mpe.util.XmrgFile.XmrgHeader;
import com.raytheon.uf.common.ohd.AppsDefaults; import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.common.units.UnitConv; import com.raytheon.uf.common.units.UnitConv;
import com.raytheon.uf.edex.database.plugin.PluginDao; import com.raytheon.uf.edex.database.plugin.PluginDao;
import com.raytheon.uf.edex.database.plugin.PluginFactory; import com.raytheon.uf.edex.database.plugin.PluginFactory;
/** /**
* TODO Add Description * Builder for xmrg files that contain satellite precip data.
* *
* <pre> * <pre>
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Sep 8, 2009 snaples Initial creation * Sep 08, 2009 snaples Initial creation
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin * Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
* Mar 19, 2014 17109 snaples Removed code that adds 1 hour to grid reftime, was not needed. * Mar 19, 2014 17109 snaples Removed code that adds 1 hour to grid reftime, was not needed.
* May 05, 2014 2060 njensen Major cleanup and remove dependency on grid dataURI
*
* *
* </pre> * </pre>
* *
@ -67,25 +68,8 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
public class SatPrecipFileBuilder { public class SatPrecipFileBuilder {
Rectangle extent = null; private static final IUFStatusHandler logger = UFStatus
.getHandler(SatPrecipFileBuilder.class);
XmrgFile xmfile = null;
GridRecord gr = null;
private IDataRecord dataRec;
private String uri = "";
private String outputPath = "";
private short[] data;
private static final SimpleDateFormat sdf = new SimpleDateFormat(
"yyyyMMddHH");
static {
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
}
private static final String FILEPRE = "SATPRE"; private static final String FILEPRE = "SATPRE";
@ -99,44 +83,58 @@ public class SatPrecipFileBuilder {
private static final String USER = "SANmdY"; private static final String USER = "SANmdY";
private Date grReftime = null; private Rectangle extent = null;
private int height; private int height;
private int width; private int width;
private static int minX; private int minX;
private static int minY; private int minY;
private static int maxX; private int maxY;
private static int maxY; private SimpleDateFormat sdf;
public SatPrecipFileBuilder(String datauri) { private String outputPath;
uri = datauri;
public SatPrecipFileBuilder() throws Exception {
extent = HRAPCoordinates.getHRAPCoordinates();
maxY = (int) (HRAP.getInstance().getNy() - extent.getMinY());
minY = (int) (maxY - extent.getHeight());
minX = (int) extent.getMinX();
width = (int) (extent.getWidth());
height = (int) (extent.getHeight());
sdf = new SimpleDateFormat("yyyyMMddHH");
sdf.setTimeZone(TimeUtil.GMT_TIME_ZONE);
AppsDefaults appsDefaults = AppsDefaults.getInstance();
outputPath = appsDefaults.getToken("mpe_satpre_dir");
File outputDir = new File(outputPath);
if (!outputDir.exists()) {
outputDir.mkdirs();
}
} }
public void createSatPre() { /**
* Retrieves a grid record, converts the data to millimeters, and stores it
* to an xmrg file.
*
* @param uri
* the data URI of the grid record
*/
public void createSatPre(String uri) {
try { try {
getGridRecord(); GridRecord gr = getGridRecord(uri);
} catch (PluginException e) { float[] fa = (float[]) gr.getMessageData();
e.printStackTrace();
}
float[] fa = null;
fa = new float[((float[]) gr.getMessageData()).length];
fa = (float[]) gr.getMessageData();
String gribUnit = gr.getParameter().getUnitString(); String gribUnit = gr.getParameter().getUnitString();
UnitConverter cv = null; UnitConverter cv = null;
Unit<?> gi = Unit.ONE; Unit<?> gi = UnitConv.deserializer(gribUnit);
try {
gi = UnitConv.deserializer(gribUnit);
} catch (ParseException e) {
e.printStackTrace();
}
Unit<?> xOut = SI.MILLIMETER; Unit<?> xOut = SI.MILLIMETER;
cv = gi.getConverterTo(xOut); cv = gi.getConverterTo(xOut);
data = new short[fa.length]; short[] data = new short[fa.length];
int k = 0; int k = 0;
for (int i = 0; i < height; i++) { for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) { for (int j = 0; j < width; j++) {
@ -148,21 +146,18 @@ public class SatPrecipFileBuilder {
} }
} }
fa = null; fa = null;
createXmrgFile(); createXmrgFile(data, gr.getDataTime().getRefTime());
} catch (Exception e) {
logger.error("Error creating sat precip xmrg file for URI " + uri,
e);
}
} }
private void createXmrgFile() { private void createXmrgFile(short[] data, Date grReftime)
throws IOException {
AppsDefaults appsDefaults = AppsDefaults.getInstance();
outputPath = appsDefaults.getToken("mpe_satpre_dir");
File op = new File(outputPath);
if (op.exists() == false) {
op.mkdir();
}
op = null;
String fname = outputPath + File.separatorChar + FILEPRE String fname = outputPath + File.separatorChar + FILEPRE
+ sdf.format(grReftime) + "z"; + sdf.format(grReftime) + "z";
xmfile = new XmrgFile(fname); XmrgFile xmfile = new XmrgFile(fname);
XmrgHeader xmhead = new XmrgHeader(); XmrgHeader xmhead = new XmrgHeader();
xmhead.setValidDate(grReftime); xmhead.setValidDate(grReftime);
xmhead.setSaveDate(grReftime); xmhead.setSaveDate(grReftime);
@ -174,63 +169,34 @@ public class SatPrecipFileBuilder {
xmfile.setHeader(xmhead); xmfile.setHeader(xmhead);
xmfile.setHrapExtent(extent); xmfile.setHrapExtent(extent);
xmfile.setData(data); xmfile.setData(data);
try {
xmfile.save(fname);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
xmfile.save(fname);
} }
/** /**
* get Populated grib record * Get Populated grid record
* *
* @param uri * @param uri
* the uri of the grid record
* @return * @return
*/ */
public void getGridRecord() throws PluginException { private GridRecord getGridRecord(String uri) throws Exception {
try { GridRecord gr = new GridRecord(uri);
extent = HRAPCoordinates.getHRAPCoordinates(); PluginDao gd = PluginFactory.getInstance().getPluginDao(
} catch (Exception e) { gr.getPluginName());
// TODO Auto-generated catch block IDataStore dataStore = gd.getDataStore(gr);
e.printStackTrace();
}
HRAP hr = HRAP.getInstance();
maxY = (int) (hr.getNy() - extent.getMinY());
minY = (int) (maxY - extent.getHeight());
minX = (int) extent.getMinX();
maxX = (int) extent.getMaxX();
width = (int) (extent.getWidth());
height = (int) (extent.getHeight());
int[] minIndex = { minX, minY }; int[] minIndex = { minX, minY };
int[] maxIndex = { minX + width, minY + height }; int[] maxIndex = { minX + width, minY + height };
IDataRecord dataRec = dataStore.retrieve(uri, "Data",
gr = new GridRecord(uri);
PluginDao gd = PluginFactory.getInstance().getPluginDao(
gr.getPluginName());
gr = (GridRecord) gd.getMetadata(uri);
IDataStore dataStore = gd.getDataStore(gr);
try {
dataRec = dataStore.retrieve(uri, "Data",
Request.buildSlab(minIndex, maxIndex)); Request.buildSlab(minIndex, maxIndex));
} catch (Exception se) {
se.printStackTrace();
}
if (dataRec instanceof FloatDataRecord) { if (dataRec instanceof FloatDataRecord) {
gr.setMessageData(((FloatDataRecord) dataRec).getFloatData()); gr.setMessageData(((FloatDataRecord) dataRec).getFloatData());
} else if (dataRec instanceof ShortDataRecord) {
gr.setMessageData(((ShortDataRecord) dataRec).getShortData());
} else { } else {
gr.setMessageData(dataRec); gr.setMessageData(dataRec);
} }
// this get the reftime of the record
grReftime = gr.getDataTime().getRefTime(); return gr;
long millis = grReftime.getTime();
grReftime.setTime(millis);
} }
} }

View file

@ -86,7 +86,10 @@
<bean ref="modelsoundingPersistenceManager" method="run"/> <bean ref="modelsoundingPersistenceManager" method="run"/>
</route> </route>
<!-- Copy of persist route without the log call --> <!--
Copy of persist route without the log call.
This route must come after the timer route for proper startup/shutdown order.
-->
<route id="modelSoundingPersistIndexAlert"> <route id="modelSoundingPersistIndexAlert">
<from uri="direct-vm:modelSoundingPersistIndexAlert"/> <from uri="direct-vm:modelSoundingPersistIndexAlert"/>
<bean ref="persist" method="persist"/> <bean ref="persist" method="persist"/>