Merge branch 'omaha_13.3.1' into development

Conflicts:
	cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/data/IColorMapDataRetrievalCallback.java
	cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/dataformat/GLColorMapDataFormatFactory.java
	cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLCMTextureData.java
	cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/images/GLColormappedImage.java
	cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/internal/ext/mosaic/GLMosaicImageExtension.java
	edexOsgi/com.raytheon.edex.ingestsrv/META-INF/MANIFEST.MF
	edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/BufrUADecoder.java
	edexOsgi/com.raytheon.edex.plugin.gfe/META-INF/MANIFEST.MF
	edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java
	edexOsgi/com.raytheon.edex.plugin.sfcobs/META-INF/MANIFEST.MF
	edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/python/GfePyIncludeUtil.java

Former-commit-id: a23cecdb26 [formerly b0621d90bc [formerly fd71e44f0f] [formerly a23cecdb26 [formerly d0ce26b91945ae5388028c312cbafd314d57c0e6]]]
Former-commit-id: b0621d90bc [formerly fd71e44f0f]
Former-commit-id: b0621d90bc
Former-commit-id: e154e58354
This commit is contained in:
Steve Harris 2013-03-26 10:11:11 -05:00
commit 11825ee814
69 changed files with 2241 additions and 2026 deletions

View file

@ -60,9 +60,6 @@
# Status: TEST # Status: TEST
# Title: AvnFPS: tpo indicator not monitoring properly # Title: AvnFPS: tpo indicator not monitoring properly
# #
# Date Ticket# Engineer Description
# ------------- ---------- ----------- --------------------------
# Feb. 21, 2013 15834 zhao Modified for CCFP 8hr data
# #
import logging, time import logging, time
import Avn, AvnLib, Globals, MonitorP import Avn, AvnLib, Globals, MonitorP
@ -71,10 +68,10 @@ import CCFPData
_Logger = logging.getLogger(__name__) _Logger = logging.getLogger(__name__)
_Code = { \ _Code = { \
'tops': {1: '400+ ', 2: '350-390', 3: '300-340', 4: '250-290'}, \ 'tops': {1: '370+ ', 2: '310-370', 3: '250-310'}, \
'gwth': {1: '+ ', 2: 'NC', 3: '- '}, \ 'gwth': {1: '++', 2: '+ ', 3: 'NC', 4: '- '}, \
'conf': {1: 'HIGH', 3: 'LOW'}, \ 'conf': {1: 'HIGH', 3: 'LOW'}, \
'cvrg': {1: '75-100%', 2: ' 40-74%', 3: ' 25-39%'}, \ 'cvrg': {1: '75-100%', 2: ' 50-74%', 3: ' 25-49%'}, \
} }
############################################################################## ##############################################################################
@ -85,7 +82,7 @@ class Monitor(MonitorP.Monitor):
def __makeData(self, data): def __makeData(self, data):
# 6 hour forecast # 6 hour forecast
tstart = (time.time()//3600.0 + 1) * 3600.0 tstart = (time.time()//3600.0 + 1) * 3600.0
tend = tstart + 9*3600.0 - 10.0 tend = tstart + 7*3600.0 - 10.0
seq = [{'time': t} for t in Avn.frange(tstart, tend, 3600.0)] seq = [{'time': t} for t in Avn.frange(tstart, tend, 3600.0)]
fcst, text = {}, [] fcst, text = {}, []
try: try:

View file

@ -25,9 +25,7 @@
menuText="Convective SIGMET" id="ConvSigmet"> menuText="Convective SIGMET" id="ConvSigmet">
<dataURI>/convsigmet/%</dataURI> <dataURI>/convsigmet/%</dataURI>
</contribute> </contribute>
<contribute xsi:type="bundleItem" file="bundles/BufrNcwf.xml" menuText="NCWF" id="NCWF">
<dataURI>/bufrncwf/%</dataURI>
</contribute>
<contribute xsi:type="separator" id="separator1"/> <contribute xsi:type="separator" id="separator1"/>
<contribute xsi:type="titleItem" titleText="------ Icing Products ------" /> <contribute xsi:type="titleItem" titleText="------ Icing Products ------" />

View file

@ -36,6 +36,8 @@ import com.raytheon.uf.viz.core.exception.VizException;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 17, 2011 mschenke Initial creation * Nov 17, 2011 mschenke Initial creation
* Mar 21, 2013 1806 bsteffen Add ColorMapData constructor that
* creates buffer from the dataType.
* *
* </pre> * </pre>
* *
@ -45,6 +47,40 @@ import com.raytheon.uf.viz.core.exception.VizException;
public interface IColorMapDataRetrievalCallback { public interface IColorMapDataRetrievalCallback {
/**
* @param dataType
* @param dataBounds
*/
public ColorMapData(ColorMapDataType dataType, int[] dimensions) {
this.buffer = getBuffer(dataType, dimensions);
this.dimensions = dimensions;
this.dataType = dataType;
}
}
private static Buffer getBuffer(ColorMapDataType dataType,
int[] dimensions) {
int size = 1;
for (int i : dimensions) {
size *= i;
}
switch (dataType) {
case BYTE:
case SIGNED_BYTE:
return ByteBuffer.allocate(size);
case SHORT:
case UNSIGNED_SHORT:
return ShortBuffer.allocate(size);
case FLOAT:
return FloatBuffer.allocate(size);
case INT:
return IntBuffer.allocate(size);
default:
throw new RuntimeException("Could not find Buffer for "
+ dataType);
}
/** /**
* Get the ColorMapData. IMPORTANT NOTE: This method should retrieve the * Get the ColorMapData. IMPORTANT NOTE: This method should retrieve the
* ColorMapData from wherever it lives. ColorMapData objects should not be * ColorMapData from wherever it lives. ColorMapData objects should not be

View file

@ -116,7 +116,9 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Feb 10, 2013 1584 mpduff Add performance logging. * Feb 10, 2013 1584 mpduff Add performance logging.
* Feb 28, 2013 1729 dhladky Adjusted the way in which the dialog load thread rejoins the main GUI thread. * Feb 28, 2013 1729 dhladky Adjusted the way in which the dialog load thread rejoins the main GUI thread.
* Mar 01, 2013 13228 gzhang Adding field rowName for VGB in County * Mar 01, 2013 13228 gzhang Adding field rowName for VGB in County
* Mar 24, 2013 1818 mpduff Fixed Attributes dialog on multiple opens, needed an isDisposed check.
* </pre> * </pre>
*
* @author lvenable * @author lvenable
* @version 1.0 * @version 1.0
*/ */
@ -255,8 +257,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
private FFMPTableDataLoader dataRetrieveThread = null; private FFMPTableDataLoader dataRetrieveThread = null;
private boolean groupLabelFlag = true; private boolean groupLabelFlag = true;
private String rowName="";// DR 13228 private String rowName = "";// DR 13228
/** /**
* Statistics load event. * Statistics load event.
*/ */
@ -1084,7 +1087,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
// Loop over enum from config singleton to create menu items // Loop over enum from config singleton to create menu items
for (ThreshColNames colName : ThreshColNames.values()) { for (ThreshColNames colName : ThreshColNames.values()) {
if (ffmpConfig.isColorCell(colName) && (colName != ThreshColNames.GUID)) {// DR 14907 if (ffmpConfig.isColorCell(colName)
&& (colName != ThreshColNames.GUID)) {// DR 14907
// only add a menu item if colorCell is true // only add a menu item if colorCell is true
MenuItem mi = new MenuItem(popupMenu, SWT.NONE); MenuItem mi = new MenuItem(popupMenu, SWT.NONE);
mi.setText(colName.name()); mi.setText(colName.name());
@ -1304,7 +1308,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
} }
private void displayAttributesDlg() { private void displayAttributesDlg() {
if (attributeDlg == null) { if (attributeDlg == null || attributeDlg.isDisposed()) {
attrData = ffmpTable.getVisibleColumns(); attrData = ffmpTable.getVisibleColumns();
attributeDlg = new AttributesDlg(shell, resource, attrData, this); attributeDlg = new AttributesDlg(shell, resource, attrData, this);
} }
@ -1770,7 +1774,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|| allOnlySmallBasinsMI.getSelection()) { || allOnlySmallBasinsMI.getSelection()) {
groupLbl.setText(name); groupLbl.setText(name);
} }
rowName=name;// DR 13228 rowName = name;// DR 13228
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT)); shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
fireScreenRecenterEvent(pfaf, 1); fireScreenRecenterEvent(pfaf, 1);
} }
@ -2089,7 +2093,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
public void updateLoadingLabel(FFMPLoaderStatus status) { public void updateLoadingLabel(FFMPLoaderStatus status) {
this.loadStatus = status; this.loadStatus = status;
if (dataLoadComp == null) { if (dataLoadComp == null) {
return; return;
} }
@ -2192,7 +2195,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
if (!this.isDisposed()) { if (!this.isDisposed()) {
VizApp.runAsync(new Runnable() { VizApp.runAsync(new Runnable() {
@Override @Override
public void run() { public void run() {
processUpdate(fupdateData); processUpdate(fupdateData);
@ -2243,9 +2246,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
groupLbl.setText(""); groupLbl.setText("");
} }
} }
// DR 13228 // DR 13228
public String getRowName(){ public String getRowName() {
return this.rowName; return this.rowName;
} }
} }

View file

@ -35,10 +35,25 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.viz.monitor.scan.TrendGraphData; import com.raytheon.uf.viz.monitor.scan.TrendGraphData;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog; import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogAction /**
{ * Scan/DMD Trend Graph Dialog.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 21, 2013 1812 mpduff Redraw now updates with new data.
*
* </pre>
*
* @author lvenable
* @version 1.0
*/
public class TrendGraphDlg extends CaveSWTDialog {
private ScanTables scanTable; private final ScanTables scanTable;
private Combo identCbo; private Combo identCbo;
@ -50,24 +65,34 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
private TrendGraphCanvas trendGraphCanvas; private TrendGraphCanvas trendGraphCanvas;
private ITrendGraphUpdate updateCallback; private final ITrendGraphUpdate updateCallback;
private IRequestTrendGraphData requestDataCallback; private final IRequestTrendGraphData requestDataCallback;
// private LinkedHashMap<Date, Double> dataMap;
private TrendGraphData trendGraphData; private TrendGraphData trendGraphData;
private String[] identArray; private final String[] identArray;
private Integer vcp; private final Integer vcp;
/**
* Constructor.
*
* @param parentShell
* @param scanTable
* @param ident
* @param attrName
* @param updateCallback
* @param requestDataCallback
* @param identArray
* @param vcp
*/
public TrendGraphDlg(Shell parentShell, ScanTables scanTable, String ident, public TrendGraphDlg(Shell parentShell, ScanTables scanTable, String ident,
String attrName, ITrendGraphUpdate updateCallback, String attrName, ITrendGraphUpdate updateCallback,
IRequestTrendGraphData requestDataCallback, String[] identArray, IRequestTrendGraphData requestDataCallback, String[] identArray,
Integer vcp) Integer vcp) {
{ super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK
super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK | CAVE.INDEPENDENT_SHELL); | CAVE.INDEPENDENT_SHELL);
setText(scanTable.name() + " Trend Graph"); setText(scanTable.name() + " Trend Graph");
this.scanTable = scanTable; this.scanTable = scanTable;
@ -76,7 +101,7 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
this.updateCallback = updateCallback; this.updateCallback = updateCallback;
this.requestDataCallback = requestDataCallback; this.requestDataCallback = requestDataCallback;
this.identArray = identArray; this.identArray = identArray;
this.vcp=vcp; this.vcp = vcp;
} }
@Override @Override
@ -92,7 +117,7 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
protected void initializeComponents(Shell shell) { protected void initializeComponents(Shell shell) {
trendGraphData = requestDataCallback.requestTrendGraphData(scanTable, trendGraphData = requestDataCallback.requestTrendGraphData(scanTable,
attrName, ident); attrName, ident);
createTopControls(); createTopControls();
createGraphCanvas(); createGraphCanvas();
} }
@ -135,8 +160,8 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
private void createGraphCanvas() { private void createGraphCanvas() {
trendGraphCanvas = new TrendGraphCanvas(shell, trendGraphData, trendGraphCanvas = new TrendGraphCanvas(shell, trendGraphData,
requestDataCallback.getCurrentDate(), scanTable, requestDataCallback.getCurrentDate(), scanTable, attrName, vcp,
attrName,vcp,requestDataCallback,ident); requestDataCallback, ident);
} }
private void populateIdentCombo() { private void populateIdentCombo() {
@ -165,8 +190,8 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
trendGraphData = requestDataCallback.requestTrendGraphData(scanTable, trendGraphData = requestDataCallback.requestTrendGraphData(scanTable,
attrName, ident); attrName, ident);
trendGraphCanvas.updateAttribute(attrName, trendGraphData, requestDataCallback trendGraphCanvas.updateAttribute(attrName, trendGraphData,
.getCurrentDate()); requestDataCallback.getCurrentDate());
trendGraphCanvas.setIndent(ident); trendGraphCanvas.setIndent(ident);
} }
@ -177,31 +202,33 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
trendGraphData = requestDataCallback.requestTrendGraphData(scanTable, trendGraphData = requestDataCallback.requestTrendGraphData(scanTable,
attrName, ident); attrName, ident);
trendGraphCanvas.updateAttribute(attrName, trendGraphData, requestDataCallback trendGraphCanvas.updateAttribute(attrName, trendGraphData,
.getCurrentDate()); requestDataCallback.getCurrentDate());
} }
/** /**
* Update the trend graph data so the latest data can be displayed. * Update the trend graph data so the latest data can be displayed.
*
* @return true if item is to be disposed * @return true if item is to be disposed
*/ */
public boolean updateTrendGraph() public boolean updateTrendGraph() {
{
trendGraphData = requestDataCallback.requestTrendGraphData(scanTable, trendGraphData = requestDataCallback.requestTrendGraphData(scanTable,
attrName, ident); attrName, ident);
trendGraphCanvas.updateAttribute(attrName, trendGraphData, requestDataCallback trendGraphCanvas.updateAttribute(attrName, trendGraphData,
.getCurrentDate()); requestDataCallback.getCurrentDate());
if (requestDataCallback.cellValid(this.ident) == false) { if (requestDataCallback.cellValid(this.ident) == false) {
return true; return true;
} }
return false; return false;
} }
public void redrawTrendGraph() /**
{ * Redraw the graphs with updated data.
trendGraphCanvas.redrawCanvas(); */
public void redrawTrendGraph() {
updateTrendGraph();
} }
public void displayDialog() { public void displayDialog() {
@ -211,24 +238,12 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
public boolean dialogIsDisposed() { public boolean dialogIsDisposed() {
return shell.isDisposed(); return shell.isDisposed();
} }
/** /**
* Overriding the dispose method to notify that the trend graph is closing. * Overriding the dispose method to notify that the trend graph is closing.
*/ */
@Override @Override
protected void disposed() protected void disposed() {
{
this.updateCallback.trendGraphClosing(this); this.updateCallback.trendGraphClosing(this);
} }
// @Override
// public void closeDialog() {
// this.updateCallback.trendGraphClosing(this);
// shell.dispose();
// }
//
// @Override
// public boolean isDisposed() {
// return shell.isDisposed();
// }
} }

View file

@ -40,11 +40,25 @@ import com.raytheon.uf.common.monitor.scan.config.TrendSetConfigMgr;
import com.raytheon.uf.viz.monitor.scan.TrendGraphData; import com.raytheon.uf.viz.monitor.scan.TrendGraphData;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog; import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
public class TrendSetsGraphDlg extends CaveSWTDialog // implements /**
// ICommonDialogAction * Scan/DMD Trend Sets Graph Dialog.
{ *
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 21, 2013 1812 mpduff Redraw now updates with new data.
*
* </pre>
*
* @author lvenable
* @version 1.0
*/
public class TrendSetsGraphDlg extends CaveSWTDialog {
private ScanTables scanTable; private final ScanTables scanTable;
private Combo identCbo; private Combo identCbo;
@ -56,15 +70,15 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
private TrendSetConfigMgr trendCfgMgr; private TrendSetConfigMgr trendCfgMgr;
private ITrendSetsGraphUpdate updateCallback; private final ITrendSetsGraphUpdate updateCallback;
private IRequestTrendGraphData requestDataCallback; private final IRequestTrendGraphData requestDataCallback;
// private LinkedHashMap<Date, Double> dataMap; // private LinkedHashMap<Date, Double> dataMap;
private LinkedHashMap<String, TrendGraphData> trendSetData; private LinkedHashMap<String, TrendGraphData> trendSetData;
private String[] identArray; private final String[] identArray;
private String[] attrArray; private String[] attrArray;
@ -72,14 +86,27 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
private HashMap<String, TrendGraphCanvas> canvasMap; private HashMap<String, TrendGraphCanvas> canvasMap;
private Integer vcp; private final Integer vcp;
/**
* Constructor.
*
* @param parentShell
* @param scanTable
* @param ident
* @param trendSetName
* @param updateCallback
* @param requestDataCallback
* @param identArray
* @param vcp
*/
public TrendSetsGraphDlg(Shell parentShell, ScanTables scanTable, public TrendSetsGraphDlg(Shell parentShell, ScanTables scanTable,
String ident, String trendSetName, String ident, String trendSetName,
ITrendSetsGraphUpdate updateCallback, ITrendSetsGraphUpdate updateCallback,
IRequestTrendGraphData requestDataCallback, String[] identArray, IRequestTrendGraphData requestDataCallback, String[] identArray,
Integer vcp) { Integer vcp) {
super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK | CAVE.INDEPENDENT_SHELL); super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK
| CAVE.INDEPENDENT_SHELL);
setText(scanTable.name() + " Trend Graph"); setText(scanTable.name() + " Trend Graph");
this.scanTable = scanTable; this.scanTable = scanTable;
@ -153,7 +180,6 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
shell.dispose(); shell.dispose();
// closeDialog();
} }
}); });
} }
@ -223,11 +249,10 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
trendSetData.clear(); trendSetData.clear();
// Loop through all of the attributes and call update and store the data // Loop through all of the attributes and call update and store the data
// map for // map for each attribute
// each attribute
for (String attr : attrArray) { for (String attr : attrArray) {
TrendGraphData tgd = requestDataCallback TrendGraphData tgd = requestDataCallback.requestTrendGraphData(
.requestTrendGraphData(scanTable, attr, ident); scanTable, attr, ident);
trendSetData.put(attr, tgd); trendSetData.put(attr, tgd);
// Call the update call back so the table can manage this dialog. // Call the update call back so the table can manage this dialog.
@ -252,8 +277,8 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
for (String attr : attrArray) { for (String attr : attrArray) {
System.out.println("Change trend set - attr = " + attr); System.out.println("Change trend set - attr = " + attr);
TrendGraphData tgd = requestDataCallback TrendGraphData tgd = requestDataCallback.requestTrendGraphData(
.requestTrendGraphData(scanTable, attr, ident); scanTable, attr, ident);
trendSetData.put(attr, tgd); trendSetData.put(attr, tgd);
} }
@ -272,36 +297,35 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
* @return true if item is to be disposed * @return true if item is to be disposed
*/ */
public boolean updateTrendSetsGraph() { public boolean updateTrendSetsGraph() {
trendSetData.clear(); trendSetData.clear();
// Loop through all of the attributes and call update and store the data // Loop through all of the attributes and call update and store the data
// map for // map for
// each attribute // each attribute
for (String attr : attrArray) { for (String attr : attrArray) {
TrendGraphData tgd = requestDataCallback TrendGraphData tgd = requestDataCallback.requestTrendGraphData(
.requestTrendGraphData(scanTable, attr, ident); scanTable, attr, ident);
trendSetData.put(attr, tgd); trendSetData.put(attr, tgd);
// Call the update call back so the table can manage this dialog. // Call the update call back so the table can manage this dialog.
this.updateCallback.trendSetGraphChanged(ident, trendSetName, this); this.updateCallback.trendSetGraphChanged(ident, trendSetName, this);
// Update the canvas with the new data // Update the canvas with the new data
canvasMap.get(attr).updateAttribute(attr, tgd, canvasMap.get(attr).updateAttribute(attr, tgd,
requestDataCallback.getCurrentDate()); requestDataCallback.getCurrentDate());
} }
if (requestDataCallback.cellValid(this.ident) == false) { if (requestDataCallback.cellValid(this.ident) == false) {
return true; return true;
} }
return false; return false;
} }
/**
* Redraw the graphs with updated data.
*/
public void redrawTrendGraph() { public void redrawTrendGraph() {
for (String key : canvasMap.keySet()) { updateTrendSetsGraph();
if (canvasMap.get(key) != null) {
canvasMap.get(key).redrawCanvas();
}
}
} }
public void displayDialog() { public void displayDialog() {
@ -319,15 +343,4 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
protected void disposed() { protected void disposed() {
this.updateCallback.trendSetGraphClosing(this); this.updateCallback.trendSetGraphClosing(this);
} }
// @Override
// public void closeDialog() {
// this.updateCallback.trendSetGraphClosing(this);
// shell.dispose();
// }
//
// @Override
// public boolean isDisposed() {
// return shell.isDisposed();
// }
} }

View file

@ -20,6 +20,7 @@
package com.raytheon.viz.core.gl.dataformat; package com.raytheon.viz.core.gl.dataformat;
import com.raytheon.uf.common.colormap.image.ColorMapData; import com.raytheon.uf.common.colormap.image.ColorMapData;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
/** /**
* Factory class for getting GLColorMapDataFormat objects given the ColorMapData * Factory class for getting GLColorMapDataFormat objects given the ColorMapData
@ -32,6 +33,8 @@ import com.raytheon.uf.common.colormap.image.ColorMapData;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 21, 2011 mschenke Initial creation * Nov 21, 2011 mschenke Initial creation
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
* format for offscreen textures.
* *
* </pre> * </pre>
* *
@ -43,8 +46,13 @@ public class GLColorMapDataFormatFactory {
public static AbstractGLColorMapDataFormat getGLColorMapDataFormat( public static AbstractGLColorMapDataFormat getGLColorMapDataFormat(
ColorMapData colorMapData) { ColorMapData colorMapData) {
return getGLColorMapDataFormat(colorMapData.getDataType());
}
public static AbstractGLColorMapDataFormat getGLColorMapDataFormat(
ColorMapDataType colorMapDataType) {
AbstractGLColorMapDataFormat dataFormat = null; AbstractGLColorMapDataFormat dataFormat = null;
switch (colorMapData.getDataType()) { switch (colorMapDataType) {
case BYTE: { case BYTE: {
dataFormat = new GLByteDataFormat(); dataFormat = new GLByteDataFormat();
break; break;

View file

@ -33,6 +33,7 @@ import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IView; import com.raytheon.uf.viz.core.IView;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.viz.core.data.IRenderedImageCallback; import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension; import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
@ -41,6 +42,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.core.gl.IGLTarget; import com.raytheon.viz.core.gl.IGLTarget;
import com.raytheon.viz.core.gl.dataformat.AbstractGLColorMapDataFormat; import com.raytheon.viz.core.gl.dataformat.AbstractGLColorMapDataFormat;
import com.raytheon.viz.core.gl.dataformat.GLByteDataFormat; import com.raytheon.viz.core.gl.dataformat.GLByteDataFormat;
import com.raytheon.viz.core.gl.dataformat.GLColorMapDataFormatFactory;
import com.raytheon.viz.core.gl.dataformat.IGLColorMapDataFormatProvider; import com.raytheon.viz.core.gl.dataformat.IGLColorMapDataFormatProvider;
import com.raytheon.viz.core.gl.images.AbstractGLImage; import com.raytheon.viz.core.gl.images.AbstractGLImage;
import com.raytheon.viz.core.gl.images.GLColormappedImage; import com.raytheon.viz.core.gl.images.GLColormappedImage;
@ -61,6 +63,8 @@ import com.raytheon.viz.core.gl.internal.ext.GLColormappedImageExtension;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jul 10, 2012 bsteffen Initial creation * Jul 10, 2012 bsteffen Initial creation
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
* format for offscreen textures.
* *
* </pre> * </pre>
* *
@ -175,51 +179,37 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension<IGLTarget>
} }
public GLColormappedImage constructOffscreenImage( public GLColormappedImage constructOffscreenImage(
Class<? extends Buffer> dataType, int[] dimensions) ColorMapDataType dataType, int[] dimensions) throws VizException {
throws VizException {
return constructOffscreenImage(dataType, dimensions, null); return constructOffscreenImage(dataType, dimensions, null);
} }
public GLColormappedImage constructOffscreenImage( public GLColormappedImage constructOffscreenImage(
Class<? extends Buffer> dataType, final int[] dimensions, final ColorMapDataType dataType, final int[] dimensions,
ColorMapParameters parameters) throws VizException { ColorMapParameters parameters) throws VizException {
int width = dimensions[0]; GLColormappedImageExtension cmapExt = target
int height = dimensions[1]; .getExtension(GLColormappedImageExtension.class);
// Need to add support for multiple buffer types if (!supportsLuminance) {
Buffer imageBuffer = null; return cmapExt.initializeRaster(new NoLuminanceDataCallback(
if (dataType.isAssignableFrom(ByteBuffer.class)) { dimensions, dataType), parameters);
int pixels = 3; } else {
if (supportsLuminance) { GLColormappedImage image = cmapExt.initializeRaster(
pixels = 1; new IColorMapDataRetrievalCallback() {
}
byte[] buf = new byte[width * height * pixels];
imageBuffer = ByteBuffer.wrap(buf);
}
if (imageBuffer != null) { @Override
GLColormappedImage image = null; public ColorMapData getColorMapData()
final Buffer buffer = imageBuffer; throws VizException {
GLColormappedImageExtension cmapExt = target return new ColorMapData(dataType, dimensions);
.getExtension(GLColormappedImageExtension.class); }
if (supportsLuminance) { }, parameters);
image = cmapExt.initializeRaster(
new IColorMapDataRetrievalCallback() {
@Override
public ColorMapData getColorMapData()
throws VizException {
return new ColorMapData(buffer, dimensions);
}
}, parameters);
} else {
image = cmapExt.initializeRaster(new GLOffscreenDataCallback(
buffer, dimensions), parameters);
}
if (!checkedLuminance) { if (!checkedLuminance) {
checkedLuminance = true; checkedLuminance = true;
try { try {
renderOffscreen(image); renderOffscreen(image);
} catch (VizException e) { } catch (VizException e) {
// Log this so it is easy to see in the console logs.
new VizException(
"Graphics card does not support luminance textures.",
e).printStackTrace(System.out);
// assume we don't support luminance // assume we don't support luminance
supportsLuminance = false; supportsLuminance = false;
// Reconstruct image // Reconstruct image
@ -230,84 +220,76 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension<IGLTarget>
} }
} }
return image; return image;
} else {
return null;
} }
} }
private static final class GLOffscreenDataCallback implements private static final class NoLuminanceDataFormat extends GLByteDataFormat {
IColorMapDataRetrievalCallback, IGLColorMapDataFormatProvider {
private Buffer dataBuffer; // Used to get the original min/max which makes signed bytes work and
// theoretically will give better looking results for other integer data
// types.
private final ColorMapDataType originalType;
private NoLuminanceDataFormat(ColorMapDataType originalType) {
this.originalType = originalType;
}
@Override
public int getTextureInternalFormat() {
return GL.GL_RGB8;
}
@Override
public int getTextureFormat() {
return GL.GL_RGB;
}
@Override
public int getValuesPerPixel() {
return 3;
}
@Override
public double getDataFormatMin() {
return getOriginalGLColorMapDataFormat().getDataFormatMin();
}
@Override
public double getDataFormatMax() {
return getOriginalGLColorMapDataFormat().getDataFormatMax();
}
private AbstractGLColorMapDataFormat getOriginalGLColorMapDataFormat() {
return GLColorMapDataFormatFactory
.getGLColorMapDataFormat(originalType);
}
}
private static final class NoLuminanceDataCallback implements
IColorMapDataRetrievalCallback, IGLColorMapDataFormatProvider {
private int[] dimensions; private int[] dimensions;
private GLOffscreenDataCallback(Buffer dataBuffer, int[] dimensions) { private final ColorMapDataType originalType;
this.dataBuffer = dataBuffer;
private NoLuminanceDataCallback(int[] dimensions,
ColorMapDataType type) {
this.dimensions = dimensions; this.dimensions = dimensions;
this.originalType = type;
} }
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.core.gl.dataprep.IGLColorMapDataRetrievalCallback
* #getGLColorMapData
* (com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback
* .ColorMapData)
*/
@Override @Override
public AbstractGLColorMapDataFormat getGLColorMapDataFormat( public AbstractGLColorMapDataFormat getGLColorMapDataFormat(
ColorMapData colorMapData) { ColorMapData colorMapData) {
return new GLByteDataFormat() { return new NoLuminanceDataFormat(originalType);
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.core.gl.dataprep.GLByteDataFormat#
* getTextureInternalFormat()
*/
@Override
public int getTextureInternalFormat() {
return GL.GL_RGB8;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.core.gl.dataprep.AbstractGLColorMapDataFormat
* #getTextureFormat()
*/
@Override
public int getTextureFormat() {
return GL.GL_RGB;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.core.gl.dataprep.AbstractGLColorMapDataFormat
* #getPointsPerPixel()
*/
@Override
public int getValuesPerPixel() {
return 3;
}
};
} }
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback#
* getColorMapData()
*/
@Override @Override
public ColorMapData getColorMapData() throws VizException { public ColorMapData getColorMapData() throws VizException {
return new ColorMapData(dataBuffer, dimensions); Buffer buffer = ByteBuffer.allocate(dimensions[0] * dimensions[1]
* 3);
return new ColorMapData(buffer, dimensions, originalType);
} }
} }

View file

@ -28,6 +28,7 @@ import javax.media.opengl.glu.GLU;
import com.raytheon.uf.common.colormap.image.ColorMapData; import com.raytheon.uf.common.colormap.image.ColorMapData;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.core.gl.GLContextBridge; import com.raytheon.viz.core.gl.GLContextBridge;
import com.raytheon.viz.core.gl.dataformat.GLColorMapData; import com.raytheon.viz.core.gl.dataformat.GLColorMapData;
@ -49,6 +50,8 @@ import com.raytheon.viz.core.gl.objects.GLTextureObject;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 2, 2011 bsteffen Initial creation * Aug 2, 2011 bsteffen Initial creation
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
* format for offscreen textures.
* *
* </pre> * </pre>
* *
@ -271,4 +274,8 @@ public class GLCMTextureData implements IImageCacheable {
return 0; return 0;
} }
public ColorMapDataType getColorMapDataType() {
return data.getDataType();
}
} }

View file

@ -23,6 +23,7 @@ import javax.media.opengl.GL;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback; import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.viz.core.drawables.IColormappedImage; import com.raytheon.uf.viz.core.drawables.IColormappedImage;
import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension; import com.raytheon.uf.viz.core.drawables.ext.IImagingExtension;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
@ -39,6 +40,8 @@ import com.sun.opengl.util.texture.TextureCoords;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jul 27, 2009 mschenke Initial creation * Jul 27, 2009 mschenke Initial creation
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
* format for offscreen textures.
* *
* </pre> * </pre>
* *
@ -109,6 +112,10 @@ public class GLColormappedImage extends AbstractGLImage implements
return data.getTextureType(); return data.getTextureType();
} }
public ColorMapDataType getColorMapDataType() {
return data.getColorMapDataType();
}
/** /**
* Return the texture's format * Return the texture's format
* *

View file

@ -38,6 +38,8 @@ import com.raytheon.viz.core.gl.images.GLDelegateImage;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Dec 16, 2011 mschenke Initial creation * Dec 16, 2011 mschenke Initial creation
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
* format for offscreen textures.
* *
* </pre> * </pre>
* *
@ -165,4 +167,9 @@ public class GLMosaicImage extends GLDelegateImage<GLColormappedImage>
return image.getValue(x, y); return image.getValue(x, y);
} }
public void setWrappedImage(GLColormappedImage wrappedImage) {
this.image.dispose();
this.image = wrappedImage;
}
} }

View file

@ -19,15 +19,15 @@
**/ **/
package com.raytheon.viz.core.gl.internal.ext.mosaic; package com.raytheon.viz.core.gl.internal.ext.mosaic;
import java.nio.ByteBuffer;
import javax.media.opengl.GL; import javax.media.opengl.GL;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.viz.core.DrawableImage; import com.raytheon.uf.viz.core.DrawableImage;
import com.raytheon.uf.viz.core.IExtent; import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.PixelCoverage; import com.raytheon.uf.viz.core.PixelCoverage;
import com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback.ColorMapDataType;
import com.raytheon.uf.viz.core.drawables.IImage; import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.IImage.Status;
import com.raytheon.uf.viz.core.drawables.ImagingSupport; import com.raytheon.uf.viz.core.drawables.ImagingSupport;
import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension; import com.raytheon.uf.viz.core.drawables.ext.IMosaicImageExtension;
@ -36,6 +36,7 @@ import com.raytheon.viz.core.gl.ext.GLOffscreenRenderingExtension;
import com.raytheon.viz.core.gl.glsl.AbstractGLSLImagingExtension; import com.raytheon.viz.core.gl.glsl.AbstractGLSLImagingExtension;
import com.raytheon.viz.core.gl.glsl.GLShaderProgram; import com.raytheon.viz.core.gl.glsl.GLShaderProgram;
import com.raytheon.viz.core.gl.images.AbstractGLImage; import com.raytheon.viz.core.gl.images.AbstractGLImage;
import com.raytheon.viz.core.gl.images.GLColormappedImage;
/** /**
* Extension used for rendering radar mosaic images * Extension used for rendering radar mosaic images
@ -47,6 +48,8 @@ import com.raytheon.viz.core.gl.images.AbstractGLImage;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Dec 16, 2011 mschenke Initial creation * Dec 16, 2011 mschenke Initial creation
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
* format for offscreen textures.
* *
* </pre> * </pre>
* *
@ -57,13 +60,14 @@ import com.raytheon.viz.core.gl.images.AbstractGLImage;
public class GLMosaicImageExtension extends AbstractGLSLImagingExtension public class GLMosaicImageExtension extends AbstractGLSLImagingExtension
implements IMosaicImageExtension { implements IMosaicImageExtension {
private AbstractGLImage writeToImage; private GLColormappedImage writeToImage;
public GLMosaicImage initializeRaster(int[] imageBounds, public GLMosaicImage initializeRaster(int[] imageBounds,
IExtent imageExtent, ColorMapParameters params) throws VizException { IExtent imageExtent, ColorMapParameters params) throws VizException {
// Since byte is the most common type of mosaic start with a byte image. It might switch later if needed.
return new GLMosaicImage(target.getExtension( return new GLMosaicImage(target.getExtension(
GLOffscreenRenderingExtension.class).constructOffscreenImage( GLOffscreenRenderingExtension.class).constructOffscreenImage(
ByteBuffer.class, imageBounds, params), imageBounds, ColorMapDataType.BYTE, imageBounds, params), imageBounds,
imageExtent, this.getClass()); imageExtent, this.getClass());
} }
@ -93,7 +97,7 @@ public class GLMosaicImageExtension extends AbstractGLSLImagingExtension
if (image instanceof GLMosaicImage) { if (image instanceof GLMosaicImage) {
GLMosaicImage mosaicImage = (GLMosaicImage) image; GLMosaicImage mosaicImage = (GLMosaicImage) image;
if (mosaicImage.isRepaint()) { if (mosaicImage.isRepaint()) {
writeToImage = mosaicImage.getWrappedImage(); writeToImage = getWriteToImage(mosaicImage);
GLOffscreenRenderingExtension extension = target GLOffscreenRenderingExtension extension = target
.getExtension(GLOffscreenRenderingExtension.class); .getExtension(GLOffscreenRenderingExtension.class);
try { try {
@ -134,6 +138,38 @@ public class GLMosaicImageExtension extends AbstractGLSLImagingExtension
} }
} }
private GLColormappedImage getWriteToImage(GLMosaicImage mosaicImage)
throws VizException {
ColorMapDataType neededType = null;
for (DrawableImage di : mosaicImage.getImagesToMosaic()) {
IImage image = di.getImage();
if (image.getStatus() != Status.LOADED) {
continue;
}
if (image instanceof GLColormappedImage) {
GLColormappedImage colorMapImage = (GLColormappedImage) image;
ColorMapDataType type = colorMapImage.getColorMapDataType();
if (neededType == null) {
neededType = type;
} else if (neededType != type) {
// Mosaicing images of different types?
// No Idea how to handle this
return mosaicImage.getWrappedImage();
}
}
}
GLColormappedImage writeTo = mosaicImage.getWrappedImage();
if (neededType != null && neededType != writeTo.getColorMapDataType()) {
GLOffscreenRenderingExtension offscreenExt = target
.getExtension(GLOffscreenRenderingExtension.class);
int[] dimensions = { writeTo.getWidth(), writeTo.getHeight() };
writeTo = offscreenExt.constructOffscreenImage(neededType,
dimensions, writeTo.getColorMapParameters());
mosaicImage.setWrappedImage(writeTo);
}
return writeTo;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *

View file

@ -19,9 +19,6 @@
**/ **/
package com.raytheon.viz.gfe; package com.raytheon.viz.gfe;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.viz.gfe.dialogs.sbu.ServiceBackupDlg; import com.raytheon.viz.gfe.dialogs.sbu.ServiceBackupDlg;
import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent; import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
@ -36,6 +33,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 12, 2011 bphillip Initial creation * Aug 12, 2011 bphillip Initial creation
* Oct 26, 2012 1287 rferrel Change to force blocking of ServiceBackupDlg. * Oct 26, 2012 1287 rferrel Change to force blocking of ServiceBackupDlg.
* Mar 21, 2013 1447 dgilling Fix dialog construction so this dialog
* is created as a top-level shell.
* *
* </pre> * </pre>
* *
@ -54,8 +53,7 @@ public class ServiceBackupComponent extends AbstractCAVEComponent {
*/ */
@Override @Override
protected void startInternal(String componentName) throws Exception { protected void startInternal(String componentName) throws Exception {
ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(new Shell( ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(null);
Display.getCurrent()));
svcBuDlg.setBlockOnOpen(true); svcBuDlg.setBlockOnOpen(true);
svcBuDlg.open(); svcBuDlg.open();
} }

View file

@ -65,6 +65,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 28May2010 2187 cjeanbap Added StdTextProductFactory * 28May2010 2187 cjeanbap Added StdTextProductFactory
* functionality. * functionality.
* 09 NOV 2012 1298 rferrel Changes for non-blocking dialog. * 09 NOV 2012 1298 rferrel Changes for non-blocking dialog.
* 08Mar2013 15564 mgamazaychikov Set the awipsWanPil based on productText data
* </pre> * </pre>
* *
* @author lvenable * @author lvenable
@ -387,7 +388,15 @@ public class StoreTransmitDlg extends CaveSWTDialog implements
} else { } else {
req = new OUPRequest(); req = new OUPRequest();
OfficialUserProduct oup = new OfficialUserProduct(); OfficialUserProduct oup = new OfficialUserProduct();
String awipsWanPil = productIdTF.getText(); /*
* DR15564 - set the awipsWanPil based on productText data
*/
String[] splitLines = productText.split("\n");
String[] firstLine = splitLines[0].split(" ");
String[] secondLine = splitLines[1].split(" ");
String cccc = firstLine[1];
String productNnnidXxxid = secondLine[0];
String awipsWanPil = cccc + productNnnidXxxid;
oup.setAwipsWanPil(awipsWanPil); oup.setAwipsWanPil(awipsWanPil);
oup.setProductText(productText); oup.setProductText(productText);

View file

@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog; import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
/** /**
* TODO Add Description * Asks the user if they want to import digital data and/or start GFE.
* *
* <pre> * <pre>
* *
@ -39,7 +39,9 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 4, 2011 randerso Initial creation * Aug 04, 2011 randerso Initial creation
* Mar 20, 2013 1447 dgilling Implement changes from A1 DR 21404,
* make default selections match A1.
* *
* </pre> * </pre>
* *
@ -54,9 +56,11 @@ public class QueryOptionsDlg extends CaveJFACEDialog {
private boolean importGrids; private boolean importGrids;
private boolean startGfe; private boolean startGfe;
private boolean trMode;
private Button importGridsBtn; private Button importGridsBtn;
private Button startGfeBtn; private Button startGfeBtn;
/** /**
@ -96,23 +100,37 @@ public class QueryOptionsDlg extends CaveJFACEDialog {
if (doImCon) { if (doImCon) {
importGridsBtn = new Button(top, SWT.CHECK); importGridsBtn = new Button(top, SWT.CHECK);
importGridsBtn.setText("Import Digital Forecast"); importGridsBtn.setText("Import Digital Forecast");
importGridsBtn.setSelection(true);
importGridsBtn.addSelectionListener(new SelectionAdapter() { importGridsBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
importGrids = importGridsBtn.getSelection(); importGrids = importGridsBtn.getSelection();
} }
}); });
importGridsBtn.getSelection(); importGrids = importGridsBtn.getSelection();
final Button trModeBtn = new Button(top, SWT.CHECK);
trModeBtn.setText("Troubleshooting Mode (no ISC/VTEC AT sharing)");
trModeBtn.setSelection(false);
trModeBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
trMode = trModeBtn.getSelection();
}
});
trMode = trModeBtn.getSelection();
} }
startGfeBtn = new Button(top, SWT.CHECK); startGfeBtn = new Button(top, SWT.CHECK);
startGfeBtn.setText("Start GFE"); startGfeBtn.setText("Start GFE");
startGfeBtn.setSelection(true);
startGfeBtn.addSelectionListener(new SelectionAdapter() { startGfeBtn.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
startGfe = startGfeBtn.getSelection(); startGfe = startGfeBtn.getSelection();
} }
}); });
startGfe = startGfeBtn.getSelection();
return top; return top;
} }
@ -124,4 +142,8 @@ public class QueryOptionsDlg extends CaveJFACEDialog {
public boolean startGFE() { public boolean startGFE() {
return this.startGfe; return this.startGfe;
} }
public boolean trMode() {
return this.trMode;
}
} }

View file

@ -19,7 +19,6 @@
**/ **/
package com.raytheon.viz.gfe.dialogs.sbu; package com.raytheon.viz.gfe.dialogs.sbu;
import java.io.IOException;
import java.util.List; import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
@ -39,6 +38,7 @@ import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.program.Program;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
@ -57,7 +57,6 @@ import com.raytheon.uf.common.site.requests.GetActiveSitesRequest;
import com.raytheon.uf.common.status.IUFStatusHandler; 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.util.RunProcess;
import com.raytheon.uf.viz.core.RGBColors; import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.auth.UserController; import com.raytheon.uf.viz.core.auth.UserController;
@ -87,10 +86,12 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 4, 2011 randerso Initial creation * Aug 04, 2011 randerso Initial creation
* Sep 19,2011 10955 rferrel Use RunProcess * Sep 19, 2011 10955 rferrel Use RunProcess
* Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog. * Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog.
* Nov 15,2012 15614 jdynina Added check for national center * Nov 15, 2012 15614 jdynina Added check for national center
* Mar 20, 2013 1447 dgilling Port troubleshooting mode changes
* from A1 DR 21404, some code cleanup.
* *
* </pre> * </pre>
* *
@ -156,7 +157,7 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
private Job updateJob; private Job updateJob;
private boolean authorized; private boolean authorized;
private boolean nationalCenter; private boolean nationalCenter;
private SVCBU_OP currentOperation = SVCBU_OP.no_backup; private SVCBU_OP currentOperation = SVCBU_OP.no_backup;
@ -342,15 +343,11 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
helpItem.addSelectionListener(new SelectionAdapter() { helpItem.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
try { final String url = "http://"
// DR#10955 + getServiceBackupServer()
RunProcess + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_help.html";
.getRunProcess() if (!Program.launch(url)) {
.exec("/usr/bin/firefox http://" statusHandler.error("Unable to open Help page: " + url);
+ getServiceBackupServer()
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_help.html");
} catch (IOException e1) {
statusHandler.error("Unable to open Help page!", e1);
} }
} }
}); });
@ -360,15 +357,12 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
instructionsItem.addSelectionListener(new SelectionAdapter() { instructionsItem.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
try { final String url = "http://"
// DR#10955 + getServiceBackupServer()
RunProcess + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_instructions.html";
.getRunProcess() if (!Program.launch(url)) {
.exec("/usr/bin/firefox http://" statusHandler.error("Unable to open Instructions page: "
+ getServiceBackupServer() + url);
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_instructions.html");
} catch (IOException e1) {
statusHandler.error("Unable to open Help page!", e1);
} }
} }
}); });
@ -378,15 +372,11 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
faqItem.addSelectionListener(new SelectionAdapter() { faqItem.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
try { final String url = "http://"
// DR#10955 + getServiceBackupServer()
RunProcess + ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_faq.html";
.getRunProcess() if (!Program.launch(url)) {
.exec("/usr/bin/firefox http://" statusHandler.error("Unable to open FAQ page: " + url);
+ getServiceBackupServer()
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_faq.html");
} catch (IOException e1) {
statusHandler.error("Unable to open Help page!", e1);
} }
} }
}); });
@ -493,7 +483,7 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
jobManager.addJob(new SvcbuDeactivateSiteJob(failedSite, jobManager.addJob(new SvcbuDeactivateSiteJob(failedSite,
this.site)); this.site));
jobManager.addJob(new SvcbuImportConfJob(site, failedSite, jobManager.addJob(new SvcbuImportConfJob(site, failedSite,
progress)); false, progress));
jobManager.addJob(new SvcbuActivateSiteJob(failedSite, jobManager.addJob(new SvcbuActivateSiteJob(failedSite,
this.site)); this.site));
jobManager.addJob(new SvcbuStartGfeJob(failedSite, this.site)); jobManager.addJob(new SvcbuStartGfeJob(failedSite, this.site));
@ -544,11 +534,12 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
if (dlg.open() == Window.OK) { if (dlg.open() == Window.OK) {
boolean importGrids = dlg.importGrids(); boolean importGrids = dlg.importGrids();
boolean startGFE = dlg.startGFE(); boolean startGFE = dlg.startGFE();
boolean trMode = dlg.trMode();
String failedSite = getFailedSite(); String failedSite = getFailedSite();
jobManager.addJob(new SvcbuDeactivateSiteJob(failedSite, jobManager.addJob(new SvcbuDeactivateSiteJob(failedSite,
this.site)); this.site));
jobManager.addJob(new SvcbuImportConfJob(site, failedSite, jobManager.addJob(new SvcbuImportConfJob(site, failedSite,
progress)); trMode, progress));
jobManager.addJob(new SvcbuActivateSiteJob(failedSite, jobManager.addJob(new SvcbuActivateSiteJob(failedSite,
this.site)); this.site));
if (importGrids) { if (importGrids) {
@ -1191,8 +1182,8 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
doExGrids.setEnabled(true); doExGrids.setEnabled(true);
doExGrids.setText("Export " + this.site doExGrids.setText("Export " + this.site
+ "'s Digital Forecast to the Central Server"); + "'s Digital Forecast to the Central Server");
updateBanner("YOU ARE NOT IN BACKUP MODE", getShell().getParent() updateBanner("YOU ARE NOT IN BACKUP MODE", getShell().getFont(),
.getFont(), black, gray); black, gray);
currentOperation = SVCBU_OP.no_backup; currentOperation = SVCBU_OP.no_backup;
} }

View file

@ -49,7 +49,9 @@ import com.raytheon.viz.gfe.dialogs.sbu.ServiceBackupDlg;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 5, 2011 bphillip Initial creation * Aug 05, 2011 bphillip Initial creation
* Mar 20, 2013 1447 dgilling Add support for service backup
* troubleshooting mode from A1.
* *
* </pre> * </pre>
* *
@ -62,6 +64,8 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements
private String failedSite; private String failedSite;
private boolean trMode;
private ProgressDlg progress; private ProgressDlg progress;
private boolean complete; private boolean complete;
@ -70,21 +74,19 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements
private String errorMsg; private String errorMsg;
/**
* @param name
*/
public SvcbuImportConfJob(String primarySite, String failedSite, public SvcbuImportConfJob(String primarySite, String failedSite,
ProgressDlg progress) { boolean trMode, ProgressDlg progress) {
super("Import Configuration: " + failedSite, primarySite); super("Import Configuration: " + failedSite, primarySite);
this.failedSite = failedSite; this.failedSite = failedSite;
this.progress = progress; this.progress = progress;
this.trMode = trMode;
NotificationManagerJob.addObserver(ServiceBackupDlg.NOTIFY_TOPIC, this); NotificationManagerJob.addObserver(ServiceBackupDlg.NOTIFY_TOPIC, this);
} }
@Override @Override
public void run() { public void run() {
ImportConfRequest request = new ImportConfRequest(primarySite, ImportConfRequest request = new ImportConfRequest(primarySite,
failedSite); failedSite, trMode);
try { try {
VizApp.runAsync(new Runnable() { VizApp.runAsync(new Runnable() {
@ -158,7 +160,7 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements
+ failedSite, e); + failedSite, e);
} catch (Exception e) { } catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"SERVICE BACKUP: "+e.getLocalizedMessage()); "SERVICE BACKUP: " + e.getLocalizedMessage());
} finally { } finally {
NotificationManagerJob.removeObserver( NotificationManagerJob.removeObserver(
ServiceBackupDlg.NOTIFY_TOPIC, this); ServiceBackupDlg.NOTIFY_TOPIC, this);

View file

@ -52,6 +52,7 @@ import com.raytheon.viz.gfe.core.DataManager;
* Nov 5, 2008 njensen Initial creation * Nov 5, 2008 njensen Initial creation
* Jan 8, 2013 1486 dgilling Support changes to BaseGfePyController. * Jan 8, 2013 1486 dgilling Support changes to BaseGfePyController.
* 02/12/2013 #1597 randerso Added logging to support GFE Performance metrics * 02/12/2013 #1597 randerso Added logging to support GFE Performance metrics
* Mar 7, 2013 15717 jzeng Change CAVE_STATIC to COMMON_STATIC
* *
* </pre> * </pre>
* *
@ -76,7 +77,7 @@ public class ProcedureController extends BaseGfePyController {
super(filePath, anIncludePath, classLoader, dataManager, "Procedure"); super(filePath, anIncludePath, classLoader, dataManager, "Procedure");
LocalizationContext baseCtx = PathManagerFactory.getPathManager() LocalizationContext baseCtx = PathManagerFactory.getPathManager()
.getContext(LocalizationType.CAVE_STATIC, .getContext(LocalizationType.COMMON_STATIC,
LocalizationLevel.BASE); LocalizationLevel.BASE);
proceduresDir = GfePyIncludeUtil.getProceduresLF(baseCtx); proceduresDir = GfePyIncludeUtil.getProceduresLF(baseCtx);

View file

@ -392,7 +392,6 @@ public class MPEDisplayManager {
} }
return null; return null;
} }
private final Set<IEditTimeChangedListener> timeChangedListeners = new LinkedHashSet<IEditTimeChangedListener>(); private final Set<IEditTimeChangedListener> timeChangedListeners = new LinkedHashSet<IEditTimeChangedListener>();
private final Set<IDisplayFieldChangedListener> fieldChangedListeners = new LinkedHashSet<IDisplayFieldChangedListener>(); private final Set<IDisplayFieldChangedListener> fieldChangedListeners = new LinkedHashSet<IDisplayFieldChangedListener>();
@ -707,7 +706,6 @@ public class MPEDisplayManager {
// Remove old resource // Remove old resource
list.removeRsc(displayedFieldResource); list.removeRsc(displayedFieldResource);
} }
fieldResourceData.setFieldData(fieldToDisplay); fieldResourceData.setFieldData(fieldToDisplay);
fieldResourceData.setArealDisplay(arealDisplay); fieldResourceData.setArealDisplay(arealDisplay);
fieldResourceData.setAccumulationInterval(accumulationHrs); fieldResourceData.setAccumulationInterval(accumulationHrs);
@ -725,7 +723,6 @@ public class MPEDisplayManager {
listener.displayFieldChanged(oldField, fieldToDisplay); listener.displayFieldChanged(oldField, fieldToDisplay);
} }
} }
// reset gages // reset gages
List<MPEGageResource> rscs = display.getDescriptor() List<MPEGageResource> rscs = display.getDescriptor()
.getResourceList() .getResourceList()

View file

@ -109,6 +109,8 @@ public class MPEGageResource extends AbstractMPEInputResource implements
private static final double POINT_RADIUS = 2; private static final double POINT_RADIUS = 2;
private static final RGB WHITE = new RGB(255, 255, 255);
private final SimpleDateFormat sdf; private final SimpleDateFormat sdf;
private final Object mutex = new Object(); private final Object mutex = new Object();
@ -361,7 +363,10 @@ public class MPEGageResource extends AbstractMPEInputResource implements
for (Coordinate point : dataMap.keySet()) { for (Coordinate point : dataMap.keySet()) {
if (extent.contains(new double[] { point.x, point.y })) { if (extent.contains(new double[] { point.x, point.y })) {
MPEGageData gageData = dataMap.get(point); MPEGageData gageData = dataMap.get(point);
RGB gageColor = getGageColor(gageData); RGB gageColor = WHITE;
if (displayIsEdit) {
gageColor = getGageColor(gageData);
}
boolean isReportedMissing = gageData.isReported_missing(); boolean isReportedMissing = gageData.isReported_missing();
boolean isMissing = ((gageData.getGval() == -999.f || gageData boolean isMissing = ((gageData.getGval() == -999.f || gageData

View file

@ -297,6 +297,7 @@ public class RegenHrFlds {
e.printStackTrace(); e.printStackTrace();
} }
/* Clear gage edits */
MPEDataManager.getInstance().clearEditGages(); MPEDataManager.getInstance().clearEditGages();
shell.setCursor(null); shell.setCursor(null);
} }

View file

@ -39,6 +39,8 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Sep 25, 2012 #15425 Qinglu Lin Updated createClosestPoint(). * Sep 25, 2012 #15425 Qinglu Lin Updated createClosestPoint().
* Feb 13, 2012 1605 jsanchez Calculated the point based on lat,lon values. * Feb 13, 2012 1605 jsanchez Calculated the point based on lat,lon values.
* Mar 25, 2013 1810 jsanchez Allowed other values to be accepted as a true value for useDirs.
* Mar 25, 2013 1605 jsanchez Set ClosestPoint's prepGeom.
* *
* </pre> * </pre>
* *
@ -115,9 +117,10 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
List<String> partOfArea = getPartOfArea(ptFields, attributes, List<String> partOfArea = getPartOfArea(ptFields, attributes,
ptRslt.geometry); ptRslt.geometry);
int gid = getGid(ptFields, attributes); int gid = getGid(ptFields, attributes);
ClosestPoint cp = new ClosestPoint(name, point, population, warngenlev,
return new ClosestPoint(name, point, population, warngenlev,
partOfArea, gid); partOfArea, gid);
cp.setPrepGeom(PreparedGeometryFactory.prepare(ptRslt.geometry));
return cp;
} }
/** /**
@ -156,8 +159,10 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
Map<String, Object> attributes, Geometry geom) { Map<String, Object> attributes, Geometry geom) {
List<String> partOfArea = null; List<String> partOfArea = null;
boolean userDirections = Boolean.valueOf(String.valueOf(attributes String userDir = String.valueOf(attributes.get(useDirectionField))
.get(useDirectionField))); .toLowerCase();
boolean userDirections = Boolean.valueOf(userDir)
|| userDir.equals("t") || userDir.equals("1");
if (userDirections) { if (userDirections) {
PreparedGeometry prepGeom = PreparedGeometryFactory.prepare(geom); PreparedGeometry prepGeom = PreparedGeometryFactory.prepare(geom);
if (prepGeom.intersects(searchArea) && !prepGeom.within(searchArea)) { if (prepGeom.intersects(searchArea) && !prepGeom.within(searchArea)) {

View file

@ -23,6 +23,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.prep.PreparedGeometry;
/** /**
* *
@ -40,6 +41,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Sep 25, 2012 #15425 Qinglu Lin Updated two ClosestPoint() and added getGid(). * Sep 25, 2012 #15425 Qinglu Lin Updated two ClosestPoint() and added getGid().
* Oct 17, 2012 jsanchez Added setter methods. * Oct 17, 2012 jsanchez Added setter methods.
* Feb 12, 2013 1600 jsanchez Removed adjustAngle method. * Feb 12, 2013 1600 jsanchez Removed adjustAngle method.
* Mar 25, 2013 1605 jsanchez Added prepGeom if an urban bound area.
* *
* </pre> * </pre>
* *
@ -77,6 +79,8 @@ public class ClosestPoint implements Comparable<ClosestPoint> {
protected int gid; protected int gid;
protected PreparedGeometry prepGeom;
public ClosestPoint() { public ClosestPoint() {
} }
@ -248,6 +252,10 @@ public class ClosestPoint implements Comparable<ClosestPoint> {
this.gid = gid; this.gid = gid;
} }
public void setPrepGeom(PreparedGeometry prepGeom) {
this.prepGeom = prepGeom;
}
/* /*
* (non-Javadoc) * (non-Javadoc)
* *

View file

@ -105,6 +105,7 @@ import com.vividsolutions.jts.geom.Point;
* Jan 31, 2013 1557 jsanchez Used allowDuplicates flag to collect points with duplicate names. * Jan 31, 2013 1557 jsanchez Used allowDuplicates flag to collect points with duplicate names.
* Feb 12, 2013 1600 jsanchez Used adjustAngle method from AbstractStormTrackResource. * Feb 12, 2013 1600 jsanchez Used adjustAngle method from AbstractStormTrackResource.
* Mar 5, 2013 1600 jsanchez Used AdjustAngle instead of AbstractStormTrackResource to handle angle adjusting. * Mar 5, 2013 1600 jsanchez Used AdjustAngle instead of AbstractStormTrackResource to handle angle adjusting.
* Mar 25, 2013 1605 jsanchez Checks if a storm location is over an urban bound area.
* *
* </pre> * </pre>
* *
@ -722,6 +723,11 @@ public class Wx {
latLonToLocal); latLonToLocal);
double distance = localDistanceGeom.distance(localPt); double distance = localDistanceGeom.distance(localPt);
// Tests if storm location is over an urban bound area
if (cp.prepGeom != null
&& cp.prepGeom.intersects(stormLocation)) {
distance = 0;
}
if (distance <= thresholdInMeters) { if (distance <= thresholdInMeters) {
if (allowDuplicates) { if (allowDuplicates) {
// collect all points that are within the threshold // collect all points that are within the threshold

View file

@ -53,7 +53,6 @@ import com.raytheon.viz.warngen.gis.AffectedAreas;
* moved the following methods from InitialLockingBehavior to this class: * moved the following methods from InitialLockingBehavior to this class:
* bulletIndices(), header(), firstBullet(), secondBullet(), getImmediateCausesPtrn(); * bulletIndices(), header(), firstBullet(), secondBullet(), getImmediateCausesPtrn();
* updated body(), header(), and secondBullet(); * updated body(), header(), and secondBullet();
* Mar 13, 2013 DR 15892 D. Friedman Fix bullet parsing.
* *
* </pre> * </pre>
* *
@ -142,13 +141,10 @@ abstract public class AbstractLockingBehavior implements ICommonPatterns {
private Integer[] bulletIndices() { private Integer[] bulletIndices() {
List<Integer> bulletIndices = new ArrayList<Integer>(); List<Integer> bulletIndices = new ArrayList<Integer>();
/* Assumes first line cannot be a bullet and that the '*' is int index = text.indexOf("* ");
* at the start of a line.
*/
int index = text.indexOf("\n* ");
while (index >= 0) { while (index >= 0) {
bulletIndices.add(index + 1); bulletIndices.add(index);
index = text.indexOf("\n* ", index + 3); index = text.indexOf("* ", index + 2);
} }
return bulletIndices.toArray(new Integer[bulletIndices.size()]); return bulletIndices.toArray(new Integer[bulletIndices.size()]);

View file

@ -39,8 +39,6 @@ import com.raytheon.viz.warngen.gis.AffectedAreas;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Sep 24, 2012 15322 jsanchez Initial creation * Sep 24, 2012 15322 jsanchez Initial creation
* Jan 8, 2013 15664 Qinglu Lin Updated body(). * Jan 8, 2013 15664 Qinglu Lin Updated body().
* Mar 13, 2013 15892 D. Friedman Fix headline locking. Do not
* lock "AND" or "FOR".
* *
* </pre> * </pre>
* *
@ -53,8 +51,10 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
*/ */
@Override @Override
public void body() { public void body() {
headlines(); if (action != WarningAction.COR)
super.body(); headlines();
else
super.body();
} }
/** /**
@ -66,7 +66,7 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
// should be blank. // should be blank.
Pattern headlinePtrn = Pattern Pattern headlinePtrn = Pattern
.compile( .compile(
"^\\.\\.\\.(AN?|THE) (.*) (WARNING|ADVISORY) .*(REMAINS|EXPIRE|CANCELLED).*(\\.\\.\\.)$", "^\\.\\.\\.(A|THE) (.*) (WARNING|ADVISORY) .*(REMAINS|EXPIRE|CANCELLED).*(\\.\\.\\.)$",
Pattern.MULTILINE); Pattern.MULTILINE);
Matcher m = headlinePtrn.matcher(text); Matcher m = headlinePtrn.matcher(text);
@ -187,8 +187,16 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
+ LOCK_START + "..." + LOCK_END; + LOCK_START + "..." + LOCK_END;
} }
// Locks warning type (i.e. SEVERE THUNDERSTORM) // Locks warning type (i.e. SEVERE THUNDERSTORM)
headline = headline.replaceAll("(AN?|THE)( [\\w\\s]*?)(" + warningType + ")", headline = headline.replaceAll("(A|THE) (" + warningType + ")",
LOCK_START + "$1" + LOCK_END + "$2" + LOCK_START + "$3" + LOCK_END); LOCK_START + "$0" + LOCK_END);
// Locks the 'FOR' in the headline
headline = headline.replaceFirst(" FOR ", " " + LOCK_START + "FOR"
+ LOCK_END + " ");
// Locks the 'AND' in the headline
headline = headline.replaceFirst(" AND ", " " + LOCK_START + "AND"
+ LOCK_END + " ");
return headline; return headline;
} }

View file

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

View file

@ -346,7 +346,7 @@ public class FipsUtil {
* @param fips * @param fips
* @return * @return
*/ */
public static ArrayList<String> getListCounties(String fips) { private static ArrayList<String> getListCounties(String fips) {
ArrayList<String> rval = new ArrayList<String>(); ArrayList<String> rval = new ArrayList<String>();
String matchStr = ""; String matchStr = "";

View file

@ -28,7 +28,6 @@ import com.raytheon.viz.warngen.text.ICommonPatterns;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jul 22, 2008 #1284 bwoodle Initial creation * Jul 22, 2008 #1284 bwoodle Initial creation
* Oct 18, 2012 15332 jsanchez Fixed refactor bugs. * Oct 18, 2012 15332 jsanchez Fixed refactor bugs.
* Mar 13, 2013 DR 15892 D. Friedman Handle SMW format in canceledAreasFromText
* *
* </pre> * </pre>
* *
@ -44,8 +43,6 @@ public class FollowUpUtil {
public static final Pattern vtecPtrn = Pattern public static final Pattern vtecPtrn = Pattern
.compile("/[OTEX]\\.([A-Z]{3})\\.[A-Za-z0-9]{4}\\.[A-Z]{2}\\.[WAYSFON]\\.\\d{4}\\.\\d{6}T\\d{4}Z-\\d{6}T\\d{4}Z/"); .compile("/[OTEX]\\.([A-Z]{3})\\.[A-Za-z0-9]{4}\\.[A-Z]{2}\\.[WAYSFON]\\.\\d{4}\\.\\d{6}T\\d{4}Z-\\d{6}T\\d{4}Z/");
private static final String SMW_CANCELED_AREAS_HEADER = "THE AFFECTED AREAS WERE...";
/** /**
* This method checks whether a particular followup should be available * This method checks whether a particular followup should be available
* given a Warning Record, a vtec Action, and a template configuration * given a Warning Record, a vtec Action, and a template configuration
@ -176,8 +173,7 @@ public class FollowUpUtil {
String headline = ""; String headline = "";
Pattern listOfAreaNamePtrn = Pattern Pattern listOfAreaNamePtrn = Pattern
.compile(ICommonPatterns.listOfAreaName); .compile(ICommonPatterns.listOfAreaName);
String[] splitLines = originalText.trim().split("\n"); for (String line : originalText.trim().split("\n")) {
for (String line : splitLines) {
if (line.contains("TEST") || line.trim().length() == 0) { if (line.contains("TEST") || line.trim().length() == 0) {
continue; continue;
} }
@ -202,15 +198,8 @@ public class FollowUpUtil {
headline += line; headline += line;
} }
} }
String[] ugcs = FipsUtil.getListCounties(ugcLine).toArray(new String[0]); String[] ugcs = ugcLine.split("-");
String[] names; String[] names = namesLine.split("-");
boolean smwAreas = false;
if (namesLine.length() > 0)
names = namesLine.split("-");
else {
names = parseSMWCanceledAreas(splitLines);
smwAreas = true;
}
String[] areas = headline.split("\\.\\.\\."); String[] areas = headline.split("\\.\\.\\.");
ArrayList<AffectedAreas> al = new ArrayList<AffectedAreas>(); ArrayList<AffectedAreas> al = new ArrayList<AffectedAreas>();
@ -233,21 +222,13 @@ public class FollowUpUtil {
areasNotation = "COUNTIES"; areasNotation = "COUNTIES";
} }
} }
if (ugc.length() < 3)
continue; // TODO: log?
fips = ugc.substring(ugc.length() - 3); fips = ugc.substring(ugc.length() - 3);
if (i < names.length) { if (i < names.length) {
if (!smwAreas && names[i].length() >= 3) { name = names[i].substring(0, names[i].length() - 3);
name = names[i].substring(0, names[i].length() - 3); stateAbbreviation = names[i].substring(names[i].length() - 2);
stateAbbreviation = names[i].substring(names[i].length() - 2); }
} else {
name = names[i];
}
} else
break;
if (name != null) { if (name != null) {
for (String area : areas) { for (String area : areas) {
@ -353,32 +334,4 @@ public class FollowUpUtil {
return rval; return rval;
} }
/** Parses the canceled areas of an SMW, which have a different format
* from other products.
*/
private static String[] parseSMWCanceledAreas(String[] splitLines) {
StringBuilder text = new StringBuilder(64);
boolean inAreas = false;
for (String line : splitLines) {
String trimmedLine = line.trim();
if (SMW_CANCELED_AREAS_HEADER.equals(trimmedLine))
inAreas = true;
else if (inAreas) {
if (trimmedLine.length() > 0) {
text.append(trimmedLine);
text.append('\n');
} else
break;
}
}
int len = text.length();
if (len >= 4 && "...\n".equals(text.substring(len - 4)))
text.delete(len - 4, len);
String[] areas = text.toString().split("\\.\\.\\.\\n");
// Unwrap lines.
for (int i = 0; i < areas.length; ++i)
areas[i] = areas[i].replace("\n", " ");
return areas;
}
} }

View file

@ -5,7 +5,6 @@
##### Qinglu Lin 08-13-2012 DR 14493. Use corToNewMarker and corEventtime. ##### Qinglu Lin 08-13-2012 DR 14493. Use corToNewMarker and corEventtime.
##### D. Friedman 11-09-2012 DR 15430. Rework included watches. ##### D. Friedman 11-09-2012 DR 15430. Rework included watches.
##### QINGLU LIN 12-27-2012 DR 15594. Added $lock to headlineLocList. ##### QINGLU LIN 12-27-2012 DR 15594. Added $lock to headlineLocList.
##### D. Friedman 03-13-2013 DR 15892. Do not lock portion of state in firstBullet.
#################################################################################################### ####################################################################################################
Mile Marker Test Code Mile Marker Test Code
macro "mmarkers" use (called out of VM_global_library.vm): macro "mmarkers" use (called out of VM_global_library.vm):
@ -751,7 +750,7 @@ THE ${area.name}##
#if(${intFIPS.parseInt($FIPS)} < 500 || ${area.stateabbr} == "TX") #if(${intFIPS.parseInt($FIPS)} < 500 || ${area.stateabbr} == "TX")
<L>${area.name} ${area.areaNotation}</L> IN #areaFormat(${area.partOfParentRegion} true false) <L>${area.parentRegion}...</L> <L>${area.name} ${area.areaNotation}</L> IN #areaFormat(${area.partOfParentRegion} true false) <L>${area.parentRegion}...</L>
#else #else
<L>${area.name}</L> IN #areaFormat(${area.partOfParentRegion} true false) <L>${area.parentRegion}...</L> <L>${area.name}</L> IN <L>#areaFormat(${area.partOfParentRegion} true false) ${area.parentRegion}...</L>
#end #end
#end #end
## COMMENTED OUT 5 LINES BELOW THIS IS GENERALLY NOT UTILIZED - you can unREMARK if desired ## COMMENTED OUT 5 LINES BELOW THIS IS GENERALLY NOT UTILIZED - you can unREMARK if desired

View file

@ -4,7 +4,6 @@
## Evan Bookbinder 4-25-2012 for OB 12.3.1 (corText) ## Evan Bookbinder 4-25-2012 for OB 12.3.1 (corText)
## QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ## QINGLU LIN 7-31-2012 DR 15217 use roundAndPad
## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list.
## D. Friedman 03-13-2013 DR 15892. Use printcoords.
################################################ ################################################
## ##
### CREATE PHRASING DEPENDING ON WHETHER WE ISSUE EXP PRIOR TO EXPIRATION TIME OR NOT ### CREATE PHRASING DEPENDING ON WHETHER WE ISSUE EXP PRIOR TO EXPIRATION TIME OR NOT
@ -483,7 +482,10 @@ THIS IS A TEST MESSAGE.##
THIS IS A TEST MESSAGE. DO NOT TAKE ACTION BASED ON THIS MESSAGE. THIS IS A TEST MESSAGE. DO NOT TAKE ACTION BASED ON THIS MESSAGE.
#end #end
#printcoords(${areaPoly}, ${list}) LAT...LON ##
#foreach(${coord} in ${areaPoly})
#llFormat(${coord.y}) #llFormat(${coord.x}) ##
#end
TIME...MOT...LOC ## TIME...MOT...LOC ##
${dateUtil.format(${event}, ${timeFormat.time})}Z ## ${dateUtil.format(${event}, ${timeFormat.time})}Z ##

View file

@ -8,7 +8,6 @@
## Evan Bookbinder 4-25-2012 for OB 12.3.1 (MND) ## Evan Bookbinder 4-25-2012 for OB 12.3.1 (MND)
## QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ## ## QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ##
## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list. ## Qinglu Lin 12-27-2012 DR 15594. Appended true to headlineLocList's parameter list.
## D. Friemdan 13-03-2013 DR 15892. Do not lock locations in headline.
###################################################### ######################################################
## ##
##SET SOME INITIAL VARIABLES ##SET SOME INITIAL VARIABLES
@ -121,7 +120,7 @@ THIS IS A TEST MESSAGE. ##
#end #end
#if(${windSpeed} >= 40 || ${hailSize} >= 0.70) #if(${windSpeed} >= 40 || ${hailSize} >= 0.70)
...SIGNIFICANT WEATHER ADVISORY FOR ## ...SIGNIFICANT WEATHER ADVISORY FOR ##
#headlineLocList(${areas} true false true false false) #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone}) #headlineLocList(${areas} true false true false true) #secondBullet(${dateUtil},${expire},${timeFormat},${localtimezone},${secondtimezone})
...## ...##
#elseif(${windSpeed} == 0 && ${hailSize} == 0) #elseif(${windSpeed} == 0 && ${hailSize} == 0)
!** YOU DID NOT SELECT ANY WIND OR HAIL THREATS. PLEASE RE-GENERATE THIS ADVISORY **! !** YOU DID NOT SELECT ANY WIND OR HAIL THREATS. PLEASE RE-GENERATE THIS ADVISORY **!

View file

@ -11,4 +11,5 @@ Require-Bundle: com.raytheon.edex.common,
Export-Package: com.raytheon.edex.services Export-Package: com.raytheon.edex.services
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.uf.edex.core, Import-Package: com.raytheon.uf.edex.core,
com.raytheon.uf.common.status,
com.raytheon.uf.edex.database.plugin com.raytheon.uf.edex.database.plugin

View file

@ -25,6 +25,10 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.core.EDEXUtil;
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;
@ -36,10 +40,11 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* fgriffit Initial Creation. * fgriffit Initial Creation.
* 20080408 1039 jkorman Added traceId for tracing data. * 20080408 1039 jkorman Added traceId for tracing data.
* Nov 11, 2008 chammack Refactored for Camel * Nov 11, 2008 chammack Refactored for Camel
* 02/06/09 1990 bphillip Refactored to use plugin daos * 02/06/09 1990 bphillip Refactored to use plugin daos
* Mar 19, 2013 1785 bgonzale Added performance status to indexOne and index.
* </pre> * </pre>
* *
* @author Frank Griffith * @author Frank Griffith
@ -53,6 +58,9 @@ public class IndexSrv {
private Log logger = LogFactory.getLog(getClass()); private Log logger = LogFactory.getLog(getClass());
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("DataBase:");
/** The default constructor */ /** The default constructor */
public IndexSrv() { public IndexSrv() {
} }
@ -73,9 +81,14 @@ public class IndexSrv {
*/ */
public PluginDataObject indexOne(PluginDataObject record) public PluginDataObject indexOne(PluginDataObject record)
throws PluginException { throws PluginException {
PluginDao dao = PluginFactory.getInstance().getPluginDao( String pluginName = record.getPluginName();
record.getPluginName()); PluginDao dao = PluginFactory.getInstance().getPluginDao(pluginName);
ITimer timer = TimeUtil.getTimer();
timer.start();
dao.persistToDatabase(record); dao.persistToDatabase(record);
timer.stop();
perfLog.logDuration(pluginName + ": Saved a record: Time to Save",
timer.getElapsedTime());
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("Persisted: " + record + " to database"); logger.debug("Persisted: " + record + " to database");
} }
@ -100,10 +113,16 @@ public class IndexSrv {
} }
try { try {
PluginDao dao = PluginFactory.getInstance().getPluginDao( String pluginName = record[0].getPluginName();
record[0].getPluginName()); PluginDao dao = PluginFactory.getInstance().getPluginDao(pluginName);
EDEXUtil.checkPersistenceTimes(record); EDEXUtil.checkPersistenceTimes(record);
ITimer timer = TimeUtil.getTimer();
timer.start();
PluginDataObject[] persisted = dao.persistToDatabase(record); PluginDataObject[] persisted = dao.persistToDatabase(record);
timer.stop();
perfLog.logDuration(pluginName + ": Saved " + persisted.length
+ " record(s): Time to Save",
timer.getElapsedTime());
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
for (PluginDataObject rec : record) { for (PluginDataObject rec : record) {
logger.debug("Persisted: " + rec + " to database"); logger.debug("Persisted: " + rec + " to database");

View file

@ -33,6 +33,10 @@ import com.raytheon.uf.common.datastorage.DuplicateRecordStorageException;
import com.raytheon.uf.common.datastorage.StorageException; import com.raytheon.uf.common.datastorage.StorageException;
import com.raytheon.uf.common.datastorage.StorageStatus; import com.raytheon.uf.common.datastorage.StorageStatus;
import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.core.EDEXUtil;
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;
@ -44,9 +48,10 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Oct 31, 2008 chammack Initial creation * Oct 31, 2008 chammack Initial creation
* 02/06/09 1990 bphillip Refactored to use plugin specific daos * 02/06/09 1990 bphillip Refactored to use plugin specific daos
* Nov 02, 2012 1302 djohnson Remove unused method, fix formatting. * Nov 02, 2012 1302 djohnson Remove unused method, fix formatting.
* Mar 19, 2013 1785 bgonzale Added performance status to persist.
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -62,6 +67,9 @@ public class PersistSrv {
return instance; return instance;
} }
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("HDF5:");
private PersistSrv() { private PersistSrv() {
} }
@ -75,9 +83,16 @@ public class PersistSrv {
EDEXUtil.checkPersistenceTimes(pdo); EDEXUtil.checkPersistenceTimes(pdo);
try { try {
PluginDao dao = PluginFactory.getInstance().getPluginDao( String pluginName = pdo[0].getPluginName();
pdo[0].getPluginName()); PluginDao dao = PluginFactory.getInstance()
.getPluginDao(pluginName);
ITimer timer = TimeUtil.getTimer();
timer.start();
StorageStatus ss = dao.persistToHDF5(pdo); StorageStatus ss = dao.persistToHDF5(pdo);
timer.stop();
perfLog.logDuration(pluginName + ": Persisted " + pdo.length
+ " record(s): Time to Persist",
timer.getElapsedTime());
StorageException[] se = ss.getExceptions(); StorageException[] se = ss.getExceptions();
pdoList.addAll(Arrays.asList(pdo)); pdoList.addAll(Arrays.asList(pdo));
if (se != null) { if (se != null) {

View file

@ -37,6 +37,10 @@ import com.raytheon.uf.common.pointdata.PointDataDescription;
import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.pointdata.PointDataView;
import com.raytheon.uf.common.pointdata.spatial.ObStation; import com.raytheon.uf.common.pointdata.spatial.ObStation;
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.bufrtools.AbstractBUFRDecoder; import com.raytheon.uf.edex.bufrtools.AbstractBUFRDecoder;
import com.raytheon.uf.edex.database.DataAccessLayerException; import com.raytheon.uf.edex.database.DataAccessLayerException;
import com.raytheon.uf.edex.decodertools.bufr.BUFRDataDocument; import com.raytheon.uf.edex.decodertools.bufr.BUFRDataDocument;
@ -73,6 +77,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* 20080408 1039 jkorman Added traceId for tracing data. * 20080408 1039 jkorman Added traceId for tracing data.
* 11/25/08 #1684 chammack Camel Refactor * 11/25/08 #1684 chammack Camel Refactor
* Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin * Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin
* Mar 19, 2013 1785 bgonzale Added performance status handler and added status
* to decodeData.
* </pre> * </pre>
* *
* @author jkorman * @author jkorman
@ -87,6 +93,9 @@ public class BufrUADecoder extends AbstractBUFRDecoder {
private BUFRUAAdapterFactory adapterFactory; private BUFRUAAdapterFactory adapterFactory;
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("BufrUA:");
/** /**
* *
* @param name * @param name
@ -128,7 +137,9 @@ public class BufrUADecoder extends AbstractBUFRDecoder {
Iterator<BUFRDataDocument> iterator = document.iterator(); Iterator<BUFRDataDocument> iterator = document.iterator();
String cor = isCor(wmoHeader); String cor = isCor(wmoHeader);
ITimer timer = TimeUtil.getTimer();
timer.start();
while (iterator.hasNext()) { while (iterator.hasNext()) {
logger.debug("Decoding one BUFRDataDocument"); logger.debug("Decoding one BUFRDataDocument");
@ -152,6 +163,8 @@ public class BufrUADecoder extends AbstractBUFRDecoder {
} }
} }
} }
timer.stop();
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
} }
return decodedData; return decodedData;
} }

View file

@ -28,6 +28,7 @@ Require-Bundle: com.raytheon.uf.common.dataplugin.gfe;bundle-version="1.12.1174"
com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0", com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0",
com.raytheon.uf.common.util;bundle-version="1.12.1174", com.raytheon.uf.common.util;bundle-version="1.12.1174",
com.google.guava;bundle-version="1.0.0", com.google.guava;bundle-version="1.0.0",
org.apache.commons.lang;bundle-version="2.3.0"
com.raytheon.uf.common.python.concurrent;bundle-version="1.0.0" com.raytheon.uf.common.python.concurrent;bundle-version="1.0.0"
Export-Package: com.raytheon.edex.plugin.gfe, Export-Package: com.raytheon.edex.plugin.gfe,
com.raytheon.edex.plugin.gfe.config, com.raytheon.edex.plugin.gfe.config,

View file

@ -19,6 +19,8 @@
**/ **/
package com.raytheon.edex.plugin.gfe.server.handler.svcbu; package com.raytheon.edex.plugin.gfe.server.handler.svcbu;
import org.apache.commons.lang.BooleanUtils;
import com.raytheon.edex.plugin.gfe.svcbackup.SvcBackupUtil; import com.raytheon.edex.plugin.gfe.svcbackup.SvcBackupUtil;
import com.raytheon.uf.common.dataplugin.gfe.request.ImportConfRequest; import com.raytheon.uf.common.dataplugin.gfe.request.ImportConfRequest;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse; import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
@ -33,7 +35,9 @@ import com.raytheon.uf.common.serialization.comm.IRequestHandler;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 4, 2011 bphillip Initial creation * Aug 04, 2011 bphillip Initial creation
* Mar 20, 2013 1447 dgilling Support troubleshooting mode
* added to match A1 DR 21404.
* *
* </pre> * </pre>
* *
@ -49,7 +53,8 @@ public class ImportConfRequestHandler implements
ServerResponse<String> sr = new ServerResponse<String>(); ServerResponse<String> sr = new ServerResponse<String>();
SvcBackupUtil.execute("request_configuration", request.getPrimarySite() SvcBackupUtil.execute("request_configuration", request.getPrimarySite()
.toLowerCase(), request.getFailedSite().toLowerCase()); .toLowerCase(), request.getFailedSite().toLowerCase(), Integer
.toString(BooleanUtils.toInteger(request.isTrMode())));
return sr; return sr;
} }
} }

View file

@ -129,6 +129,8 @@ THINNED_GRID_VALUES = THINNED_GRID_PT_MAP.values()
# Date Ticket# Engineer Description # Date Ticket# Engineer Description
# ------------ ---------- ----------- -------------------------- # ------------ ---------- ----------- --------------------------
# 04/7/09 #1994 bphillip Initial Creation. # 04/7/09 #1994 bphillip Initial Creation.
# Mar 25, 2013 1821 bsteffen Reshape grib data arrays in
# place to improve performance.
# #
class GribDecoder(): class GribDecoder():
@ -327,7 +329,7 @@ class GribDecoder():
if scanMode is not None: if scanMode is not None:
if not thinnedGrid: if not thinnedGrid:
numpyDataArray = numpy.resize(data, (ny, nx)) numpyDataArray = numpy.reshape(data, (ny, nx))
# Check if rows are scanned in opposite direction. If so, we need to flip them around # Check if rows are scanned in opposite direction. If so, we need to flip them around
if scanMode & 16 == 16: if scanMode & 16 == 16:
@ -373,7 +375,7 @@ class GribDecoder():
if subCoverage is not None: if subCoverage is not None:
subGrid = spatialCache.getSubGrid(modelName, gridCoverage) subGrid = spatialCache.getSubGrid(modelName, gridCoverage)
# resize the data array # resize the data array
numpyDataArray = numpy.resize(numpyDataArray, (ny, nx)) numpyDataArray = numpy.reshape(numpyDataArray, (ny, nx))
startx = subGrid.getUpperLeftX() startx = subGrid.getUpperLeftX()
starty = subGrid.getUpperLeftY() starty = subGrid.getUpperLeftY()
subnx = subGrid.getNX() subnx = subGrid.getNX()
@ -399,7 +401,7 @@ class GribDecoder():
# set the new coverage # set the new coverage
gdsSectionValues['coverage'] = subCoverage gdsSectionValues['coverage'] = subCoverage
numpyDataArray = numpy.resize(numpyDataArray, (1, metadata[4])) numpyDataArray = numpy.reshape(numpyDataArray, (1, metadata[4]))
newAbbr = GribParamTranslator.getInstance().translateParameter(2, pdsSectionValues['parameterAbbreviation'], pdsSectionValues['centerid'], pdsSectionValues['subcenterid'], pdsSectionValues['genprocess'], dataTime, gridCoverage) newAbbr = GribParamTranslator.getInstance().translateParameter(2, pdsSectionValues['parameterAbbreviation'], pdsSectionValues['centerid'], pdsSectionValues['subcenterid'], pdsSectionValues['genprocess'], dataTime, gridCoverage)

View file

@ -33,9 +33,13 @@ import com.raytheon.edex.plugin.grib.exception.GribException;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException; 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.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
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.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.python.decoder.PythonDecoder; import com.raytheon.uf.edex.python.decoder.PythonDecoder;
/** /**
@ -47,6 +51,8 @@ import com.raytheon.uf.edex.python.decoder.PythonDecoder;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 3/12/10 4758 bphillip Initial creation * 3/12/10 4758 bphillip Initial creation
* 02/12/2013 1615 bgonzale public decode method to a Processor exchange method. * 02/12/2013 1615 bgonzale public decode method to a Processor exchange method.
* Mar 19, 2013 1785 bgonzale Added performance status handler and added status
* to process.
* </pre> * </pre>
* *
* @author njensen * @author njensen
@ -57,6 +63,11 @@ public class GribDecoder implements Processor {
private static final transient IUFStatusHandler statusHandler = UFStatus private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GribDecoder.class); .getHandler(GribDecoder.class);
private static final String[] DecoderNames = { "Grib1", "Grib2" };
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("");
/** /**
* @see org.apache.camel.Processor.process(Exchange) * @see org.apache.camel.Processor.process(Exchange)
*/ */
@ -72,16 +83,22 @@ public class GribDecoder implements Processor {
int edition = 0; int edition = 0;
GridRecord[] records = null; GridRecord[] records = null;
try { try {
ITimer timer = TimeUtil.getTimer();
String decoderName;
raf = new RandomAccessFile(file.getAbsolutePath(), "r"); raf = new RandomAccessFile(file.getAbsolutePath(), "r");
raf.order(RandomAccessFile.BIG_ENDIAN); raf.order(RandomAccessFile.BIG_ENDIAN);
edition = GribChecker.getEdition(raf); edition = GribChecker.getEdition(raf);
exchange.getIn().setHeader(DATA_TYPE, GRIB + edition); exchange.getIn().setHeader(DATA_TYPE, GRIB + edition);
timer.start();
switch (edition) { switch (edition) {
case 1: case 1:
decoderName = DecoderNames[0];
records = new Grib1Decoder().decode(file.getAbsolutePath()); records = new Grib1Decoder().decode(file.getAbsolutePath());
break; break;
case 2: case 2:
decoderName = DecoderNames[1];
records = decodeGrib2(file); records = decodeGrib2(file);
break; break;
default: default:
@ -108,6 +125,9 @@ public class GribDecoder implements Processor {
record.constructDataURI(); record.constructDataURI();
} }
} }
timer.stop();
perfLog.logDuration(decoderName + ": Time to Decode",
timer.getElapsedTime());
} catch (Exception e) { } catch (Exception e) {
statusHandler.handle(Priority.ERROR, "Failed to decode file: [" statusHandler.handle(Priority.ERROR, "Failed to decode file: ["
+ file.getAbsolutePath() + "]", e); + file.getAbsolutePath() + "]", e);

View file

@ -26,17 +26,19 @@ package com.raytheon.edex.plugin.obs;
* *
* <pre> * <pre>
* *
* OFTWARE HISTORY * SOFTWARE HISTORY
* *
* ate Ticket# Engineer Description * Date Ticket# Engineer Description
* ----------- ---------- ----------- -------------------------- * ----------- ---------- ----------- --------------------------
* 4/27/07 199 bphillip Initial creation * 4/27/07 199 bphillip Initial creation
* 07/31/2007 411 jkorman Added addition logging * 07/31/2007 411 jkorman Added addition logging
* 08/10/2007 379 jkorman Added disposal behavior. * 08/10/2007 379 jkorman Added disposal behavior.
* 20071217 453 jkorman Added code to check for duplicate obs. * 20071217 453 jkorman Added code to check for duplicate obs.
* 20080314 995 jkorman Changed setDecoderStrategy to check for * 20080314 995 jkorman Changed setDecoderStrategy to check for
* empty data. * empty data.
* 20080408 1039 jkorman Added traceId for tracing data. * 20080408 1039 jkorman Added traceId for tracing data.
* Mar 19, 2013 1785 bgonzale Added performance status handler and added
* status to decode.
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -50,6 +52,10 @@ import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.AbstractDecoder; import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.edex.plugin.obs.metar.MetarDecoder; import com.raytheon.edex.plugin.obs.metar.MetarDecoder;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.wmo.message.WMOHeader; import com.raytheon.uf.edex.wmo.message.WMOHeader;
public class ObsDecoder extends AbstractDecoder { public class ObsDecoder extends AbstractDecoder {
@ -58,6 +64,9 @@ public class ObsDecoder extends AbstractDecoder {
private final String PLUGIN_NAME; private final String PLUGIN_NAME;
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("Obs:");
private String traceId = null; private String traceId = null;
/** /**
@ -84,6 +93,8 @@ public class ObsDecoder extends AbstractDecoder {
try { try {
if (decoder != null) { if (decoder != null) {
ITimer timer = TimeUtil.getTimer();
timer.start();
reports = decoder.decode(data, headers); reports = decoder.decode(data, headers);
if (reports != null) { if (reports != null) {
@ -91,6 +102,8 @@ public class ObsDecoder extends AbstractDecoder {
report.setTraceId(traceId); report.setTraceId(traceId);
} }
} }
timer.stop();
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
} }
} catch (Exception e) { } catch (Exception e) {
logger.error(traceId + "- Error in ObsDecoder", e); logger.error(traceId + "- Error in ObsDecoder", e);

View file

@ -65,10 +65,14 @@ import com.raytheon.uf.common.dataplugin.radar.util.TiltAngleBin;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
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.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.core.EDEXUtil;
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils; import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
import com.raytheon.uf.edex.database.cluster.ClusterTask; import com.raytheon.uf.edex.database.cluster.ClusterTask;
@ -87,7 +91,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* Dec 17, 2007 600 bphillip Added dao pool usage * Dec 17, 2007 600 bphillip Added dao pool usage
* Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() signature changed. * Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() signature changed.
* Mar 19, 2013 1804 bsteffen Optimize decoder performance. * Mar 19, 2013 1804 bsteffen Optimize decoder performance.
* * Mar 19, 2013 1785 bgonzale Added performance status handler and added status
* to decode.
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -131,6 +136,9 @@ public class RadarDecoder extends AbstractDecoder {
private final String RADAR = "RADAR"; private final String RADAR = "RADAR";
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("Radar:");
public RadarDecoder() throws DecoderException { public RadarDecoder() throws DecoderException {
String dir = ""; String dir = "";
@ -170,6 +178,9 @@ public class RadarDecoder extends AbstractDecoder {
// decode the product // decode the product
String arch = new String(messageData, 0, 4); String arch = new String(messageData, 0, 4);
try { try {
ITimer timer = TimeUtil.getTimer();
timer.start();
// for level2 data, this does not happen very often // for level2 data, this does not happen very often
if (LEVEL_TWO_IDENTS.contains(arch)) { if (LEVEL_TWO_IDENTS.contains(arch)) {
decodeLevelTwoData(messageData, recordList); decodeLevelTwoData(messageData, recordList);
@ -421,8 +432,11 @@ public class RadarDecoder extends AbstractDecoder {
logger.error(e); logger.error(e);
return new PluginDataObject[0]; return new PluginDataObject[0];
} }
recordList.add(record);
timer.stop();
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
recordList.add(record);
} }
} catch (Exception e) { } catch (Exception e) {
theHandler.handle(Priority.ERROR, "Couldn't properly handle " theHandler.handle(Priority.ERROR, "Couldn't properly handle "

View file

@ -19,11 +19,6 @@
**/ **/
package com.raytheon.edex.plugin.radar; package com.raytheon.edex.plugin.radar;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.zip.DataFormatException; import java.util.zip.DataFormatException;
@ -45,6 +40,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 11, 2010 mnash Initial creation * Nov 11, 2010 mnash Initial creation
* Jul 16, 2012 DR 14723 D.Friedman Decompress files atomically * Jul 16, 2012 DR 14723 D.Friedman Decompress files atomically
* Mar 20, 2013 1804 bsteffen Switch all radar decompressing to be in
* memory.
* *
* </pre> * </pre>
* *
@ -66,6 +63,24 @@ public class RadarDecompressor {
.compile("([A-Z]{4}[0-9]{2} [A-Z]{4} [0-9]{6})\\x0D\\x0D\\x0A(\\w{6})\\x0D\\x0D\\x0A"); .compile("([A-Z]{4}[0-9]{2} [A-Z]{4} [0-9]{6})\\x0D\\x0D\\x0A(\\w{6})\\x0D\\x0D\\x0A");
public byte[] decompress(byte[] messageData, Headers headers) { public byte[] decompress(byte[] messageData, Headers headers) {
return decompressImpl(messageData, headers, false);
}
public byte[] decompressWithHeader(byte[] messageData, Headers headers) {
return decompressImpl(messageData, headers, true);
}
/**
* decompress the radar data in messageData.
*
* @param messageData
* @param headers
* @param keepHeader
* If true, keep any WMO/AWIPS heading found in file
* @return
*/
public byte[] decompressImpl(byte[] messageData, Headers headers,
boolean keepHeader) {
byte[] radarData = null; byte[] radarData = null;
try { try {
int wmoHeaderSize; int wmoHeaderSize;
@ -79,10 +94,23 @@ public class RadarDecompressor {
if (isCompressed(messageData, wmoHeaderSize)) { if (isCompressed(messageData, wmoHeaderSize)) {
radarData = decompressRadar(messageData, wmoHeaderSize, headers); radarData = decompressRadar(messageData, wmoHeaderSize, headers);
} else { if (keepHeader) {
// put the header back on.
byte[] radarDataWithHeader = new byte[radarData.length
+ wmoHeaderSize];
System.arraycopy(messageData, 0, radarDataWithHeader, 0,
wmoHeaderSize);
System.arraycopy(radarData, 0, radarDataWithHeader,
wmoHeaderSize, radarData.length);
radarData = radarDataWithHeader;
}
} else if (!keepHeader && wmoHeaderSize > 0) {
// strip the header.
radarData = new byte[messageData.length - wmoHeaderSize]; radarData = new byte[messageData.length - wmoHeaderSize];
System.arraycopy(messageData, wmoHeaderSize, radarData, 0, System.arraycopy(messageData, wmoHeaderSize, radarData, 0,
radarData.length); radarData.length);
} else {
radarData = messageData;
} }
} catch (Exception e) { } catch (Exception e) {
theHandler.handle(Priority.ERROR, "Failed decompression on " theHandler.handle(Priority.ERROR, "Failed decompression on "
@ -124,106 +152,6 @@ public class RadarDecompressor {
return false; return false;
} }
/**
* Decompress file atomically.
*
* @param file
* @param headers
* @param keepHeader If true, keep any WMO/AWIPS heading found in file
* @return
*/
private File decompressToFileImpl(File file, Headers headers, boolean keepHeader) {
byte[] messageData = null;
FileInputStream input = null;
try {
input = new FileInputStream(file);
int fileSize = (int) input.getChannel().size();
messageData = new byte[fileSize];
input.read(messageData);
} catch (FileNotFoundException e) {
theHandler.handle(Priority.ERROR, e.getMessage());
} catch (IOException e) {
theHandler.handle(Priority.ERROR, e.getMessage());
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
theHandler.handle(Priority.ERROR, e.getMessage());
}
}
}
/*
* TODO: If reading fails, the code below will NPE. Is this
* done intentionally to stop processing?
*/
String headerSearch = "";
int start = 0;
if (messageData.length < 80) {
} else {
// skip the WMO header if any
headerSearch = new String(messageData, 0, 80);
start = findStartRadarData(headerSearch);
headerSearch = headerSearch.substring(0, start);
}
messageData = decompress(messageData, headers);
FileOutputStream output = null;
File tmpFile = null;
try {
tmpFile = File.createTempFile(file.getName() + ".", ".decompress", file.getParentFile());
output = new FileOutputStream(tmpFile);
if (keepHeader)
output.write(headerSearch.getBytes());
output.write(messageData);
output.close();
output = null;
if (tmpFile.renameTo(file))
tmpFile = null;
else
theHandler.handle(Priority.ERROR,
String.format("Cannot rename %s to %s", tmpFile, file));
} catch (IOException e) {
theHandler.handle(Priority.ERROR, e.getMessage());
} finally {
if (output != null)
try {
output.close();
} catch (IOException e) {
theHandler.handle(Priority.ERROR, "error closing file", e);
}
if (tmpFile != null)
tmpFile.delete();
}
return file;
}
/**
* Used for things that need to write the data back out to a file
*
* @param messageData
* @return
*/
public File decompressToFile(File file, Headers headers) {
return decompressToFileImpl(file, headers, true);
}
/**
* Used for things that need to write the data back out to a file, without a
* header. Same as decompressToFile, but will strip the header off before
* writing it back out.
*
* @param messageData
* @return
*/
public File decompressToFileWithoutHeader(File file, Headers headers) {
return decompressToFileImpl(file, headers, false);
}
private int findStartRadarData(String headerInfo) { private int findStartRadarData(String headerInfo) {
int startOfRadarData = 0; int startOfRadarData = 0;
Matcher matcher = WMO_PATTERN.matcher(headerInfo); Matcher matcher = WMO_PATTERN.matcher(headerInfo);

View file

@ -30,6 +30,10 @@ import com.raytheon.edex.plugin.redbook.dao.RedbookDao;
import com.raytheon.edex.plugin.redbook.decoder.RedbookParser; import com.raytheon.edex.plugin.redbook.decoder.RedbookParser;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.database.plugin.PluginFactory; import com.raytheon.uf.edex.database.plugin.PluginFactory;
import com.raytheon.uf.edex.wmo.message.WMOHeader; import com.raytheon.uf.edex.wmo.message.WMOHeader;
@ -49,6 +53,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* 20090327 2019 jkorman Added code to check for non-redbook data. * 20090327 2019 jkorman Added code to check for non-redbook data.
* 20120524 #647 dgilling Update persistence time in * 20120524 #647 dgilling Update persistence time in
* createdBackDatedVersionIfNeeded. * createdBackDatedVersionIfNeeded.
* Mar 19, 2013 1785 bgonzale Added performance status handler and added
* status to decode.
* </pre> * </pre>
* *
* @author jkorman * @author jkorman
@ -79,13 +85,16 @@ public class RedbookDecoder extends AbstractDecoder {
private static final String GIF87A_SIG = "GIF87a"; private static final String GIF87A_SIG = "GIF87a";
private static final String GIF89A_SIG = "GIF89a"; // This sig is currently not used.
// private static final String GIF89A_SIG = "GIF89a";
private static final String DIFAX_SIG = "DFAX"; private static final String DIFAX_SIG = "DFAX";
// Name of the plugin controlling this decoder. // Name of the plugin controlling this decoder.
private final String PLUGIN_NAME; private final String PLUGIN_NAME;
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("Redbook:");
private String traceId = null; private String traceId = null;
/** /**
@ -117,6 +126,9 @@ public class RedbookDecoder extends AbstractDecoder {
WMOHeader wmoHeader = new WMOHeader(rawMessage, headers); WMOHeader wmoHeader = new WMOHeader(rawMessage, headers);
if (wmoHeader.isValid()) { if (wmoHeader.isValid()) {
ITimer timer = TimeUtil.getTimer();
timer.start();
int start = wmoHeader.getMessageDataStart(); int start = wmoHeader.getMessageDataStart();
int len = rawMessage.length - start; int len = rawMessage.length - start;
@ -145,6 +157,8 @@ public class RedbookDecoder extends AbstractDecoder {
e); e);
} }
} }
timer.stop();
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
} else { } else {
logger.error(traceId + "- No valid WMO header found in data."); logger.error(traceId + "- No valid WMO header found in data.");
} }

View file

@ -43,8 +43,12 @@ import com.raytheon.uf.common.dataplugin.satellite.SatMapCoverage;
import com.raytheon.uf.common.dataplugin.satellite.SatelliteMessageData; import com.raytheon.uf.common.dataplugin.satellite.SatelliteMessageData;
import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord; import com.raytheon.uf.common.dataplugin.satellite.SatelliteRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.util.ArraysUtil; import com.raytheon.uf.common.util.ArraysUtil;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.decodertools.time.TimeTools; import com.raytheon.uf.edex.decodertools.time.TimeTools;
import com.raytheon.uf.edex.wmo.message.WMOHeader; import com.raytheon.uf.edex.wmo.message.WMOHeader;
@ -53,15 +57,15 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* *
* <pre> * <pre>
* *
* OFTWARE HISTORY * SOFTWARE HISTORY
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ----------- ---------- ----------- -------------------------- * ----------- ---------- ----------- --------------------------
* 006 garmenda Initial Creation * 006 garmenda Initial Creation
* /14/2007 139 Phillippe Modified to follow refactored plugin pattern * /14/2007 139 Phillippe Modified to follow refactored plugin pattern
* 8/30/07 njensen Added units, commented out data that * 8/30/07 njensen Added units, commented out data that
* is currently decoded but not used. * is currently decoded but not used.
* 12/01/07 555 garmendariz Modified decompress method. * 12/01/07 555 garmendariz Modified decompress method.
* 12/06/07 555 garmendariz Modifed start point to remove satellite header * 12/06/07 555 garmendariz Modifed start point to remove satellite header
* Dec 17, 2007 600 bphillip Added dao pool usage * Dec 17, 2007 600 bphillip Added dao pool usage
* 04Apr2008 1068 MW Fegan Modified decompression routine to prevent * 04Apr2008 1068 MW Fegan Modified decompression routine to prevent
@ -69,13 +73,16 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* 11/11/2008 chammack Refactored to be thread safe in camel * 11/11/2008 chammack Refactored to be thread safe in camel
* 02/05/2010 4120 jkorman Modified removeWmoHeader to handle WMOHeader in * 02/05/2010 4120 jkorman Modified removeWmoHeader to handle WMOHeader in
* various start locations. * various start locations.
* 04/17/2012 14724 kshresth This is a temporary workaround - Projection off CONUS * 04/17/2012 14724 kshresth This is a temporary workaround - Projection off CONUS
* - AWIPS2 Baseline Repository -------- * - AWIPS2 Baseline Repository --------
* 06/27/2012 798 jkorman Using SatelliteMessageData to "carry" the decoded image. * 06/27/2012 798 jkorman Using SatelliteMessageData to "carry" the decoded image.
* 01/03/2013 15294 D. Friedman Start with File instead of byte[] to * 01/03/2013 15294 D. Friedman Start with File instead of byte[] to
* reduce memory usage. * reduce memory usage.
* Feb 15, 2013 1638 mschenke Moved array based utilities from Util into ArraysUtil * Feb 15, 2013 1638 mschenke Moved array based utilities from Util into ArraysUtil
* *
* Mar 19, 2013 1785 bgonzale Added performance status handler and added status
* to decode.
*
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -93,6 +100,9 @@ public class SatelliteDecoder extends AbstractDecoder {
private static final int INITIAL_READ = GINI_HEADER_SIZE + 128; private static final int INITIAL_READ = GINI_HEADER_SIZE + 128;
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("Satellite:");
private SatelliteDao dao; private SatelliteDao dao;
public PluginDataObject[] decode(File file) throws Exception { public PluginDataObject[] decode(File file) throws Exception {
@ -105,6 +115,8 @@ public class SatelliteDecoder extends AbstractDecoder {
return new PluginDataObject[0]; return new PluginDataObject[0];
RandomAccessFile f = new RandomAccessFile(file, "r"); RandomAccessFile f = new RandomAccessFile(file, "r");
try { try {
ITimer timer = TimeUtil.getTimer();
timer.start();
// Read in enough data to cover the WMO heading and GINI header. // Read in enough data to cover the WMO heading and GINI header.
ByteBuffer byteBuffer = ByteBuffer.allocate(INITIAL_READ); ByteBuffer byteBuffer = ByteBuffer.allocate(INITIAL_READ);
f.getChannel().read(byteBuffer); f.getChannel().read(byteBuffer);
@ -429,6 +441,8 @@ public class SatelliteDecoder extends AbstractDecoder {
record.setMessageData(dataRec); record.setMessageData(dataRec);
} }
} }
timer.stop();
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
} finally { } finally {
try { try {
f.close(); f.close();

View file

@ -6,7 +6,6 @@ Bundle-Version: 1.12.1174.qualifier
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
Bundle-Vendor: RAYTHEON Bundle-Vendor: RAYTHEON
Require-Bundle: com.raytheon.edex.common, Require-Bundle: com.raytheon.edex.common,
com.raytheon.uf.edex.pointdata,
com.raytheon.uf.edex.decodertools;bundle-version="1.0.0", com.raytheon.uf.edex.decodertools;bundle-version="1.0.0",
org.apache.commons.logging, org.apache.commons.logging,
org.geotools, org.geotools,
@ -15,4 +14,8 @@ Require-Bundle: com.raytheon.edex.common,
Export-Package: com.raytheon.edex.plugin.sfcobs.common Export-Package: com.raytheon.edex.plugin.sfcobs.common
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.uf.common.dataplugin.sfcobs, Import-Package: com.raytheon.uf.common.dataplugin.sfcobs,
com.raytheon.uf.common.dataplugin.sfcobs.dao com.raytheon.uf.common.dataplugin.sfcobs.dao,
com.raytheon.uf.common.pointdata,
com.raytheon.uf.common.pointdata.spatial,
com.raytheon.uf.edex.pointdata,
com.raytheon.uf.common.status

View file

@ -35,6 +35,10 @@ import com.raytheon.edex.plugin.sfcobs.decoder.SfcObsDecoderFactory;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon; import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
import com.raytheon.uf.common.status.IPerformanceStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.decodertools.core.DecoderTools; import com.raytheon.uf.edex.decodertools.core.DecoderTools;
import com.raytheon.uf.edex.decodertools.time.TimeTools; import com.raytheon.uf.edex.decodertools.time.TimeTools;
import com.raytheon.uf.edex.wmo.message.WMOHeader; import com.raytheon.uf.edex.wmo.message.WMOHeader;
@ -66,6 +70,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
* time in the future. * time in the future.
* 20080215 887 jkorman Added null checks in decode. * 20080215 887 jkorman Added null checks in decode.
* 20080218 887 jkorman Reverse null checks in findDuplicate. * 20080218 887 jkorman Reverse null checks in findDuplicate.
* Mar 19, 2013 1785 bgonzale Added performance status handler and added status
* to decode.
* </pre> * </pre>
* *
* @author jkorman * @author jkorman
@ -77,6 +83,9 @@ public class SfcObsDecoder extends AbstractDecoder {
// Name of the plugin controlling this decoder. // Name of the plugin controlling this decoder.
public static final String PLUGIN_NAME = "sfcobs"; public static final String PLUGIN_NAME = "sfcobs";
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("SfcObs:");
/** The logger */ /** The logger */
private Log logger = LogFactory.getLog(getClass()); private Log logger = LogFactory.getLog(getClass());
@ -124,6 +133,9 @@ public class SfcObsDecoder extends AbstractDecoder {
SfcObsSeparator separator = SfcObsSeparator.separate(data, headers); SfcObsSeparator separator = SfcObsSeparator.separate(data, headers);
List<PluginDataObject> retVal = new ArrayList<PluginDataObject>(); List<PluginDataObject> retVal = new ArrayList<PluginDataObject>();
HashMap<String, Boolean> obsMap = new HashMap<String, Boolean>(); HashMap<String, Boolean> obsMap = new HashMap<String, Boolean>();
ITimer timer = TimeUtil.getTimer();
timer.start();
while (separator.hasNext()) { while (separator.hasNext()) {
SfcObsDecoderInput input = separator.next(); SfcObsDecoderInput input = separator.next();
PluginDataObject report = null; PluginDataObject report = null;
@ -169,7 +181,8 @@ public class SfcObsDecoder extends AbstractDecoder {
} }
} }
} }
timer.stop();
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
return retVal.toArray(new PluginDataObject[retVal.size()]); return retVal.toArray(new PluginDataObject[retVal.size()]);
} }

View file

@ -105,6 +105,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
* 05/28/2009 2410 J. Sanchez Posted data for unknstnvalue. * 05/28/2009 2410 J. Sanchez Posted data for unknstnvalue.
* 12/11/2009 2488 M. Duff Fixed problem with storing text products. * 12/11/2009 2488 M. Duff Fixed problem with storing text products.
* 03/07/2013 15545 w. kwock Added Observe time to log * 03/07/2013 15545 w. kwock Added Observe time to log
* 03/21/2013 15967 w. kwock Fix the error in buildTsFcstRiv riverstatus table issue
* *
* </pre> * </pre>
* *
@ -1551,8 +1552,8 @@ public class PostShef {
shefDataValue.setCreationDateObj(fcstHead[y].getId() shefDataValue.setCreationDateObj(fcstHead[y].getId()
.getBasistime()); .getBasistime());
shefDataValue.setValue(fcstHead[y].getValue()); shefDataValue.setValue(fcstHead[y].getValue());
} shefList.add(shefDataValue);
shefList.add(shefDataValue); }
} }
} catch (Exception e) { } catch (Exception e) {
log.error("Query = [" + query + "]"); log.error("Query = [" + query + "]");
@ -1707,8 +1708,7 @@ public class PostShef {
for (int i = 0; i < ulCount; i++) { for (int i = 0; i < ulCount; i++) {
tsFirstChk[i] = 0; tsFirstChk[i] = 0;
} }
Timestamp row = null;
Timestamp[] row = null;
Timestamp validTime = null; Timestamp validTime = null;
for (int i = 0; i < fcstCount; i++) { for (int i = 0; i < fcstCount; i++) {
@ -1720,8 +1720,8 @@ public class PostShef {
basisIndex[i] = MISSING; basisIndex[i] = MISSING;
for (int j = 0; ((j < ulCount) && (basisIndex[i] == MISSING)); j++) { for (int j = 0; ((j < ulCount) && (basisIndex[i] == MISSING)); j++) {
row = (Timestamp[]) ulHead[j]; row = (Timestamp) ulHead[j];
ulBasisTime = row[j]; ulBasisTime = row;
if (ulBasisTime.compareTo(fcstBasisTime) == 0) { if (ulBasisTime.compareTo(fcstBasisTime) == 0) {
basisIndex[i] = j; basisIndex[i] = j;
@ -1759,8 +1759,8 @@ public class PostShef {
*/ */
for (int j = 0; j < ulCount; j++) { for (int j = 0; j < ulCount; j++) {
row = (Timestamp[]) ulHead[j]; row = (Timestamp) ulHead[j];
basisTime[j] = row[j]; basisTime[j] = row;
} }
/* /*

View file

@ -85,6 +85,7 @@ import com.vividsolutions.jts.io.WKBReader;
* 02/01/13 1569 D.Hladky Constants * 02/01/13 1569 D.Hladky Constants
* 03/01/13 DR13228 G. Zhang Add VGB county and related code * 03/01/13 DR13228 G. Zhang Add VGB county and related code
* 02/20/13 1635 D. Hladky Constants * 02/20/13 1635 D. Hladky Constants
* 03/18/13 1817 D. Hladky Fixed issue with BOX where only 1 HUC was showing up.
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -250,11 +251,35 @@ public class FFMPTemplates {
"No configuration file found, default settings applied"); "No configuration file found, default settings applied");
// we use 4 because it is the 90% solution as a start point for // we use 4 because it is the 90% solution as a start point for
// the analysis // the analysis. Added check to make sure at least 2 HUC layers are created.
ArrayList<Integer> hucParams = FFMPUtils.getHucParameters(4, int preliminarystart = 4;
// first crack
ArrayList<Integer> hucParams = FFMPUtils.getHucParameters(preliminarystart,
primaryCWA.getCwa()); primaryCWA.getCwa());
setHucDepthStart(hucParams.get(0)); int startDepth = hucParams.get(0);
setTotalHucLevels(hucParams.get(1)); int numlevels = hucParams.get(1);
int i = 1;
// recursively call until we have two layers
while (numlevels < 2) {
int checkDepth = preliminarystart - i;
hucParams = FFMPUtils.getHucParameters(checkDepth,
primaryCWA.getCwa());
startDepth = hucParams.get(0);
numlevels = hucParams.get(1);
i++;
// safety value in case it just won't work with this shape
if (checkDepth == 0) {
// bail, won't work
statusHandler
.handle(Priority.ERROR,
"Cannot create a good template. There are not enough unique HUC's to create more than 1 layer.");
return;
}
}
setHucDepthStart(startDepth);
setTotalHucLevels(numlevels);
setExtents(20000.0); setExtents(20000.0);
setVirtual(true); setVirtual(true);

View file

@ -83,6 +83,7 @@ import com.vividsolutions.jts.io.WKTWriter;
* 06/18/12 DR 15108 G. Zhang Fix County FIPS 4-digit issue * 06/18/12 DR 15108 G. Zhang Fix County FIPS 4-digit issue
* 01/02/13 DR 1569 D. Hladky constants, arraylist to list and moved common menthods here * 01/02/13 DR 1569 D. Hladky constants, arraylist to list and moved common menthods here
* 03/01/13 DR 13228 G. Zhang Add state for VGB query and related code * 03/01/13 DR 13228 G. Zhang Add state for VGB query and related code
* 03/18/13 1817 D. Hladky Fixed issue with BOX where only 1 HUC was showing up.
* </pre> * </pre>
* @author dhladky * @author dhladky
* @version 1 * @version 1
@ -304,18 +305,20 @@ public class FFMPUtils {
int startDepth = prelimstartDepth; int startDepth = prelimstartDepth;
for (int i = 0; i < pfafs.length; i++) { for (int i = 0; i < pfafs.length; i++) {
int depth = pfafs[i].indexOf("0"); int depth = pfafs[i].substring(prelimstartDepth).indexOf("0");
depth = prelimstartDepth + depth;
if (depth > maxDepth) { if (depth > maxDepth) {
maxDepth = depth; maxDepth = depth;
} }
} }
// do an 80% analysis to find min (startDepth) // do an 80% analysis to find min (startDepth)
if (pfafs.length > 0) { if (pfafs.length > 0) {
for (int myMinDepth = maxDepth; myMinDepth > 0; myMinDepth--) { for (int myMinDepth = maxDepth; myMinDepth > 0; myMinDepth--) {
int ilevelcount = 0; int ilevelcount = 0;
for (int i = 0; i < pfafs.length; i++) { for (int i = 0; i < pfafs.length; i++) {
int idepth = pfafs[i].indexOf("0"); int idepth = pfafs[i].substring(prelimstartDepth).indexOf("0");
idepth = prelimstartDepth + idepth;
if (idepth >= myMinDepth) { if (idepth >= myMinDepth) {
ilevelcount++; ilevelcount++;
} }

View file

@ -37,6 +37,8 @@ import com.raytheon.uf.common.util.FileUtil;
* Oct 9, 2008 njensen Initial creation * Oct 9, 2008 njensen Initial creation
* Sep 18, 2012 #1091 randerso added base directory to getGfeConfigIncludePath * Sep 18, 2012 #1091 randerso added base directory to getGfeConfigIncludePath
* Feb 27, 2013 #1447 dgilling Re-factor based on PythonPathIncludeUtil. * Feb 27, 2013 #1447 dgilling Re-factor based on PythonPathIncludeUtil.
* Mar 06 2013 15717 jzeng Change CAVE_STATIC to COMMON_STATIC
* for GFE localization files
* Mar 11, 2013 #1759 dgilling Add method getGfeConfigLF(). * Mar 11, 2013 #1759 dgilling Add method getGfeConfigLF().
* </pre> * </pre>
* *
@ -172,14 +174,14 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
public static String getProceduresIncludePath(boolean includeUser) { public static String getProceduresIncludePath(boolean includeUser) {
String baseDir = getPath(PATH_MANAGER.getContext( String baseDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
PROCEDURES); PROCEDURES);
String siteDir = getPath(PATH_MANAGER.getContext( String siteDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
PROCEDURES); PROCEDURES);
if (includeUser) { if (includeUser) {
String userDir = getPath(PATH_MANAGER.getContext( String userDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER), LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
PROCEDURES); PROCEDURES);
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir); return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
} else { } else {
@ -193,15 +195,15 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
public static String getTextUtilitiesIncludePath(boolean includeUser) { public static String getTextUtilitiesIncludePath(boolean includeUser) {
String baseDir = getPath(PATH_MANAGER.getContext( String baseDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), REGULAR); LocalizationType.COMMON_STATIC, LocalizationLevel.BASE), REGULAR);
String configDir = getPath(PATH_MANAGER.getContext( String configDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.CONFIGURED), LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED),
REGULAR); REGULAR);
String siteDir = getPath(PATH_MANAGER.getContext( String siteDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), REGULAR); LocalizationType.COMMON_STATIC, LocalizationLevel.SITE), REGULAR);
if (includeUser) { if (includeUser) {
String userDir = getPath(PATH_MANAGER.getContext( String userDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER), LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
REGULAR); REGULAR);
return PyUtil.buildJepIncludePath(userDir, siteDir, configDir, return PyUtil.buildJepIncludePath(userDir, siteDir, configDir,
baseDir); baseDir);
@ -216,17 +218,17 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
public static String getTextProductsIncludePath(boolean includeUser) { public static String getTextProductsIncludePath(boolean includeUser) {
String baseDir = getPath(PATH_MANAGER.getContext( String baseDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
TEXT_PRODUCTS); TEXT_PRODUCTS);
String configDir = getPath(PATH_MANAGER.getContext( String configDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.CONFIGURED), LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED),
TEXT_PRODUCTS); TEXT_PRODUCTS);
String siteDir = getPath(PATH_MANAGER.getContext( String siteDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
TEXT_PRODUCTS); TEXT_PRODUCTS);
if (includeUser) { if (includeUser) {
String userDir = getPath(PATH_MANAGER.getContext( String userDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER), LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
TEXT_PRODUCTS); TEXT_PRODUCTS);
return PyUtil.buildJepIncludePath(userDir, siteDir, configDir, return PyUtil.buildJepIncludePath(userDir, siteDir, configDir,
baseDir); baseDir);
@ -241,14 +243,14 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
public static String getSmartToolsIncludePath(boolean includeUser) { public static String getSmartToolsIncludePath(boolean includeUser) {
String baseDir = getPath(PATH_MANAGER.getContext( String baseDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
SMART_TOOLS); SMART_TOOLS);
String siteDir = getPath(PATH_MANAGER.getContext( String siteDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
SMART_TOOLS); SMART_TOOLS);
if (includeUser) { if (includeUser) {
String userDir = getPath(PATH_MANAGER.getContext( String userDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER), LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
SMART_TOOLS); SMART_TOOLS);
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir); return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
} else { } else {
@ -262,14 +264,14 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
public static String getUtilitiesIncludePath(boolean includeUser) { public static String getUtilitiesIncludePath(boolean includeUser) {
String baseDir = getPath(PATH_MANAGER.getContext( String baseDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
UTILITIES); UTILITIES);
String siteDir = getPath(PATH_MANAGER.getContext( String siteDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
UTILITIES); UTILITIES);
if (includeUser) { if (includeUser) {
String userDir = getPath(PATH_MANAGER.getContext( String userDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER), LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
UTILITIES); UTILITIES);
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir); return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
} else { } else {
@ -299,12 +301,12 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
public static String getConfigIncludePath(boolean includeUser) { public static String getConfigIncludePath(boolean includeUser) {
String baseDir = getPath(PATH_MANAGER.getContext( String baseDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), CONFIG); LocalizationType.COMMON_STATIC, LocalizationLevel.BASE), CONFIG);
String siteDir = getPath(PATH_MANAGER.getContext( String siteDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), CONFIG); LocalizationType.COMMON_STATIC, LocalizationLevel.SITE), CONFIG);
if (includeUser) { if (includeUser) {
String userDir = getPath(PATH_MANAGER.getContext( String userDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER), LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
CONFIG); CONFIG);
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir); return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
} else { } else {
@ -328,7 +330,7 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
} }
public static String getTextProductsTemplatesIncludePath() { public static String getTextProductsTemplatesIncludePath() {
return getPath(PATH_MANAGER.getContext(LocalizationType.CAVE_STATIC, return getPath(PATH_MANAGER.getContext(LocalizationType.COMMON_STATIC,
LocalizationLevel.BASE), TEXT_PRODUCTS); LocalizationLevel.BASE), TEXT_PRODUCTS);
} }
@ -338,14 +340,14 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
public static String getCombinationsIncludePath(boolean includeUser) { public static String getCombinationsIncludePath(boolean includeUser) {
String configDir = getPath(PATH_MANAGER.getContext( String configDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.CONFIGURED), LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED),
COMBINATIONS); COMBINATIONS);
String siteDir = getPath(PATH_MANAGER.getContext( String siteDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
COMBINATIONS); COMBINATIONS);
if (includeUser) { if (includeUser) {
String userDir = getPath(PATH_MANAGER.getContext( String userDir = getPath(PATH_MANAGER.getContext(
LocalizationType.CAVE_STATIC, LocalizationLevel.USER), LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
COMBINATIONS); COMBINATIONS);
return PyUtil.buildJepIncludePath(userDir, siteDir, configDir); return PyUtil.buildJepIncludePath(userDir, siteDir, configDir);
} else { } else {

View file

@ -31,7 +31,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* *
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Aug 4, 2011 bphillip Initial creation * Aug 04, 2011 bphillip Initial creation
* Mar 20, 2013 1447 dgilling Add support for service backup
* troubleshooting mode from A1.
* *
* </pre> * </pre>
* *
@ -48,13 +50,18 @@ public class ImportConfRequest extends AbstractGfeRequest {
@DynamicSerializeElement @DynamicSerializeElement
private String failedSite; private String failedSite;
@DynamicSerializeElement
private boolean trMode;
public ImportConfRequest() { public ImportConfRequest() {
} }
public ImportConfRequest(String primarySite, String failedSite) { public ImportConfRequest(String primarySite, String failedSite,
boolean trMode) {
this.primarySite = primarySite; this.primarySite = primarySite;
this.failedSite = failedSite; this.failedSite = failedSite;
this.trMode = trMode;
} }
/** /**
@ -87,4 +94,12 @@ public class ImportConfRequest extends AbstractGfeRequest {
this.failedSite = failedSite; this.failedSite = failedSite;
} }
public void setTrMode(boolean trMode) {
this.trMode = trMode;
}
public boolean isTrMode() {
return trMode;
}
} }

View file

@ -41,6 +41,7 @@ import com.raytheon.uf.edex.dissemination.transmitted.TransmittedProductList;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 13, 2009 njensen Initial creation * Nov 13, 2009 njensen Initial creation
* 08/20/2012 DR 15340 D. Friedman Fix BBB problems * 08/20/2012 DR 15340 D. Friedman Fix BBB problems
* 03/08/2013 15564 mgamazaychikov Trimmed extra spaces in afosId
* *
* </pre> * </pre>
* *
@ -71,7 +72,7 @@ public class ModifyProduct {
List<AfosToAwips> list = dao.lookupAfosId(ttaaii, cccc).getIdList(); List<AfosToAwips> list = dao.lookupAfosId(ttaaii, cccc).getIdList();
String productId = null; String productId = null;
for (AfosToAwips ata : list) { for (AfosToAwips ata : list) {
String afosId = ata.getAfosid(); String afosId = ata.getAfosid().trim();
String awipsId = afosId.substring(3); String awipsId = afosId.substring(3);
if (awipsId.equals(productAwipsId)) { if (awipsId.equals(productAwipsId)) {
productId = afosId; productId = afosId;

View file

@ -71,7 +71,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* Dec 3, 2010 rjpeter Initial creation * Dec 3, 2010 rjpeter 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 07, 2013 1587 bsteffen rewrite static data generation. * Mar 07, 2013 1587 bsteffen rewrite static data generation.
* Mar 14, 2013 1587 bsteffen Fix persisting to datastore.
* *
* </pre> * </pre>
* *
@ -269,7 +268,7 @@ public class StaticDataGenerator {
for (GridRecord staticRecord : datastoreRecords) { for (GridRecord staticRecord : datastoreRecords) {
populateMessageData(staticRecord); populateMessageData(staticRecord);
} }
dao.persistToHDF5(datastoreRecords.toArray(new PluginDataObject[0])); dao.persistToHDF5(databaseRecords.toArray(new PluginDataObject[0]));
} }
if (!databaseRecords.isEmpty()) { if (!databaseRecords.isEmpty()) {
dao.persistToDatabase(databaseRecords dao.persistToDatabase(databaseRecords
@ -425,8 +424,7 @@ public class StaticDataGenerator {
datasets = Collections.emptyList(); datasets = Collections.emptyList();
} }
} }
if (!datasets.contains(staticRecord.getParameter() if (datasets.contains(missing)) {
.getAbbreviation())) {
missing.add(staticRecord); missing.add(staticRecord);
} }
} }

View file

@ -44,7 +44,7 @@
<doTry> <doTry>
<pipeline> <pipeline>
<bean ref="stringToFile" /> <bean ref="stringToFile" />
<bean ref="radarDecompressor" method="decompressToFile" /> <bean ref="radarDecompressor" method="decompressWithHeader" />
<bean ref="dpaDecodeSrv" method="process"/> <bean ref="dpaDecodeSrv" method="process"/>
<!-- Uncomment when dpaDecodeSrv route properly handles only its own files <!-- Uncomment when dpaDecodeSrv route properly handles only its own files
<bean ref="processUtil" method="log"/> <bean ref="processUtil" method="log"/>

View file

@ -31,7 +31,7 @@
<pipeline> <pipeline>
<bean ref="setIngestHeaderFields"/> <bean ref="setIngestHeaderFields"/>
<bean ref="stringToFile" /> <bean ref="stringToFile" />
<bean ref="radarDecompressor" method="decompressToFile" /> <bean ref="radarDecompressor" method="decompressWithHeader" />
<bean ref="dhrDecodeSrv" method="filter" /> <bean ref="dhrDecodeSrv" method="filter" />
</pipeline> </pipeline>
<doCatch> <doCatch>

View file

@ -20,10 +20,8 @@
package com.raytheon.uf.edex.ohd.pproc; package com.raytheon.uf.edex.ohd.pproc;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
@ -35,6 +33,7 @@ import java.util.regex.Pattern;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers;
import com.raytheon.uf.common.ohd.AppsDefaults; import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.edex.core.EdexException; import com.raytheon.uf.edex.core.EdexException;
@ -50,6 +49,9 @@ import com.raytheon.uf.edex.ohd.MainMethod;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Nov 14, 2008 bphillip Initial creation * Nov 14, 2008 bphillip Initial creation
* Mar 20, 2013 1804 bsteffen Switch all radar decompressing to be in
* memory.
*
* </pre> * </pre>
* *
* @author bphillip * @author bphillip
@ -71,9 +73,10 @@ public class DecodeDpaSrv {
private CoreDao dao; private CoreDao dao;
public Object process(File file) throws EdexException { public Object process(byte[] message, Headers headers) throws EdexException {
boolean proc = false; boolean proc = false;
proc = checkFile(file); File ingestFile = new File(headers.get("ingestfilename").toString());
proc = checkFile(message, ingestFile.getName());
if (proc == false) { if (proc == false) {
return null; return null;
} }
@ -110,30 +113,8 @@ public class DecodeDpaSrv {
* @throws EdexException * @throws EdexException
* If IOExceptions occur * If IOExceptions occur
*/ */
private boolean checkFile(File dpaFile) throws EdexException { private boolean checkFile(byte[] fileContents, String fileName)
throws EdexException {
/*
* Read the contents of the file into memory.
*/
BufferedInputStream inStream = null;
try {
inStream = new BufferedInputStream(new FileInputStream(dpaFile));
} catch (FileNotFoundException e) {
throw new EdexException("Cannot find file: " + dpaFile, e);
}
byte[] fileContents = new byte[(int) dpaFile.length()];
try {
inStream.read(fileContents);
} catch (IOException e) {
throw new EdexException("Error reading file: " + dpaFile, e);
} finally {
try {
inStream.close();
} catch (IOException e1) {
throw new EdexException("Error closing stream to file: "
+ dpaFile, e1);
}
}
/* /*
* Copy off the first few bytes to see if leading bytes are present * Copy off the first few bytes to see if leading bytes are present
@ -174,8 +155,7 @@ public class DecodeDpaSrv {
if (offset != 0) { if (offset != 0) {
BufferedOutputStream outStream = null; BufferedOutputStream outStream = null;
try { try {
outFile = new File(FileUtil.join(outPath, outFile = new File(FileUtil.join(outPath, fileName));
dpaFile.getName()));
outStream = new BufferedOutputStream( outStream = new BufferedOutputStream(
new FileOutputStream(outFile)); new FileOutputStream(outFile));
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
@ -187,7 +167,7 @@ public class DecodeDpaSrv {
outStream.write(fileContents, offset, outStream.write(fileContents, offset,
fileContents.length - offset); fileContents.length - offset);
logger.info("Re-writing contents of file: " logger.info("Re-writing contents of file: "
+ dpaFile + " to " + outFile); + fileName + " to " + outFile);
} catch (IOException e) { } catch (IOException e) {
throw new EdexException( throw new EdexException(
"Error writing updated contents of DPA file: " "Error writing updated contents of DPA file: "
@ -209,18 +189,18 @@ public class DecodeDpaSrv {
return false; return false;
} }
} else { } else {
String radarid = dpaFile.getName().substring(1, 4).toUpperCase(); String radarid = fileName.substring(1, 4).toUpperCase();
String query = String String query = String
.format("select * from radarloc where radid='%s' and use_radar='T' ", .format("select * from radarloc where radid='%s' and use_radar='T' ",
radarid); radarid);
dao = new CoreDao(DaoConfig.forDatabase("ihfs")); dao = new CoreDao(DaoConfig.forDatabase("ihfs"));
Object[] rs = dao.executeSQLQuery(query); Object[] rs = dao.executeSQLQuery(query);
if (rs.length > 0) { if (rs.length > 0) {
outFile = new File(FileUtil.join(outPath, dpaFile.getName())); outFile = new File(FileUtil.join(outPath, fileName));
logger.info("No header found for file: " + outFile logger.info("No header found for file: " + outFile
+ " decoding with filename."); + " decoding with filename.");
try { try {
FileUtil.copyFile(dpaFile, outFile); FileUtil.bytes2File(fileContents, outFile);
} catch (IOException e) { } catch (IOException e) {
throw new EdexException( throw new EdexException(
"Error copying file to destination directory: " "Error copying file to destination directory: "

View file

@ -20,16 +20,15 @@
package com.raytheon.uf.edex.ohd.pproc; package com.raytheon.uf.edex.ohd.pproc;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.raytheon.edex.esb.Headers;
import com.raytheon.uf.common.ohd.AppsDefaults; import com.raytheon.uf.common.ohd.AppsDefaults;
import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
@ -53,6 +52,9 @@ import com.raytheon.uf.edex.ohd.MainMethod;
* Jan 20, 2010 4200 snaples Initial creation * Jan 20, 2010 4200 snaples Initial creation
* Mar 09, 2012 417 dgilling Refactor to use two-stage queue * Mar 09, 2012 417 dgilling Refactor to use two-stage queue
* process. * process.
* Mar 20, 2013 1804 bsteffen Switch all radar decompressing to be in
* memory.
*
* </pre> * </pre>
* *
* @author snaples * @author snaples
@ -174,23 +176,15 @@ public class HPEDhrSrv {
* @param hpeFile * @param hpeFile
* The radar file to check. * The radar file to check.
*/ */
public void filter(File hpeFile) { public void filter(byte[] fileContents, Headers headers) {
// logger.info("Starting HPE Check message."); // logger.info("Starting HPE Check message.");
byte[] fileContents = new byte[0];
try {
fileContents = readHpeFile(hpeFile);
} catch (FileNotFoundException e) {
logger.handle(Priority.PROBLEM,
"HPE Cannot find file: " + hpeFile.toString(), e);
} catch (IOException e) {
logger.handle(Priority.PROBLEM, "HPE Error reading file: "
+ hpeFile.toString(), e);
}
if (fileContents.length < 80) { if (fileContents.length < 80) {
return; return;
} }
File hpeFile = new File(headers.get("ingestfilename").toString());
// check header // check header
String fileStartStr = new String(fileContents, 0, 80); String fileStartStr = new String(fileContents, 0, 80);
// array will hold radar id, dtype, and dt information. using array so // array will hold radar id, dtype, and dt information. using array so
@ -218,36 +212,6 @@ public class HPEDhrSrv {
// logger.info("Finished HPE CheckFile. "); // logger.info("Finished HPE CheckFile. ");
} }
/**
* Reads the given radar file to memory for later processing by the
* <code>filter</code> function.
*
* @param hpeFile
* The file to read.
* @return The contents of the file.
* @throws FileNotFoundException
* If the specified file does not exist or cannot be opened.
* @throws IOException
* If an I/O error occurs while reading the file.
*/
private byte[] readHpeFile(File hpeFile) throws FileNotFoundException,
IOException {
BufferedInputStream inStream = null;
byte[] fileContents = null;
try {
inStream = new BufferedInputStream(new FileInputStream(hpeFile));
fileContents = new byte[(int) hpeFile.length()];
inStream.read(fileContents);
} finally {
if (inStream != null) {
inStream.close();
}
}
return fileContents;
}
/** /**
* Takes the given parameters and constructs a <code>HPEDhrMessage</code> to * Takes the given parameters and constructs a <code>HPEDhrMessage</code> to
* be placed onto the queue used by <code>HPEDhrSrv</code> for actual data * be placed onto the queue used by <code>HPEDhrSrv</code> for actual data

View file

@ -16,7 +16,11 @@ Require-Bundle: com.raytheon.uf.edex.cpgsrv;bundle-version="1.11.7";resolution:=
com.raytheon.uf.common.dataplugin.ffmp;bundle-version="1.12.1174", com.raytheon.uf.common.dataplugin.ffmp;bundle-version="1.12.1174",
com.raytheon.edex.plugin.radar;bundle-version="1.12.1174", com.raytheon.edex.plugin.radar;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0", com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
com.raytheon.uf.common.cache;bundle-version="1.12.1174" com.raytheon.uf.common.cache;bundle-version="1.12.1174",
com.raytheon.uf.common.status;bundle-version="1.12.1174",
com.raytheon.uf.common.event;bundle-version="1.0.0",
com.raytheon.uf.edex.event;bundle-version="1.0.0",
com.raytheon.uf.common.stats;bundle-version="1.0.0"
Import-Package: com.raytheon.uf.common.dataplugin.grid, Import-Package: com.raytheon.uf.common.dataplugin.grid,
com.raytheon.uf.common.ohd, com.raytheon.uf.common.ohd,
com.raytheon.uf.common.status, com.raytheon.uf.common.status,

View file

@ -8,8 +8,8 @@
<bean id="ffmpThreadPool" <bean id="ffmpThreadPool"
class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor"> class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="1" /> <property name="corePoolSize" value="2" />
<property name="maxPoolSize" value="1" /> <property name="maxPoolSize" value="4" />
<property name="keepAliveSeconds" value="60000" /> <property name="keepAliveSeconds" value="60000" />
</bean> </bean>

View file

@ -58,6 +58,7 @@ import com.raytheon.uf.common.datastorage.StorageProperties;
import com.raytheon.uf.common.datastorage.StorageProperties.Compression; import com.raytheon.uf.common.datastorage.StorageProperties.Compression;
import com.raytheon.uf.common.datastorage.records.ByteDataRecord; import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.event.EventBus;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -82,6 +83,7 @@ import com.raytheon.uf.common.monitor.xml.SourceIngestConfigXML;
import com.raytheon.uf.common.monitor.xml.SourceXML; import com.raytheon.uf.common.monitor.xml.SourceXML;
import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.stats.ProcessEvent;
import com.raytheon.uf.common.status.IUFStatusHandler; 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;
@ -120,7 +122,7 @@ import com.raytheon.uf.edex.plugin.ffmp.common.FFTIRatioDiff;
* 02/20/13 1635 D. Hladky Added some finally methods to increase dead lock safety. Reduced wait times for threads. * 02/20/13 1635 D. Hladky Added some finally methods to increase dead lock safety. Reduced wait times for threads.
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin * Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
* 02/25/13 1660 D. Hladky Redesigned data flow for FFTI in order to have only one mosaic piece in memory at a time. * 02/25/13 1660 D. Hladky Redesigned data flow for FFTI in order to have only one mosaic piece in memory at a time.
* 03/13/13 1478 D. Hladky non-FFTI mosaic containers weren't getting ejected. Made it so that they are ejected after processing as well. * 03/22/13 1803 D. Hladky Fixed broken performance logging for ffmp.
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -703,51 +705,40 @@ public class FFMPGenerator extends CompositeProductGenerator implements
fftiSources.add(ffmp.getFFTISource()); fftiSources.add(ffmp.getFFTISource());
ffti.processFFTI(); ffti.processFFTI();
} }
// Do the accumulation now, more memory efficient. // Do the accumulation now, more memory efficient.
// Only one piece in memory at a time // Only one piece in memory at a time
for (String attribute : ffmp.getAttributes()) { for (String attribute : ffmp.getAttributes()) {
if (attribute.equals(ATTRIBUTE.ACCUM if (attribute.equals(ATTRIBUTE.ACCUM
.getAttribute())) { .getAttribute())) {
FFTIAccum accum = getAccumulationForSite( FFTIAccum accum = getAccumulationForSite(
ffmpProduct.getDisplayName(), ffmpProduct.getDisplayName(),
siteKey, dataKey, siteKey, dataKey,
fftiSource.getDurationHour(), fftiSource.getDurationHour(),
ffmpProduct.getUnit(siteKey)); ffmpProduct.getUnit(siteKey));
if (statusHandler if (statusHandler
.isPriorityEnabled(Priority.DEBUG)) { .isPriorityEnabled(Priority.DEBUG)) {
statusHandler statusHandler
.debug("Accumulating FFTI for source: " .debug("Accumulating FFTI for source: "
+ ffmpProduct + ffmpProduct
.getDisplayName() .getDisplayName()
+ " site: " + " site: "
+ siteKey + siteKey
+ " data: " + " data: "
+ dataKey + dataKey
+ " duration: " + " duration: "
+ fftiSource + fftiSource
.getDurationHour() .getDurationHour()
+ " accumulation: " + " accumulation: "
+ accum.getAccumulation()); + accum.getAccumulation());
} }
} }
} }
} }
} // record not null
SourceXML source = getSourceConfig().getSource( } // end sitekey for loop
ffmpRec.getSourceName()); } // end datakey loop
} // end process
if (!source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
String sourceSiteDataKey = getSourceSiteDataKey(source,
dataKey, ffmpRec);
ffmpData.remove(sourceSiteDataKey);
statusHandler.info("Removing from memory: "+sourceSiteDataKey);
}
}
}
}
}
} }
/** /**
@ -1829,7 +1820,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements
} }
ffmpData.remove(siteDataKey); ffmpData.remove(siteDataKey);
statusHandler.info("Removing from memory: "+siteDataKey);
accumulator.setReset(false); accumulator.setReset(false);
writeFFTIData(siteDataKey, accumulator); writeFFTIData(siteDataKey, accumulator);
} }
@ -1980,7 +1970,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements
// replace or insert it // replace or insert it
ffmpData.remove(qpeSiteSourceDataKey); ffmpData.remove(qpeSiteSourceDataKey);
statusHandler.info("Removing from memory: "+qpeSiteSourceDataKey);
values.setReset(false); values.setReset(false);
writeFFTIData(siteDataKey, values); writeFFTIData(siteDataKey, values);
} }
@ -2019,30 +2008,39 @@ public class FFMPGenerator extends CompositeProductGenerator implements
/** /**
* Find siteSourceDataKey * Log process statistics
* *
* @param source * @param message
* @param dataKey
* @param ffmpRec
* @return
*/ */
private String getSourceSiteDataKey(SourceXML source, String dataKey, FFMPRecord ffmpRec) { @Override
public void log(URIGenerateMessage message) {
String sourceName = source.getSourceName();
String sourceSiteDataKey = null; long curTime = System.currentTimeMillis();
ProcessEvent processEvent = new ProcessEvent();
if (source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) { if (productType != null) {
sourceName = source.getDisplayName(); processEvent.setDataType(productType);
sourceSiteDataKey = sourceName; }
} else { Long dequeueTime = message.getDeQueuedTime();
sourceName = ffmpRec.getSourceName(); if (dequeueTime != null) {
sourceSiteDataKey = sourceName + "-" + ffmpRec.getSiteKey() long elapsedMilliseconds = curTime - dequeueTime;
+ "-" + dataKey; processEvent.setProcessingTime(elapsedMilliseconds);
}
Long enqueueTime = message.getEnQueuedTime();
if (enqueueTime != null) {
long latencyMilliseconds = curTime - enqueueTime;
processEvent.setProcessingLatency(latencyMilliseconds);
}
// processing in less than 0 millis isn't trackable, usually due to
// an
// error occurred and statement logged incorrectly
if ((processEvent.getProcessingLatency() > 0)
&& (processEvent.getProcessingTime() > 0)) {
EventBus.publish(processEvent);
} }
return sourceSiteDataKey;
} }
} }

View file

@ -66,7 +66,6 @@ import com.raytheon.uf.edex.database.plugin.PluginDao;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation * 4/7/09 1994 bphillip Initial Creation
* Mar 14, 2013 1587 bsteffen Fix static data persisting to datastore.
* *
* </pre> * </pre>
* *
@ -100,13 +99,10 @@ public class GridDao extends PluginDao {
long[] sizes = new long[] { location.getNx(), location.getNy() }; long[] sizes = new long[] { location.getNx(), location.getNy() };
String abbrev = gridRec.getParameter().getAbbreviation(); String abbrev = gridRec.getParameter().getAbbreviation();
String group = gridRec.getDataURI(); String group = gridRec.getDataURI();
String datasetName = "Data";
if (GridPathProvider.STATIC_PARAMETERS.contains(abbrev)) { if (GridPathProvider.STATIC_PARAMETERS.contains(abbrev)) {
group = "/" + location.getId(); group = "/" + location.getId();
datasetName = abbrev;
} }
AbstractStorageRecord storageRecord = new FloatDataRecord( AbstractStorageRecord storageRecord = new FloatDataRecord("Data",
datasetName,
group, (float[]) messageData, 2, sizes); group, (float[]) messageData, 2, sizes);
storageRecord.setCorrelationObject(gridRec); storageRecord.setCorrelationObject(gridRec);

View file

@ -64,6 +64,7 @@ log_msg 30
# Copies the localization information to the staging area # Copies the localization information to the staging area
log_msg Copying common site configuration for site ${CAPS_SITE} to temporary directory... log_msg Copying common site configuration for site ${CAPS_SITE} to temporary directory...
cp -r ${LOCALIZATION_PATH}/common_static/site/${CAPS_SITE}/gfe $commonDest/site cp -r ${LOCALIZATION_PATH}/common_static/site/${CAPS_SITE}/gfe $commonDest/site
cp -r ${LOCALIZATION_PATH}/common_static/site/${CAPS_SITE}/vtec $commonDest/site
log_msg 40 log_msg 40
log_msg Copying edex site configuration for site ${CAPS_SITE} to temporary directory... log_msg Copying edex site configuration for site ${CAPS_SITE} to temporary directory...

View file

@ -49,6 +49,7 @@ then
then then
log_msg You cannot import configuration data for your own site. log_msg You cannot import configuration data for your own site.
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
touch ${LOCK_DIR}/svcbuerr touch ${LOCK_DIR}/svcbuerr
log_msg 100 log_msg 100
exit 1 exit 1
@ -66,6 +67,7 @@ then
else else
log_msg "Unable to locate ${import_file}. Service backup exits now" log_msg "Unable to locate ${import_file}. Service backup exits now"
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
touch ${LOCK_DIR}/svcbuerr touch ${LOCK_DIR}/svcbuerr
log_msg 100 log_msg 100
exit 1 exit 1
@ -79,6 +81,7 @@ gunzip -c GFEconfig.${SITE}.tar.gz | tar xf -
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
log_msg -e "\nERROR: Could not explode GFEconfig.${SITE_CAPS}.tar.gz..." log_msg -e "\nERROR: Could not explode GFEconfig.${SITE_CAPS}.tar.gz..."
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
touch ${LOCK_DIR}/svcbuerr touch ${LOCK_DIR}/svcbuerr
log_msg 100 log_msg 100
exit 1 exit 1
@ -90,6 +93,7 @@ if [ -d GFEconfig ]; then
else else
log_msg "Incorrectly formatted configuration received. Cannot continue!" log_msg "Incorrectly formatted configuration received. Cannot continue!"
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
touch ${LOCK_DIR}/svcbuerr touch ${LOCK_DIR}/svcbuerr
log_msg 100 log_msg 100
exit 1 exit 1
@ -152,6 +156,19 @@ fi
log_msg 95 log_msg 95
#
# DR21404 - disable ISC/VTEC for troubleshooting mode
#
if [ -f ${LOCK_DIR}/trMode ]; then
log_msg "Activating troubleshooting mode..."
rm -f ${LOCALIZATION_PATH}/common_static/site/${SITE_CAPS}/vtec/localVTECPartners.py*
echo "serverConfig.REQUEST_ISC = 0" >> ${LOCALIZATION_PATH}/edex_static/site/${SITE_CAPS}/config/gfe/localConfig.py
echo "serverConfig.SEND_ISC_ON_SAVE = 0" >> ${LOCALIZATION_PATH}/edex_static/site/${SITE_CAPS}/config/gfe/localConfig.py
echo "serverConfig.SEND_ISC_ON_PUBLISH = 0" >> ${LOCALIZATION_PATH}/edex_static/site/${SITE_CAPS}/config/gfe/localConfig.py
fi
log_msg "Updating siteConfig.py..."
#Change the MHS ID of the received configuration #Change the MHS ID of the received configuration
backup_config=${LOCALIZATION_PATH}/edex_static/site/${my_site_caps}/config/gfe/siteConfig.py backup_config=${LOCALIZATION_PATH}/edex_static/site/${my_site_caps}/config/gfe/siteConfig.py
failed_config=${LOCALIZATION_PATH}/edex_static/site/${SITE_CAPS}/config/gfe/siteConfig.py failed_config=${LOCALIZATION_PATH}/edex_static/site/${SITE_CAPS}/config/gfe/siteConfig.py
@ -170,6 +187,7 @@ cd ${SVCBU_HOME}
rm -rf * rm -rf *
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
log_msg 100 log_msg 100
touch ${LOCK_DIR}/${SITE}svcbuMode touch ${LOCK_DIR}/${SITE}svcbuMode
log_msg "Configuration Import Complete!" log_msg "Configuration Import Complete!"

View file

@ -21,6 +21,7 @@ then
log_msg Lock file not present for importing configuration! Cannot continue! log_msg Lock file not present for importing configuration! Cannot continue!
touch ${LOCK_DIR}/svcbuerr touch ${LOCK_DIR}/svcbuerr
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
log_msg 100 log_msg 100
exit 1 exit 1
fi fi
@ -36,6 +37,7 @@ else
log_msg "Script must be run as user root or awips" log_msg "Script must be run as user root or awips"
touch ${LOCK_DIR}/svcbuerr touch ${LOCK_DIR}/svcbuerr
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
log_msg 100 log_msg 100
exit 1 exit 1
fi fi
@ -46,6 +48,7 @@ if [ $exitValue -ne 0 ]; then
log_msg "Receive configuration returned with errors..." log_msg "Receive configuration returned with errors..."
touch ${LOCK_DIR}/svcbuerr touch ${LOCK_DIR}/svcbuerr
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
log_msg 100 log_msg 100
exit 1 exit 1
fi fi

View file

@ -7,10 +7,11 @@ fi
# $1 = Primary site # $1 = Primary site
# $2 = Failed site # $2 = Failed site
# $3 = enable/disable troubleshooting mode
if [ $# -ne 2 ] if [ $# -ne 3 ]
then then
log_msg "Incorrect number of arguments\nCorrect usage: request_configuration primary_site failed_site" log_msg "Incorrect number of arguments\nCorrect usage: request_configuration primary_site failed_site trMode"
exit 1 exit 1
fi fi
@ -32,6 +33,10 @@ then
fi fi
touch ${LOCK_DIR}/importConfiguration touch ${LOCK_DIR}/importConfiguration
if [ $3 -eq 1 ]; then
touch ${LOCK_DIR}/trMode
log_msg "You are in troubleshooting mode - no ISC/VTEC will be available"
fi
log_msg Contacting central server to get configuration for ${2} log_msg Contacting central server to get configuration for ${2}
log_msg 0 log_msg 0
@ -42,6 +47,7 @@ if [ -n "${SVCBU_WMO_HEADER}" ]; then
if [ $exitValue -ne 0 ]; then if [ $exitValue -ne 0 ]; then
log_msg "msg_send failed while requesting configuration for ${CAPS_SITE}`date`" log_msg "msg_send failed while requesting configuration for ${CAPS_SITE}`date`"
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
log_msg "msg_send FAILED with exit value $exitValue and the following error: $msgSendOutput" log_msg "msg_send FAILED with exit value $exitValue and the following error: $msgSendOutput"
exit 1 exit 1
fi fi
@ -51,6 +57,7 @@ else
if [ $exitValue -ne 0 ]; then if [ $exitValue -ne 0 ]; then
log_msg "msg_send failed while requesting configuration for ${2}`date`" log_msg "msg_send failed while requesting configuration for ${2}`date`"
rm -f ${LOCK_DIR}/importConfiguration rm -f ${LOCK_DIR}/importConfiguration
rm -f ${LOCK_DIR}/trMode
log_msg "msg_send FAILED with exit value $exitValue and the following error: $msgSendOutput" log_msg "msg_send FAILED with exit value $exitValue and the following error: $msgSendOutput"
exit 1 exit 1
fi fi

View file

@ -191,8 +191,8 @@ public class Wes2BridgeManager {
/* Disable JMX. */ /* Disable JMX. */
private void updateEdexWrapper(String srcEdexDirectory, String edexDirectory) private void updateEdexWrapper(String srcEdexDirectory, String edexDirectory)
throws FileNotFoundException, IOException { throws FileNotFoundException, IOException {
String srcwrapper_conf = srcEdexDirectory + "/bin/wrapper.conf"; String srcwrapper_conf = srcEdexDirectory + "/conf/wrapper.conf";
String wrapper_conf = edexDirectory + "/bin/wrapper.conf"; String wrapper_conf = edexDirectory + "/conf/wrapper.conf";
BufferedReader br = this.getBufferedReader(srcwrapper_conf); BufferedReader br = this.getBufferedReader(srcwrapper_conf);
BufferedWriter bw = this.getBufferedWriter(wrapper_conf); BufferedWriter bw = this.getBufferedWriter(wrapper_conf);
@ -269,7 +269,7 @@ public class Wes2BridgeManager {
final String line1 = "EDEX_INSTALL="; final String line1 = "EDEX_INSTALL=";
final String line2 = "export DATA_ARCHIVE_ROOT="; final String line2 = "export DATA_ARCHIVE_ROOT=";
final String line3 = "CAMELPROCESS=`ps -ef | grep \"edex.dev.mode\"|grep -c \"edex.run.mode=${1} \" `"; final String line3 = "CAMELPROCESS=`ps -ef | grep \"aw.site.identifier\"|grep -c \"edex.run.mode=${1} \" `";
String line = StringUtils.EMPTY; String line = StringUtils.EMPTY;
while ((line = br.readLine()) != null) { while ((line = br.readLine()) != null) {

View file

@ -29,6 +29,7 @@
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 4/7/09 1994 bphillip Initial Creation * 4/7/09 1994 bphillip Initial Creation
* Mar 25, 2013 1821 bsteffen Make grib2 decoding more multithreaded
* *
* </pre> * </pre>
* *
@ -138,7 +139,9 @@ static PyObject * grib2_getData(PyObject *self, PyObject* args)
long numfields; long numfields;
npy_intp dimSize[1]; npy_intp dimSize[1];
PyObject *response = PyDict_New(); PyObject *response = PyDict_New();
Py_BEGIN_ALLOW_THREADS
numfields = getRecord(fptr, &gfld, recordNumber, fieldNumber, 1); numfields = getRecord(fptr, &gfld, recordNumber, fieldNumber, 1);
Py_END_ALLOW_THREADS
PyObject * numberOfFields = PyInt_FromLong(numfields); PyObject * numberOfFields = PyInt_FromLong(numfields);
PyDict_SetItemString(response, "numFields", numberOfFields); PyDict_SetItemString(response, "numFields", numberOfFields);