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
[formerlyb0621d90bc
[formerlyfd71e44f0f
] [formerlya23cecdb26
[formerly d0ce26b91945ae5388028c312cbafd314d57c0e6]]] Former-commit-id:b0621d90bc
[formerlyfd71e44f0f
] Former-commit-id:b0621d90bc
Former-commit-id:e154e58354
This commit is contained in:
commit
11825ee814
69 changed files with 2241 additions and 2026 deletions
|
@ -60,9 +60,6 @@
|
|||
# Status: TEST
|
||||
# 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 Avn, AvnLib, Globals, MonitorP
|
||||
|
@ -71,10 +68,10 @@ import CCFPData
|
|||
_Logger = logging.getLogger(__name__)
|
||||
|
||||
_Code = { \
|
||||
'tops': {1: '400+ ', 2: '350-390', 3: '300-340', 4: '250-290'}, \
|
||||
'gwth': {1: '+ ', 2: 'NC', 3: '- '}, \
|
||||
'tops': {1: '370+ ', 2: '310-370', 3: '250-310'}, \
|
||||
'gwth': {1: '++', 2: '+ ', 3: 'NC', 4: '- '}, \
|
||||
'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):
|
||||
# 6 hour forecast
|
||||
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)]
|
||||
fcst, text = {}, []
|
||||
try:
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
menuText="Convective SIGMET" id="ConvSigmet">
|
||||
<dataURI>/convsigmet/%</dataURI>
|
||||
</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="titleItem" titleText="------ Icing Products ------" />
|
||||
|
|
|
@ -36,6 +36,8 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 17, 2011 mschenke Initial creation
|
||||
* Mar 21, 2013 1806 bsteffen Add ColorMapData constructor that
|
||||
* creates buffer from the dataType.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -45,6 +47,40 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
|
||||
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
|
||||
* ColorMapData from wherever it lives. ColorMapData objects should not be
|
||||
|
|
|
@ -116,7 +116,9 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* 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.
|
||||
* 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>
|
||||
*
|
||||
* @author lvenable
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -255,8 +257,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
private FFMPTableDataLoader dataRetrieveThread = null;
|
||||
|
||||
private boolean groupLabelFlag = true;
|
||||
|
||||
private String rowName="";// DR 13228
|
||||
|
||||
private String rowName = "";// DR 13228
|
||||
|
||||
/**
|
||||
* Statistics load event.
|
||||
*/
|
||||
|
@ -1084,7 +1087,8 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
|
||||
// Loop over enum from config singleton to create menu items
|
||||
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
|
||||
MenuItem mi = new MenuItem(popupMenu, SWT.NONE);
|
||||
mi.setText(colName.name());
|
||||
|
@ -1304,7 +1308,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
}
|
||||
|
||||
private void displayAttributesDlg() {
|
||||
if (attributeDlg == null) {
|
||||
if (attributeDlg == null || attributeDlg.isDisposed()) {
|
||||
attrData = ffmpTable.getVisibleColumns();
|
||||
attributeDlg = new AttributesDlg(shell, resource, attrData, this);
|
||||
}
|
||||
|
@ -1770,7 +1774,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
|| allOnlySmallBasinsMI.getSelection()) {
|
||||
groupLbl.setText(name);
|
||||
}
|
||||
rowName=name;// DR 13228
|
||||
rowName = name;// DR 13228
|
||||
shell.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
|
||||
fireScreenRecenterEvent(pfaf, 1);
|
||||
}
|
||||
|
@ -2089,7 +2093,6 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
|
||||
public void updateLoadingLabel(FFMPLoaderStatus status) {
|
||||
this.loadStatus = status;
|
||||
|
||||
if (dataLoadComp == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -2192,7 +2195,7 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
|
||||
if (!this.isDisposed()) {
|
||||
|
||||
VizApp.runAsync(new Runnable() {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
processUpdate(fupdateData);
|
||||
|
@ -2243,9 +2246,9 @@ public class FfmpBasinTableDlg extends CaveSWTDialog implements
|
|||
groupLbl.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// DR 13228
|
||||
public String getRowName(){
|
||||
return this.rowName;
|
||||
public String getRowName() {
|
||||
return this.rowName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.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;
|
||||
|
||||
|
@ -50,24 +65,34 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
|
|||
|
||||
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 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,
|
||||
String attrName, ITrendGraphUpdate updateCallback,
|
||||
IRequestTrendGraphData requestDataCallback, String[] identArray,
|
||||
Integer vcp)
|
||||
{
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK | CAVE.INDEPENDENT_SHELL);
|
||||
Integer vcp) {
|
||||
super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK
|
||||
| CAVE.INDEPENDENT_SHELL);
|
||||
setText(scanTable.name() + " Trend Graph");
|
||||
|
||||
this.scanTable = scanTable;
|
||||
|
@ -76,7 +101,7 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
|
|||
this.updateCallback = updateCallback;
|
||||
this.requestDataCallback = requestDataCallback;
|
||||
this.identArray = identArray;
|
||||
this.vcp=vcp;
|
||||
this.vcp = vcp;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -92,7 +117,7 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
|
|||
protected void initializeComponents(Shell shell) {
|
||||
trendGraphData = requestDataCallback.requestTrendGraphData(scanTable,
|
||||
attrName, ident);
|
||||
|
||||
|
||||
createTopControls();
|
||||
createGraphCanvas();
|
||||
}
|
||||
|
@ -135,8 +160,8 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
|
|||
|
||||
private void createGraphCanvas() {
|
||||
trendGraphCanvas = new TrendGraphCanvas(shell, trendGraphData,
|
||||
requestDataCallback.getCurrentDate(), scanTable,
|
||||
attrName,vcp,requestDataCallback,ident);
|
||||
requestDataCallback.getCurrentDate(), scanTable, attrName, vcp,
|
||||
requestDataCallback, ident);
|
||||
}
|
||||
|
||||
private void populateIdentCombo() {
|
||||
|
@ -165,8 +190,8 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
|
|||
|
||||
trendGraphData = requestDataCallback.requestTrendGraphData(scanTable,
|
||||
attrName, ident);
|
||||
trendGraphCanvas.updateAttribute(attrName, trendGraphData, requestDataCallback
|
||||
.getCurrentDate());
|
||||
trendGraphCanvas.updateAttribute(attrName, trendGraphData,
|
||||
requestDataCallback.getCurrentDate());
|
||||
trendGraphCanvas.setIndent(ident);
|
||||
}
|
||||
|
||||
|
@ -177,31 +202,33 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
|
|||
|
||||
trendGraphData = requestDataCallback.requestTrendGraphData(scanTable,
|
||||
attrName, ident);
|
||||
trendGraphCanvas.updateAttribute(attrName, trendGraphData, requestDataCallback
|
||||
.getCurrentDate());
|
||||
trendGraphCanvas.updateAttribute(attrName, trendGraphData,
|
||||
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
|
||||
*/
|
||||
public boolean updateTrendGraph()
|
||||
{
|
||||
public boolean updateTrendGraph() {
|
||||
trendGraphData = requestDataCallback.requestTrendGraphData(scanTable,
|
||||
attrName, ident);
|
||||
trendGraphCanvas.updateAttribute(attrName, trendGraphData, requestDataCallback
|
||||
.getCurrentDate());
|
||||
|
||||
trendGraphCanvas.updateAttribute(attrName, trendGraphData,
|
||||
requestDataCallback.getCurrentDate());
|
||||
|
||||
if (requestDataCallback.cellValid(this.ident) == false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void redrawTrendGraph()
|
||||
{
|
||||
trendGraphCanvas.redrawCanvas();
|
||||
|
||||
/**
|
||||
* Redraw the graphs with updated data.
|
||||
*/
|
||||
public void redrawTrendGraph() {
|
||||
updateTrendGraph();
|
||||
}
|
||||
|
||||
public void displayDialog() {
|
||||
|
@ -211,24 +238,12 @@ public class TrendGraphDlg extends CaveSWTDialog //implements ICommonDialogActio
|
|||
public boolean dialogIsDisposed() {
|
||||
return shell.isDisposed();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Overriding the dispose method to notify that the trend graph is closing.
|
||||
*/
|
||||
@Override
|
||||
protected void disposed()
|
||||
{
|
||||
protected void disposed() {
|
||||
this.updateCallback.trendGraphClosing(this);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void closeDialog() {
|
||||
// this.updateCallback.trendGraphClosing(this);
|
||||
// shell.dispose();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isDisposed() {
|
||||
// return shell.isDisposed();
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -40,11 +40,25 @@ import com.raytheon.uf.common.monitor.scan.config.TrendSetConfigMgr;
|
|||
import com.raytheon.uf.viz.monitor.scan.TrendGraphData;
|
||||
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;
|
||||
|
||||
|
@ -56,15 +70,15 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
|
|||
|
||||
private TrendSetConfigMgr trendCfgMgr;
|
||||
|
||||
private ITrendSetsGraphUpdate updateCallback;
|
||||
private final ITrendSetsGraphUpdate updateCallback;
|
||||
|
||||
private IRequestTrendGraphData requestDataCallback;
|
||||
private final IRequestTrendGraphData requestDataCallback;
|
||||
|
||||
// private LinkedHashMap<Date, Double> dataMap;
|
||||
|
||||
private LinkedHashMap<String, TrendGraphData> trendSetData;
|
||||
|
||||
private String[] identArray;
|
||||
private final String[] identArray;
|
||||
|
||||
private String[] attrArray;
|
||||
|
||||
|
@ -72,14 +86,27 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
|
|||
|
||||
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,
|
||||
String ident, String trendSetName,
|
||||
ITrendSetsGraphUpdate updateCallback,
|
||||
IRequestTrendGraphData requestDataCallback, String[] identArray,
|
||||
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");
|
||||
|
||||
this.scanTable = scanTable;
|
||||
|
@ -153,7 +180,6 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
shell.dispose();
|
||||
// closeDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -223,11 +249,10 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
|
|||
trendSetData.clear();
|
||||
|
||||
// Loop through all of the attributes and call update and store the data
|
||||
// map for
|
||||
// each attribute
|
||||
// map for each attribute
|
||||
for (String attr : attrArray) {
|
||||
TrendGraphData tgd = requestDataCallback
|
||||
.requestTrendGraphData(scanTable, attr, ident);
|
||||
TrendGraphData tgd = requestDataCallback.requestTrendGraphData(
|
||||
scanTable, attr, ident);
|
||||
trendSetData.put(attr, tgd);
|
||||
|
||||
// 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) {
|
||||
System.out.println("Change trend set - attr = " + attr);
|
||||
|
||||
TrendGraphData tgd = requestDataCallback
|
||||
.requestTrendGraphData(scanTable, attr, ident);
|
||||
TrendGraphData tgd = requestDataCallback.requestTrendGraphData(
|
||||
scanTable, attr, ident);
|
||||
trendSetData.put(attr, tgd);
|
||||
}
|
||||
|
||||
|
@ -272,36 +297,35 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
|
|||
* @return true if item is to be disposed
|
||||
*/
|
||||
public boolean updateTrendSetsGraph() {
|
||||
trendSetData.clear();
|
||||
// Loop through all of the attributes and call update and store the data
|
||||
// map for
|
||||
// each attribute
|
||||
for (String attr : attrArray) {
|
||||
TrendGraphData tgd = requestDataCallback
|
||||
.requestTrendGraphData(scanTable, attr, ident);
|
||||
trendSetData.put(attr, tgd);
|
||||
|
||||
// Call the update call back so the table can manage this dialog.
|
||||
this.updateCallback.trendSetGraphChanged(ident, trendSetName, this);
|
||||
|
||||
// Update the canvas with the new data
|
||||
canvasMap.get(attr).updateAttribute(attr, tgd,
|
||||
requestDataCallback.getCurrentDate());
|
||||
}
|
||||
|
||||
if (requestDataCallback.cellValid(this.ident) == false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
trendSetData.clear();
|
||||
// Loop through all of the attributes and call update and store the data
|
||||
// map for
|
||||
// each attribute
|
||||
for (String attr : attrArray) {
|
||||
TrendGraphData tgd = requestDataCallback.requestTrendGraphData(
|
||||
scanTable, attr, ident);
|
||||
trendSetData.put(attr, tgd);
|
||||
|
||||
// Call the update call back so the table can manage this dialog.
|
||||
this.updateCallback.trendSetGraphChanged(ident, trendSetName, this);
|
||||
|
||||
// Update the canvas with the new data
|
||||
canvasMap.get(attr).updateAttribute(attr, tgd,
|
||||
requestDataCallback.getCurrentDate());
|
||||
}
|
||||
|
||||
if (requestDataCallback.cellValid(this.ident) == false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redraw the graphs with updated data.
|
||||
*/
|
||||
public void redrawTrendGraph() {
|
||||
for (String key : canvasMap.keySet()) {
|
||||
if (canvasMap.get(key) != null) {
|
||||
canvasMap.get(key).redrawCanvas();
|
||||
}
|
||||
}
|
||||
updateTrendSetsGraph();
|
||||
}
|
||||
|
||||
public void displayDialog() {
|
||||
|
@ -319,15 +343,4 @@ public class TrendSetsGraphDlg extends CaveSWTDialog // implements
|
|||
protected void disposed() {
|
||||
this.updateCallback.trendSetGraphClosing(this);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void closeDialog() {
|
||||
// this.updateCallback.trendSetGraphClosing(this);
|
||||
// shell.dispose();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean isDisposed() {
|
||||
// return shell.isDisposed();
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
package com.raytheon.viz.core.gl.dataformat;
|
||||
|
||||
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
|
||||
|
@ -32,6 +33,8 @@ import com.raytheon.uf.common.colormap.image.ColorMapData;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 21, 2011 mschenke Initial creation
|
||||
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
|
||||
* format for offscreen textures.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -43,8 +46,13 @@ public class GLColorMapDataFormatFactory {
|
|||
|
||||
public static AbstractGLColorMapDataFormat getGLColorMapDataFormat(
|
||||
ColorMapData colorMapData) {
|
||||
return getGLColorMapDataFormat(colorMapData.getDataType());
|
||||
}
|
||||
|
||||
public static AbstractGLColorMapDataFormat getGLColorMapDataFormat(
|
||||
ColorMapDataType colorMapDataType) {
|
||||
AbstractGLColorMapDataFormat dataFormat = null;
|
||||
switch (colorMapData.getDataType()) {
|
||||
switch (colorMapDataType) {
|
||||
case BYTE: {
|
||||
dataFormat = new GLByteDataFormat();
|
||||
break;
|
||||
|
|
|
@ -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.IView;
|
||||
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.drawables.IImage;
|
||||
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.dataformat.AbstractGLColorMapDataFormat;
|
||||
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.images.AbstractGLImage;
|
||||
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
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 10, 2012 bsteffen Initial creation
|
||||
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
|
||||
* format for offscreen textures.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -175,51 +179,37 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension<IGLTarget>
|
|||
}
|
||||
|
||||
public GLColormappedImage constructOffscreenImage(
|
||||
Class<? extends Buffer> dataType, int[] dimensions)
|
||||
throws VizException {
|
||||
ColorMapDataType dataType, int[] dimensions) throws VizException {
|
||||
return constructOffscreenImage(dataType, dimensions, null);
|
||||
}
|
||||
|
||||
public GLColormappedImage constructOffscreenImage(
|
||||
Class<? extends Buffer> dataType, final int[] dimensions,
|
||||
final ColorMapDataType dataType, final int[] dimensions,
|
||||
ColorMapParameters parameters) throws VizException {
|
||||
int width = dimensions[0];
|
||||
int height = dimensions[1];
|
||||
// Need to add support for multiple buffer types
|
||||
Buffer imageBuffer = null;
|
||||
if (dataType.isAssignableFrom(ByteBuffer.class)) {
|
||||
int pixels = 3;
|
||||
if (supportsLuminance) {
|
||||
pixels = 1;
|
||||
}
|
||||
byte[] buf = new byte[width * height * pixels];
|
||||
imageBuffer = ByteBuffer.wrap(buf);
|
||||
}
|
||||
GLColormappedImageExtension cmapExt = target
|
||||
.getExtension(GLColormappedImageExtension.class);
|
||||
if (!supportsLuminance) {
|
||||
return cmapExt.initializeRaster(new NoLuminanceDataCallback(
|
||||
dimensions, dataType), parameters);
|
||||
} else {
|
||||
GLColormappedImage image = cmapExt.initializeRaster(
|
||||
new IColorMapDataRetrievalCallback() {
|
||||
|
||||
if (imageBuffer != null) {
|
||||
GLColormappedImage image = null;
|
||||
final Buffer buffer = imageBuffer;
|
||||
GLColormappedImageExtension cmapExt = target
|
||||
.getExtension(GLColormappedImageExtension.class);
|
||||
if (supportsLuminance) {
|
||||
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);
|
||||
}
|
||||
@Override
|
||||
public ColorMapData getColorMapData()
|
||||
throws VizException {
|
||||
return new ColorMapData(dataType, dimensions);
|
||||
}
|
||||
}, parameters);
|
||||
if (!checkedLuminance) {
|
||||
checkedLuminance = true;
|
||||
try {
|
||||
renderOffscreen(image);
|
||||
} 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
|
||||
supportsLuminance = false;
|
||||
// Reconstruct image
|
||||
|
@ -230,84 +220,76 @@ public class GLOffscreenRenderingExtension extends GraphicsExtension<IGLTarget>
|
|||
}
|
||||
}
|
||||
return image;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class GLOffscreenDataCallback implements
|
||||
IColorMapDataRetrievalCallback, IGLColorMapDataFormatProvider {
|
||||
private static final class NoLuminanceDataFormat extends GLByteDataFormat {
|
||||
|
||||
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 GLOffscreenDataCallback(Buffer dataBuffer, int[] dimensions) {
|
||||
this.dataBuffer = dataBuffer;
|
||||
private final ColorMapDataType originalType;
|
||||
|
||||
private NoLuminanceDataCallback(int[] dimensions,
|
||||
ColorMapDataType type) {
|
||||
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
|
||||
public AbstractGLColorMapDataFormat getGLColorMapDataFormat(
|
||||
ColorMapData colorMapData) {
|
||||
return new GLByteDataFormat() {
|
||||
|
||||
/*
|
||||
* (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;
|
||||
}
|
||||
|
||||
};
|
||||
return new NoLuminanceDataFormat(originalType);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.data.IColorMapDataRetrievalCallback#
|
||||
* getColorMapData()
|
||||
*/
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import javax.media.opengl.glu.GLU;
|
|||
|
||||
import com.raytheon.uf.common.colormap.image.ColorMapData;
|
||||
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.viz.core.gl.GLContextBridge;
|
||||
import com.raytheon.viz.core.gl.dataformat.GLColorMapData;
|
||||
|
@ -49,6 +50,8 @@ import com.raytheon.viz.core.gl.objects.GLTextureObject;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 2, 2011 bsteffen Initial creation
|
||||
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
|
||||
* format for offscreen textures.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -271,4 +274,8 @@ public class GLCMTextureData implements IImageCacheable {
|
|||
return 0;
|
||||
}
|
||||
|
||||
public ColorMapDataType getColorMapDataType() {
|
||||
return data.getDataType();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import javax.media.opengl.GL;
|
|||
|
||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||
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.ext.IImagingExtension;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -39,6 +40,8 @@ import com.sun.opengl.util.texture.TextureCoords;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 27, 2009 mschenke Initial creation
|
||||
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
|
||||
* format for offscreen textures.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -109,6 +112,10 @@ public class GLColormappedImage extends AbstractGLImage implements
|
|||
return data.getTextureType();
|
||||
}
|
||||
|
||||
public ColorMapDataType getColorMapDataType() {
|
||||
return data.getColorMapDataType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the texture's format
|
||||
*
|
||||
|
|
|
@ -38,6 +38,8 @@ import com.raytheon.viz.core.gl.images.GLDelegateImage;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 16, 2011 mschenke Initial creation
|
||||
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
|
||||
* format for offscreen textures.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -165,4 +167,9 @@ public class GLMosaicImage extends GLDelegateImage<GLColormappedImage>
|
|||
return image.getValue(x, y);
|
||||
}
|
||||
|
||||
public void setWrappedImage(GLColormappedImage wrappedImage) {
|
||||
this.image.dispose();
|
||||
this.image = wrappedImage;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,15 +19,15 @@
|
|||
**/
|
||||
package com.raytheon.viz.core.gl.internal.ext.mosaic;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
import javax.media.opengl.GL;
|
||||
|
||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||
import com.raytheon.uf.viz.core.DrawableImage;
|
||||
import com.raytheon.uf.viz.core.IExtent;
|
||||
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.Status;
|
||||
import com.raytheon.uf.viz.core.drawables.ImagingSupport;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
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.GLShaderProgram;
|
||||
import com.raytheon.viz.core.gl.images.AbstractGLImage;
|
||||
import com.raytheon.viz.core.gl.images.GLColormappedImage;
|
||||
|
||||
/**
|
||||
* Extension used for rendering radar mosaic images
|
||||
|
@ -47,6 +48,8 @@ import com.raytheon.viz.core.gl.images.AbstractGLImage;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 16, 2011 mschenke Initial creation
|
||||
* Mar 21, 2013 1806 bsteffen Update GL mosaicing to use dynamic data
|
||||
* format for offscreen textures.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,13 +60,14 @@ import com.raytheon.viz.core.gl.images.AbstractGLImage;
|
|||
public class GLMosaicImageExtension extends AbstractGLSLImagingExtension
|
||||
implements IMosaicImageExtension {
|
||||
|
||||
private AbstractGLImage writeToImage;
|
||||
private GLColormappedImage writeToImage;
|
||||
|
||||
public GLMosaicImage initializeRaster(int[] imageBounds,
|
||||
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(
|
||||
GLOffscreenRenderingExtension.class).constructOffscreenImage(
|
||||
ByteBuffer.class, imageBounds, params), imageBounds,
|
||||
ColorMapDataType.BYTE, imageBounds, params), imageBounds,
|
||||
imageExtent, this.getClass());
|
||||
}
|
||||
|
||||
|
@ -93,7 +97,7 @@ public class GLMosaicImageExtension extends AbstractGLSLImagingExtension
|
|||
if (image instanceof GLMosaicImage) {
|
||||
GLMosaicImage mosaicImage = (GLMosaicImage) image;
|
||||
if (mosaicImage.isRepaint()) {
|
||||
writeToImage = mosaicImage.getWrappedImage();
|
||||
writeToImage = getWriteToImage(mosaicImage);
|
||||
GLOffscreenRenderingExtension extension = target
|
||||
.getExtension(GLOffscreenRenderingExtension.class);
|
||||
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)
|
||||
*
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
**/
|
||||
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.ui.personalities.awips.AbstractCAVEComponent;
|
||||
|
||||
|
@ -36,6 +33,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 12, 2011 bphillip Initial creation
|
||||
* 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>
|
||||
*
|
||||
|
@ -54,8 +53,7 @@ public class ServiceBackupComponent extends AbstractCAVEComponent {
|
|||
*/
|
||||
@Override
|
||||
protected void startInternal(String componentName) throws Exception {
|
||||
ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(new Shell(
|
||||
Display.getCurrent()));
|
||||
ServiceBackupDlg svcBuDlg = new ServiceBackupDlg(null);
|
||||
svcBuDlg.setBlockOnOpen(true);
|
||||
svcBuDlg.open();
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* 28May2010 2187 cjeanbap Added StdTextProductFactory
|
||||
* functionality.
|
||||
* 09 NOV 2012 1298 rferrel Changes for non-blocking dialog.
|
||||
* 08Mar2013 15564 mgamazaychikov Set the awipsWanPil based on productText data
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -387,7 +388,15 @@ public class StoreTransmitDlg extends CaveSWTDialog implements
|
|||
} else {
|
||||
req = new OUPRequest();
|
||||
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.setProductText(productText);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Shell;
|
|||
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>
|
||||
*
|
||||
|
@ -39,7 +39,9 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
|||
*
|
||||
* 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>
|
||||
*
|
||||
|
@ -54,9 +56,11 @@ public class QueryOptionsDlg extends CaveJFACEDialog {
|
|||
private boolean importGrids;
|
||||
|
||||
private boolean startGfe;
|
||||
|
||||
|
||||
private boolean trMode;
|
||||
|
||||
private Button importGridsBtn;
|
||||
|
||||
|
||||
private Button startGfeBtn;
|
||||
|
||||
/**
|
||||
|
@ -96,23 +100,37 @@ public class QueryOptionsDlg extends CaveJFACEDialog {
|
|||
if (doImCon) {
|
||||
importGridsBtn = new Button(top, SWT.CHECK);
|
||||
importGridsBtn.setText("Import Digital Forecast");
|
||||
importGridsBtn.setSelection(true);
|
||||
importGridsBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
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.setText("Start GFE");
|
||||
startGfeBtn.setSelection(true);
|
||||
startGfeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
startGfe = startGfeBtn.getSelection();
|
||||
}
|
||||
});
|
||||
startGfe = startGfeBtn.getSelection();
|
||||
|
||||
return top;
|
||||
}
|
||||
|
@ -124,4 +142,8 @@ public class QueryOptionsDlg extends CaveJFACEDialog {
|
|||
public boolean startGFE() {
|
||||
return this.startGfe;
|
||||
}
|
||||
|
||||
public boolean trMode() {
|
||||
return this.trMode;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.viz.gfe.dialogs.sbu;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
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.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.program.Program;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
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.UFStatus;
|
||||
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.VizApp;
|
||||
import com.raytheon.uf.viz.core.auth.UserController;
|
||||
|
@ -87,10 +86,12 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 4, 2011 randerso Initial creation
|
||||
* Sep 19,2011 10955 rferrel Use RunProcess
|
||||
* Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog.
|
||||
* Nov 15,2012 15614 jdynina Added check for national center
|
||||
* Aug 04, 2011 randerso Initial creation
|
||||
* Sep 19, 2011 10955 rferrel Use RunProcess
|
||||
* Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog.
|
||||
* 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>
|
||||
*
|
||||
|
@ -156,7 +157,7 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
|
|||
private Job updateJob;
|
||||
|
||||
private boolean authorized;
|
||||
|
||||
|
||||
private boolean nationalCenter;
|
||||
|
||||
private SVCBU_OP currentOperation = SVCBU_OP.no_backup;
|
||||
|
@ -342,15 +343,11 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
|
|||
helpItem.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
try {
|
||||
// DR#10955
|
||||
RunProcess
|
||||
.getRunProcess()
|
||||
.exec("/usr/bin/firefox http://"
|
||||
+ getServiceBackupServer()
|
||||
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_help.html");
|
||||
} catch (IOException e1) {
|
||||
statusHandler.error("Unable to open Help page!", e1);
|
||||
final String url = "http://"
|
||||
+ getServiceBackupServer()
|
||||
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_help.html";
|
||||
if (!Program.launch(url)) {
|
||||
statusHandler.error("Unable to open Help page: " + url);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -360,15 +357,12 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
|
|||
instructionsItem.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
try {
|
||||
// DR#10955
|
||||
RunProcess
|
||||
.getRunProcess()
|
||||
.exec("/usr/bin/firefox http://"
|
||||
+ getServiceBackupServer()
|
||||
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_instructions.html");
|
||||
} catch (IOException e1) {
|
||||
statusHandler.error("Unable to open Help page!", e1);
|
||||
final String url = "http://"
|
||||
+ getServiceBackupServer()
|
||||
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_instructions.html";
|
||||
if (!Program.launch(url)) {
|
||||
statusHandler.error("Unable to open Instructions page: "
|
||||
+ url);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -378,15 +372,11 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
|
|||
faqItem.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
try {
|
||||
// DR#10955
|
||||
RunProcess
|
||||
.getRunProcess()
|
||||
.exec("/usr/bin/firefox http://"
|
||||
+ getServiceBackupServer()
|
||||
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_faq.html");
|
||||
} catch (IOException e1) {
|
||||
statusHandler.error("Unable to open Help page!", e1);
|
||||
final String url = "http://"
|
||||
+ getServiceBackupServer()
|
||||
+ ":8080/uEngineWeb/GfeServiceBackup/help/svcbu_faq.html";
|
||||
if (!Program.launch(url)) {
|
||||
statusHandler.error("Unable to open FAQ page: " + url);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -493,7 +483,7 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
|
|||
jobManager.addJob(new SvcbuDeactivateSiteJob(failedSite,
|
||||
this.site));
|
||||
jobManager.addJob(new SvcbuImportConfJob(site, failedSite,
|
||||
progress));
|
||||
false, progress));
|
||||
jobManager.addJob(new SvcbuActivateSiteJob(failedSite,
|
||||
this.site));
|
||||
jobManager.addJob(new SvcbuStartGfeJob(failedSite, this.site));
|
||||
|
@ -544,11 +534,12 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
|
|||
if (dlg.open() == Window.OK) {
|
||||
boolean importGrids = dlg.importGrids();
|
||||
boolean startGFE = dlg.startGFE();
|
||||
boolean trMode = dlg.trMode();
|
||||
String failedSite = getFailedSite();
|
||||
jobManager.addJob(new SvcbuDeactivateSiteJob(failedSite,
|
||||
this.site));
|
||||
jobManager.addJob(new SvcbuImportConfJob(site, failedSite,
|
||||
progress));
|
||||
trMode, progress));
|
||||
jobManager.addJob(new SvcbuActivateSiteJob(failedSite,
|
||||
this.site));
|
||||
if (importGrids) {
|
||||
|
@ -1191,8 +1182,8 @@ public class ServiceBackupDlg extends CaveJFACEDialog {
|
|||
doExGrids.setEnabled(true);
|
||||
doExGrids.setText("Export " + this.site
|
||||
+ "'s Digital Forecast to the Central Server");
|
||||
updateBanner("YOU ARE NOT IN BACKUP MODE", getShell().getParent()
|
||||
.getFont(), black, gray);
|
||||
updateBanner("YOU ARE NOT IN BACKUP MODE", getShell().getFont(),
|
||||
black, gray);
|
||||
currentOperation = SVCBU_OP.no_backup;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,9 @@ import com.raytheon.viz.gfe.dialogs.sbu.ServiceBackupDlg;
|
|||
*
|
||||
* 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>
|
||||
*
|
||||
|
@ -62,6 +64,8 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements
|
|||
|
||||
private String failedSite;
|
||||
|
||||
private boolean trMode;
|
||||
|
||||
private ProgressDlg progress;
|
||||
|
||||
private boolean complete;
|
||||
|
@ -70,21 +74,19 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements
|
|||
|
||||
private String errorMsg;
|
||||
|
||||
/**
|
||||
* @param name
|
||||
*/
|
||||
public SvcbuImportConfJob(String primarySite, String failedSite,
|
||||
ProgressDlg progress) {
|
||||
boolean trMode, ProgressDlg progress) {
|
||||
super("Import Configuration: " + failedSite, primarySite);
|
||||
this.failedSite = failedSite;
|
||||
this.progress = progress;
|
||||
this.trMode = trMode;
|
||||
NotificationManagerJob.addObserver(ServiceBackupDlg.NOTIFY_TOPIC, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ImportConfRequest request = new ImportConfRequest(primarySite,
|
||||
failedSite);
|
||||
failedSite, trMode);
|
||||
try {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
||||
|
@ -158,7 +160,7 @@ public class SvcbuImportConfJob extends ServiceBackupJob implements
|
|||
+ failedSite, e);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"SERVICE BACKUP: "+e.getLocalizedMessage());
|
||||
"SERVICE BACKUP: " + e.getLocalizedMessage());
|
||||
} finally {
|
||||
NotificationManagerJob.removeObserver(
|
||||
ServiceBackupDlg.NOTIFY_TOPIC, this);
|
||||
|
|
|
@ -52,6 +52,7 @@ import com.raytheon.viz.gfe.core.DataManager;
|
|||
* Nov 5, 2008 njensen Initial creation
|
||||
* Jan 8, 2013 1486 dgilling Support changes to BaseGfePyController.
|
||||
* 02/12/2013 #1597 randerso Added logging to support GFE Performance metrics
|
||||
* Mar 7, 2013 15717 jzeng Change CAVE_STATIC to COMMON_STATIC
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -76,7 +77,7 @@ public class ProcedureController extends BaseGfePyController {
|
|||
super(filePath, anIncludePath, classLoader, dataManager, "Procedure");
|
||||
|
||||
LocalizationContext baseCtx = PathManagerFactory.getPathManager()
|
||||
.getContext(LocalizationType.CAVE_STATIC,
|
||||
.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.BASE);
|
||||
|
||||
proceduresDir = GfePyIncludeUtil.getProceduresLF(baseCtx);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -392,7 +392,6 @@ public class MPEDisplayManager {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private final Set<IEditTimeChangedListener> timeChangedListeners = new LinkedHashSet<IEditTimeChangedListener>();
|
||||
|
||||
private final Set<IDisplayFieldChangedListener> fieldChangedListeners = new LinkedHashSet<IDisplayFieldChangedListener>();
|
||||
|
@ -707,7 +706,6 @@ public class MPEDisplayManager {
|
|||
// Remove old resource
|
||||
list.removeRsc(displayedFieldResource);
|
||||
}
|
||||
|
||||
fieldResourceData.setFieldData(fieldToDisplay);
|
||||
fieldResourceData.setArealDisplay(arealDisplay);
|
||||
fieldResourceData.setAccumulationInterval(accumulationHrs);
|
||||
|
@ -725,7 +723,6 @@ public class MPEDisplayManager {
|
|||
listener.displayFieldChanged(oldField, fieldToDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
// reset gages
|
||||
List<MPEGageResource> rscs = display.getDescriptor()
|
||||
.getResourceList()
|
||||
|
|
|
@ -109,6 +109,8 @@ public class MPEGageResource extends AbstractMPEInputResource implements
|
|||
|
||||
private static final double POINT_RADIUS = 2;
|
||||
|
||||
private static final RGB WHITE = new RGB(255, 255, 255);
|
||||
|
||||
private final SimpleDateFormat sdf;
|
||||
|
||||
private final Object mutex = new Object();
|
||||
|
@ -361,7 +363,10 @@ public class MPEGageResource extends AbstractMPEInputResource implements
|
|||
for (Coordinate point : dataMap.keySet()) {
|
||||
if (extent.contains(new double[] { point.x, point.y })) {
|
||||
MPEGageData gageData = dataMap.get(point);
|
||||
RGB gageColor = getGageColor(gageData);
|
||||
RGB gageColor = WHITE;
|
||||
if (displayIsEdit) {
|
||||
gageColor = getGageColor(gageData);
|
||||
}
|
||||
|
||||
boolean isReportedMissing = gageData.isReported_missing();
|
||||
boolean isMissing = ((gageData.getGval() == -999.f || gageData
|
||||
|
|
|
@ -297,6 +297,7 @@ public class RegenHrFlds {
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/* Clear gage edits */
|
||||
MPEDataManager.getInstance().clearEditGages();
|
||||
shell.setCursor(null);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 25, 2012 #15425 Qinglu Lin Updated createClosestPoint().
|
||||
* 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>
|
||||
*
|
||||
|
@ -115,9 +117,10 @@ public class DbAreaSourceDataAdaptor extends AbstractDbSourceDataAdaptor {
|
|||
List<String> partOfArea = getPartOfArea(ptFields, attributes,
|
||||
ptRslt.geometry);
|
||||
int gid = getGid(ptFields, attributes);
|
||||
|
||||
return new ClosestPoint(name, point, population, warngenlev,
|
||||
ClosestPoint cp = new ClosestPoint(name, point, population, warngenlev,
|
||||
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) {
|
||||
List<String> partOfArea = null;
|
||||
|
||||
boolean userDirections = Boolean.valueOf(String.valueOf(attributes
|
||||
.get(useDirectionField)));
|
||||
String userDir = String.valueOf(attributes.get(useDirectionField))
|
||||
.toLowerCase();
|
||||
boolean userDirections = Boolean.valueOf(userDir)
|
||||
|| userDir.equals("t") || userDir.equals("1");
|
||||
if (userDirections) {
|
||||
PreparedGeometry prepGeom = PreparedGeometryFactory.prepare(geom);
|
||||
if (prepGeom.intersects(searchArea) && !prepGeom.within(searchArea)) {
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
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().
|
||||
* Oct 17, 2012 jsanchez Added setter methods.
|
||||
* Feb 12, 2013 1600 jsanchez Removed adjustAngle method.
|
||||
* Mar 25, 2013 1605 jsanchez Added prepGeom if an urban bound area.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -77,6 +79,8 @@ public class ClosestPoint implements Comparable<ClosestPoint> {
|
|||
|
||||
protected int gid;
|
||||
|
||||
protected PreparedGeometry prepGeom;
|
||||
|
||||
public ClosestPoint() {
|
||||
|
||||
}
|
||||
|
@ -248,6 +252,10 @@ public class ClosestPoint implements Comparable<ClosestPoint> {
|
|||
this.gid = gid;
|
||||
}
|
||||
|
||||
public void setPrepGeom(PreparedGeometry prepGeom) {
|
||||
this.prepGeom = prepGeom;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
|
@ -105,6 +105,7 @@ import com.vividsolutions.jts.geom.Point;
|
|||
* Jan 31, 2013 1557 jsanchez Used allowDuplicates flag to collect points with duplicate names.
|
||||
* 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 25, 2013 1605 jsanchez Checks if a storm location is over an urban bound area.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -722,6 +723,11 @@ public class Wx {
|
|||
latLonToLocal);
|
||||
|
||||
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 (allowDuplicates) {
|
||||
// collect all points that are within the threshold
|
||||
|
|
|
@ -53,7 +53,6 @@ import com.raytheon.viz.warngen.gis.AffectedAreas;
|
|||
* moved the following methods from InitialLockingBehavior to this class:
|
||||
* bulletIndices(), header(), firstBullet(), secondBullet(), getImmediateCausesPtrn();
|
||||
* updated body(), header(), and secondBullet();
|
||||
* Mar 13, 2013 DR 15892 D. Friedman Fix bullet parsing.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -142,13 +141,10 @@ abstract public class AbstractLockingBehavior implements ICommonPatterns {
|
|||
private Integer[] bulletIndices() {
|
||||
List<Integer> bulletIndices = new ArrayList<Integer>();
|
||||
|
||||
/* Assumes first line cannot be a bullet and that the '*' is
|
||||
* at the start of a line.
|
||||
*/
|
||||
int index = text.indexOf("\n* ");
|
||||
int index = text.indexOf("* ");
|
||||
while (index >= 0) {
|
||||
bulletIndices.add(index + 1);
|
||||
index = text.indexOf("\n* ", index + 3);
|
||||
bulletIndices.add(index);
|
||||
index = text.indexOf("* ", index + 2);
|
||||
}
|
||||
|
||||
return bulletIndices.toArray(new Integer[bulletIndices.size()]);
|
||||
|
|
|
@ -39,8 +39,6 @@ import com.raytheon.viz.warngen.gis.AffectedAreas;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 24, 2012 15322 jsanchez Initial creation
|
||||
* Jan 8, 2013 15664 Qinglu Lin Updated body().
|
||||
* Mar 13, 2013 15892 D. Friedman Fix headline locking. Do not
|
||||
* lock "AND" or "FOR".
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -53,8 +51,10 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
|
|||
*/
|
||||
@Override
|
||||
public void body() {
|
||||
headlines();
|
||||
super.body();
|
||||
if (action != WarningAction.COR)
|
||||
headlines();
|
||||
else
|
||||
super.body();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,7 +66,7 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
|
|||
// should be blank.
|
||||
Pattern headlinePtrn = Pattern
|
||||
.compile(
|
||||
"^\\.\\.\\.(AN?|THE) (.*) (WARNING|ADVISORY) .*(REMAINS|EXPIRE|CANCELLED).*(\\.\\.\\.)$",
|
||||
"^\\.\\.\\.(A|THE) (.*) (WARNING|ADVISORY) .*(REMAINS|EXPIRE|CANCELLED).*(\\.\\.\\.)$",
|
||||
Pattern.MULTILINE);
|
||||
Matcher m = headlinePtrn.matcher(text);
|
||||
|
||||
|
@ -187,8 +187,16 @@ public class FollowUpLockingBehavior extends AbstractLockingBehavior {
|
|||
+ LOCK_START + "..." + LOCK_END;
|
||||
}
|
||||
// Locks warning type (i.e. SEVERE THUNDERSTORM)
|
||||
headline = headline.replaceAll("(AN?|THE)( [\\w\\s]*?)(" + warningType + ")",
|
||||
LOCK_START + "$1" + LOCK_END + "$2" + LOCK_START + "$3" + LOCK_END);
|
||||
headline = headline.replaceAll("(A|THE) (" + warningType + ")",
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ import java.util.regex.Pattern;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 24, 2012 15332 jsanchez Initial creation
|
||||
* Oct 18, 2012 15332 jsanchez Replaced listOfAreaNamesPtrn with String pattern.
|
||||
* Mar 13, 2013 DR 15892 D. Friedman Allow some punctuation in area names.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,7 +55,7 @@ public interface ICommonPatterns {
|
|||
// LOCK_END can be added at the start of the line if a previous line has
|
||||
// been locked.
|
||||
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
|
||||
// previous line should be blank.
|
||||
|
|
|
@ -346,7 +346,7 @@ public class FipsUtil {
|
|||
* @param fips
|
||||
* @return
|
||||
*/
|
||||
public static ArrayList<String> getListCounties(String fips) {
|
||||
private static ArrayList<String> getListCounties(String fips) {
|
||||
ArrayList<String> rval = new ArrayList<String>();
|
||||
String matchStr = "";
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ import com.raytheon.viz.warngen.text.ICommonPatterns;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 22, 2008 #1284 bwoodle Initial creation
|
||||
* Oct 18, 2012 15332 jsanchez Fixed refactor bugs.
|
||||
* Mar 13, 2013 DR 15892 D. Friedman Handle SMW format in canceledAreasFromText
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -44,8 +43,6 @@ public class FollowUpUtil {
|
|||
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/");
|
||||
|
||||
private static final String SMW_CANCELED_AREAS_HEADER = "THE AFFECTED AREAS WERE...";
|
||||
|
||||
/**
|
||||
* This method checks whether a particular followup should be available
|
||||
* given a Warning Record, a vtec Action, and a template configuration
|
||||
|
@ -176,8 +173,7 @@ public class FollowUpUtil {
|
|||
String headline = "";
|
||||
Pattern listOfAreaNamePtrn = Pattern
|
||||
.compile(ICommonPatterns.listOfAreaName);
|
||||
String[] splitLines = originalText.trim().split("\n");
|
||||
for (String line : splitLines) {
|
||||
for (String line : originalText.trim().split("\n")) {
|
||||
if (line.contains("TEST") || line.trim().length() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
@ -202,15 +198,8 @@ public class FollowUpUtil {
|
|||
headline += line;
|
||||
}
|
||||
}
|
||||
String[] ugcs = FipsUtil.getListCounties(ugcLine).toArray(new String[0]);
|
||||
String[] names;
|
||||
boolean smwAreas = false;
|
||||
if (namesLine.length() > 0)
|
||||
names = namesLine.split("-");
|
||||
else {
|
||||
names = parseSMWCanceledAreas(splitLines);
|
||||
smwAreas = true;
|
||||
}
|
||||
String[] ugcs = ugcLine.split("-");
|
||||
String[] names = namesLine.split("-");
|
||||
String[] areas = headline.split("\\.\\.\\.");
|
||||
|
||||
ArrayList<AffectedAreas> al = new ArrayList<AffectedAreas>();
|
||||
|
@ -233,21 +222,13 @@ public class FollowUpUtil {
|
|||
areasNotation = "COUNTIES";
|
||||
}
|
||||
}
|
||||
|
||||
if (ugc.length() < 3)
|
||||
continue; // TODO: log?
|
||||
|
||||
fips = ugc.substring(ugc.length() - 3);
|
||||
|
||||
if (i < names.length) {
|
||||
if (!smwAreas && names[i].length() >= 3) {
|
||||
name = names[i].substring(0, names[i].length() - 3);
|
||||
stateAbbreviation = names[i].substring(names[i].length() - 2);
|
||||
} else {
|
||||
name = names[i];
|
||||
}
|
||||
} else
|
||||
break;
|
||||
name = names[i].substring(0, names[i].length() - 3);
|
||||
stateAbbreviation = names[i].substring(names[i].length() - 2);
|
||||
}
|
||||
|
||||
if (name != null) {
|
||||
for (String area : areas) {
|
||||
|
@ -353,32 +334,4 @@ public class FollowUpUtil {
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
##### Qinglu Lin 08-13-2012 DR 14493. Use corToNewMarker and corEventtime.
|
||||
##### D. Friedman 11-09-2012 DR 15430. Rework included watches.
|
||||
##### 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
|
||||
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")
|
||||
<L>${area.name} ${area.areaNotation}</L> IN #areaFormat(${area.partOfParentRegion} true false) <L>${area.parentRegion}...</L>
|
||||
#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
|
||||
## COMMENTED OUT 5 LINES BELOW THIS IS GENERALLY NOT UTILIZED - you can unREMARK if desired
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
## Evan Bookbinder 4-25-2012 for OB 12.3.1 (corText)
|
||||
## QINGLU LIN 7-31-2012 DR 15217 use roundAndPad
|
||||
## 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
|
||||
|
@ -483,7 +482,10 @@ THIS IS A TEST MESSAGE.##
|
|||
THIS IS A TEST MESSAGE. DO NOT TAKE ACTION BASED ON THIS MESSAGE.
|
||||
|
||||
#end
|
||||
#printcoords(${areaPoly}, ${list})
|
||||
LAT...LON ##
|
||||
#foreach(${coord} in ${areaPoly})
|
||||
#llFormat(${coord.y}) #llFormat(${coord.x}) ##
|
||||
#end
|
||||
|
||||
TIME...MOT...LOC ##
|
||||
${dateUtil.format(${event}, ${timeFormat.time})}Z ##
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
## Evan Bookbinder 4-25-2012 for OB 12.3.1 (MND)
|
||||
## QINGLU LIN 7-31-2012 DR 15217 use roundAndPad ##
|
||||
## 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
|
||||
|
@ -121,7 +120,7 @@ THIS IS A TEST MESSAGE. ##
|
|||
#end
|
||||
#if(${windSpeed} >= 40 || ${hailSize} >= 0.70)
|
||||
...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)
|
||||
!** YOU DID NOT SELECT ANY WIND OR HAIL THREATS. PLEASE RE-GENERATE THIS ADVISORY **!
|
||||
|
|
|
@ -11,4 +11,5 @@ Require-Bundle: com.raytheon.edex.common,
|
|||
Export-Package: com.raytheon.edex.services
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.uf.edex.core,
|
||||
com.raytheon.uf.common.status,
|
||||
com.raytheon.uf.edex.database.plugin
|
||||
|
|
|
@ -25,6 +25,10 @@ import org.apache.commons.logging.LogFactory;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
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.database.plugin.PluginDao;
|
||||
import com.raytheon.uf.edex.database.plugin.PluginFactory;
|
||||
|
@ -36,10 +40,11 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* fgriffit Initial Creation.
|
||||
* 20080408 1039 jkorman Added traceId for tracing data.
|
||||
* Nov 11, 2008 chammack Refactored for Camel
|
||||
* 02/06/09 1990 bphillip Refactored to use plugin daos
|
||||
* fgriffit Initial Creation.
|
||||
* 20080408 1039 jkorman Added traceId for tracing data.
|
||||
* Nov 11, 2008 chammack Refactored for Camel
|
||||
* 02/06/09 1990 bphillip Refactored to use plugin daos
|
||||
* Mar 19, 2013 1785 bgonzale Added performance status to indexOne and index.
|
||||
* </pre>
|
||||
*
|
||||
* @author Frank Griffith
|
||||
|
@ -53,6 +58,9 @@ public class IndexSrv {
|
|||
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("DataBase:");
|
||||
|
||||
/** The default constructor */
|
||||
public IndexSrv() {
|
||||
}
|
||||
|
@ -73,9 +81,14 @@ public class IndexSrv {
|
|||
*/
|
||||
public PluginDataObject indexOne(PluginDataObject record)
|
||||
throws PluginException {
|
||||
PluginDao dao = PluginFactory.getInstance().getPluginDao(
|
||||
record.getPluginName());
|
||||
String pluginName = record.getPluginName();
|
||||
PluginDao dao = PluginFactory.getInstance().getPluginDao(pluginName);
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
timer.start();
|
||||
dao.persistToDatabase(record);
|
||||
timer.stop();
|
||||
perfLog.logDuration(pluginName + ": Saved a record: Time to Save",
|
||||
timer.getElapsedTime());
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Persisted: " + record + " to database");
|
||||
}
|
||||
|
@ -100,10 +113,16 @@ public class IndexSrv {
|
|||
}
|
||||
|
||||
try {
|
||||
PluginDao dao = PluginFactory.getInstance().getPluginDao(
|
||||
record[0].getPluginName());
|
||||
String pluginName = record[0].getPluginName();
|
||||
PluginDao dao = PluginFactory.getInstance().getPluginDao(pluginName);
|
||||
EDEXUtil.checkPersistenceTimes(record);
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
timer.start();
|
||||
PluginDataObject[] persisted = dao.persistToDatabase(record);
|
||||
timer.stop();
|
||||
perfLog.logDuration(pluginName + ": Saved " + persisted.length
|
||||
+ " record(s): Time to Save",
|
||||
timer.getElapsedTime());
|
||||
if (logger.isDebugEnabled()) {
|
||||
for (PluginDataObject rec : record) {
|
||||
logger.debug("Persisted: " + rec + " to database");
|
||||
|
|
|
@ -33,6 +33,10 @@ import com.raytheon.uf.common.datastorage.DuplicateRecordStorageException;
|
|||
import com.raytheon.uf.common.datastorage.StorageException;
|
||||
import com.raytheon.uf.common.datastorage.StorageStatus;
|
||||
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.database.plugin.PluginDao;
|
||||
import com.raytheon.uf.edex.database.plugin.PluginFactory;
|
||||
|
@ -44,9 +48,10 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
|
|||
* SOFTWARE HISTORY
|
||||
* 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
|
||||
* Nov 02, 2012 1302 djohnson Remove unused method, fix formatting.
|
||||
* Mar 19, 2013 1785 bgonzale Added performance status to persist.
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -62,6 +67,9 @@ public class PersistSrv {
|
|||
return instance;
|
||||
}
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("HDF5:");
|
||||
|
||||
private PersistSrv() {
|
||||
}
|
||||
|
||||
|
@ -75,9 +83,16 @@ public class PersistSrv {
|
|||
EDEXUtil.checkPersistenceTimes(pdo);
|
||||
|
||||
try {
|
||||
PluginDao dao = PluginFactory.getInstance().getPluginDao(
|
||||
pdo[0].getPluginName());
|
||||
String pluginName = pdo[0].getPluginName();
|
||||
PluginDao dao = PluginFactory.getInstance()
|
||||
.getPluginDao(pluginName);
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
timer.start();
|
||||
StorageStatus ss = dao.persistToHDF5(pdo);
|
||||
timer.stop();
|
||||
perfLog.logDuration(pluginName + ": Persisted " + pdo.length
|
||||
+ " record(s): Time to Persist",
|
||||
timer.getElapsedTime());
|
||||
StorageException[] se = ss.getExceptions();
|
||||
pdoList.addAll(Arrays.asList(pdo));
|
||||
if (se != null) {
|
||||
|
|
|
@ -37,6 +37,10 @@ import com.raytheon.uf.common.pointdata.PointDataDescription;
|
|||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
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.database.DataAccessLayerException;
|
||||
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.
|
||||
* 11/25/08 #1684 chammack Camel Refactor
|
||||
* 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>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -87,6 +93,9 @@ public class BufrUADecoder extends AbstractBUFRDecoder {
|
|||
|
||||
private BUFRUAAdapterFactory adapterFactory;
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("BufrUA:");
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name
|
||||
|
@ -128,7 +137,9 @@ public class BufrUADecoder extends AbstractBUFRDecoder {
|
|||
Iterator<BUFRDataDocument> iterator = document.iterator();
|
||||
|
||||
String cor = isCor(wmoHeader);
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
|
||||
timer.start();
|
||||
while (iterator.hasNext()) {
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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.util;bundle-version="1.12.1174",
|
||||
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"
|
||||
Export-Package: com.raytheon.edex.plugin.gfe,
|
||||
com.raytheon.edex.plugin.gfe.config,
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
**/
|
||||
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.uf.common.dataplugin.gfe.request.ImportConfRequest;
|
||||
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
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 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>
|
||||
*
|
||||
|
@ -49,7 +53,8 @@ public class ImportConfRequestHandler implements
|
|||
|
||||
ServerResponse<String> sr = new ServerResponse<String>();
|
||||
SvcBackupUtil.execute("request_configuration", request.getPrimarySite()
|
||||
.toLowerCase(), request.getFailedSite().toLowerCase());
|
||||
.toLowerCase(), request.getFailedSite().toLowerCase(), Integer
|
||||
.toString(BooleanUtils.toInteger(request.isTrMode())));
|
||||
return sr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,6 +129,8 @@ THINNED_GRID_VALUES = THINNED_GRID_PT_MAP.values()
|
|||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 04/7/09 #1994 bphillip Initial Creation.
|
||||
# Mar 25, 2013 1821 bsteffen Reshape grib data arrays in
|
||||
# place to improve performance.
|
||||
#
|
||||
class GribDecoder():
|
||||
|
||||
|
@ -327,7 +329,7 @@ class GribDecoder():
|
|||
if scanMode is not None:
|
||||
|
||||
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
|
||||
if scanMode & 16 == 16:
|
||||
|
@ -373,7 +375,7 @@ class GribDecoder():
|
|||
if subCoverage is not None:
|
||||
subGrid = spatialCache.getSubGrid(modelName, gridCoverage)
|
||||
# resize the data array
|
||||
numpyDataArray = numpy.resize(numpyDataArray, (ny, nx))
|
||||
numpyDataArray = numpy.reshape(numpyDataArray, (ny, nx))
|
||||
startx = subGrid.getUpperLeftX()
|
||||
starty = subGrid.getUpperLeftY()
|
||||
subnx = subGrid.getNX()
|
||||
|
@ -399,7 +401,7 @@ class GribDecoder():
|
|||
# set the new coverage
|
||||
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)
|
||||
|
||||
|
|
|
@ -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.PluginException;
|
||||
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.PerformanceStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -47,6 +51,8 @@ import com.raytheon.uf.edex.python.decoder.PythonDecoder;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 3/12/10 4758 bphillip Initial creation
|
||||
* 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>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -57,6 +63,11 @@ public class GribDecoder implements Processor {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GribDecoder.class);
|
||||
|
||||
private static final String[] DecoderNames = { "Grib1", "Grib2" };
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("");
|
||||
|
||||
/**
|
||||
* @see org.apache.camel.Processor.process(Exchange)
|
||||
*/
|
||||
|
@ -72,16 +83,22 @@ public class GribDecoder implements Processor {
|
|||
int edition = 0;
|
||||
GridRecord[] records = null;
|
||||
try {
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
String decoderName;
|
||||
|
||||
raf = new RandomAccessFile(file.getAbsolutePath(), "r");
|
||||
raf.order(RandomAccessFile.BIG_ENDIAN);
|
||||
edition = GribChecker.getEdition(raf);
|
||||
exchange.getIn().setHeader(DATA_TYPE, GRIB + edition);
|
||||
|
||||
timer.start();
|
||||
switch (edition) {
|
||||
case 1:
|
||||
decoderName = DecoderNames[0];
|
||||
records = new Grib1Decoder().decode(file.getAbsolutePath());
|
||||
break;
|
||||
case 2:
|
||||
decoderName = DecoderNames[1];
|
||||
records = decodeGrib2(file);
|
||||
break;
|
||||
default:
|
||||
|
@ -108,6 +125,9 @@ public class GribDecoder implements Processor {
|
|||
record.constructDataURI();
|
||||
}
|
||||
}
|
||||
timer.stop();
|
||||
perfLog.logDuration(decoderName + ": Time to Decode",
|
||||
timer.getElapsedTime());
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.ERROR, "Failed to decode file: ["
|
||||
+ file.getAbsolutePath() + "]", e);
|
||||
|
|
|
@ -26,17 +26,19 @@ package com.raytheon.edex.plugin.obs;
|
|||
*
|
||||
* <pre>
|
||||
*
|
||||
* OFTWARE HISTORY
|
||||
*
|
||||
* ate Ticket# Engineer Description
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* 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
|
||||
* 08/10/2007 379 jkorman Added disposal behavior.
|
||||
* 20071217 453 jkorman Added code to check for duplicate obs.
|
||||
* 20080314 995 jkorman Changed setDecoderStrategy to check for
|
||||
* 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>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -50,6 +52,10 @@ import com.raytheon.edex.exception.DecoderException;
|
|||
import com.raytheon.edex.plugin.AbstractDecoder;
|
||||
import com.raytheon.edex.plugin.obs.metar.MetarDecoder;
|
||||
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;
|
||||
|
||||
public class ObsDecoder extends AbstractDecoder {
|
||||
|
@ -58,6 +64,9 @@ public class ObsDecoder extends AbstractDecoder {
|
|||
|
||||
private final String PLUGIN_NAME;
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("Obs:");
|
||||
|
||||
private String traceId = null;
|
||||
|
||||
/**
|
||||
|
@ -84,6 +93,8 @@ public class ObsDecoder extends AbstractDecoder {
|
|||
try {
|
||||
|
||||
if (decoder != null) {
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
timer.start();
|
||||
reports = decoder.decode(data, headers);
|
||||
|
||||
if (reports != null) {
|
||||
|
@ -91,6 +102,8 @@ public class ObsDecoder extends AbstractDecoder {
|
|||
report.setTraceId(traceId);
|
||||
}
|
||||
}
|
||||
timer.stop();
|
||||
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(traceId + "- Error in ObsDecoder", e);
|
||||
|
|
|
@ -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.LocalizationContext;
|
||||
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.PerformanceStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
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.database.cluster.ClusterLockUtils;
|
||||
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 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() signature changed.
|
||||
* Mar 19, 2013 1804 bsteffen Optimize decoder performance.
|
||||
*
|
||||
* Mar 19, 2013 1785 bgonzale Added performance status handler and added status
|
||||
* to decode.
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -131,6 +136,9 @@ public class RadarDecoder extends AbstractDecoder {
|
|||
|
||||
private final String RADAR = "RADAR";
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("Radar:");
|
||||
|
||||
public RadarDecoder() throws DecoderException {
|
||||
|
||||
String dir = "";
|
||||
|
@ -170,6 +178,9 @@ public class RadarDecoder extends AbstractDecoder {
|
|||
// decode the product
|
||||
String arch = new String(messageData, 0, 4);
|
||||
try {
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
|
||||
timer.start();
|
||||
// for level2 data, this does not happen very often
|
||||
if (LEVEL_TWO_IDENTS.contains(arch)) {
|
||||
decodeLevelTwoData(messageData, recordList);
|
||||
|
@ -421,8 +432,11 @@ public class RadarDecoder extends AbstractDecoder {
|
|||
logger.error(e);
|
||||
return new PluginDataObject[0];
|
||||
}
|
||||
recordList.add(record);
|
||||
|
||||
timer.stop();
|
||||
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
|
||||
|
||||
recordList.add(record);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
theHandler.handle(Priority.ERROR, "Couldn't properly handle "
|
||||
|
|
|
@ -19,11 +19,6 @@
|
|||
**/
|
||||
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.Pattern;
|
||||
import java.util.zip.DataFormatException;
|
||||
|
@ -45,6 +40,8 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 11, 2010 mnash Initial creation
|
||||
* Jul 16, 2012 DR 14723 D.Friedman Decompress files atomically
|
||||
* Mar 20, 2013 1804 bsteffen Switch all radar decompressing to be in
|
||||
* memory.
|
||||
*
|
||||
* </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");
|
||||
|
||||
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;
|
||||
try {
|
||||
int wmoHeaderSize;
|
||||
|
@ -79,10 +94,23 @@ public class RadarDecompressor {
|
|||
|
||||
if (isCompressed(messageData, wmoHeaderSize)) {
|
||||
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];
|
||||
System.arraycopy(messageData, wmoHeaderSize, radarData, 0,
|
||||
radarData.length);
|
||||
} else {
|
||||
radarData = messageData;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
theHandler.handle(Priority.ERROR, "Failed decompression on "
|
||||
|
@ -124,106 +152,6 @@ public class RadarDecompressor {
|
|||
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) {
|
||||
int startOfRadarData = 0;
|
||||
Matcher matcher = WMO_PATTERN.matcher(headerInfo);
|
||||
|
|
|
@ -30,6 +30,10 @@ import com.raytheon.edex.plugin.redbook.dao.RedbookDao;
|
|||
import com.raytheon.edex.plugin.redbook.decoder.RedbookParser;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
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.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.
|
||||
* 20120524 #647 dgilling Update persistence time in
|
||||
* createdBackDatedVersionIfNeeded.
|
||||
* Mar 19, 2013 1785 bgonzale Added performance status handler and added
|
||||
* status to decode.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -79,13 +85,16 @@ public class RedbookDecoder extends AbstractDecoder {
|
|||
|
||||
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";
|
||||
|
||||
// Name of the plugin controlling this decoder.
|
||||
private final String PLUGIN_NAME;
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("Redbook:");
|
||||
private String traceId = null;
|
||||
|
||||
/**
|
||||
|
@ -117,6 +126,9 @@ public class RedbookDecoder extends AbstractDecoder {
|
|||
|
||||
WMOHeader wmoHeader = new WMOHeader(rawMessage, headers);
|
||||
if (wmoHeader.isValid()) {
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
timer.start();
|
||||
|
||||
int start = wmoHeader.getMessageDataStart();
|
||||
|
||||
int len = rawMessage.length - start;
|
||||
|
@ -145,6 +157,8 @@ public class RedbookDecoder extends AbstractDecoder {
|
|||
e);
|
||||
}
|
||||
}
|
||||
timer.stop();
|
||||
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
|
||||
} else {
|
||||
logger.error(traceId + "- No valid WMO header found in data.");
|
||||
}
|
||||
|
|
|
@ -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.SatelliteRecord;
|
||||
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.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.wmo.message.WMOHeader;
|
||||
|
||||
|
@ -53,15 +57,15 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
|||
*
|
||||
* <pre>
|
||||
*
|
||||
* OFTWARE HISTORY
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ----------- ---------- ----------- --------------------------
|
||||
* 006 garmenda Initial Creation
|
||||
* /14/2007 139 Phillippe Modified to follow refactored plugin pattern
|
||||
* 8/30/07 njensen Added units, commented out data that
|
||||
* is currently decoded but not used.
|
||||
* 12/01/07 555 garmendariz Modified decompress method.
|
||||
* is currently decoded but not used.
|
||||
* 12/01/07 555 garmendariz Modified decompress method.
|
||||
* 12/06/07 555 garmendariz Modifed start point to remove satellite header
|
||||
* Dec 17, 2007 600 bphillip Added dao pool usage
|
||||
* 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
|
||||
* 02/05/2010 4120 jkorman Modified removeWmoHeader to handle WMOHeader in
|
||||
* 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 --------
|
||||
* 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
|
||||
* reduce memory usage.
|
||||
* 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>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -93,6 +100,9 @@ public class SatelliteDecoder extends AbstractDecoder {
|
|||
|
||||
private static final int INITIAL_READ = GINI_HEADER_SIZE + 128;
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("Satellite:");
|
||||
|
||||
private SatelliteDao dao;
|
||||
|
||||
public PluginDataObject[] decode(File file) throws Exception {
|
||||
|
@ -105,6 +115,8 @@ public class SatelliteDecoder extends AbstractDecoder {
|
|||
return new PluginDataObject[0];
|
||||
RandomAccessFile f = new RandomAccessFile(file, "r");
|
||||
try {
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
timer.start();
|
||||
// Read in enough data to cover the WMO heading and GINI header.
|
||||
ByteBuffer byteBuffer = ByteBuffer.allocate(INITIAL_READ);
|
||||
f.getChannel().read(byteBuffer);
|
||||
|
@ -429,6 +441,8 @@ public class SatelliteDecoder extends AbstractDecoder {
|
|||
record.setMessageData(dataRec);
|
||||
}
|
||||
}
|
||||
timer.stop();
|
||||
perfLog.logDuration("Time to Decode", timer.getElapsedTime());
|
||||
} finally {
|
||||
try {
|
||||
f.close();
|
||||
|
|
|
@ -6,7 +6,6 @@ Bundle-Version: 1.12.1174.qualifier
|
|||
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: com.raytheon.edex.common,
|
||||
com.raytheon.uf.edex.pointdata,
|
||||
com.raytheon.uf.edex.decodertools;bundle-version="1.0.0",
|
||||
org.apache.commons.logging,
|
||||
org.geotools,
|
||||
|
@ -15,4 +14,8 @@ Require-Bundle: com.raytheon.edex.common,
|
|||
Export-Package: com.raytheon.edex.plugin.sfcobs.common
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
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
|
||||
|
|
|
@ -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.PluginException;
|
||||
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.time.TimeTools;
|
||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||
|
@ -66,6 +70,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
|||
* time in the future.
|
||||
* 20080215 887 jkorman Added null checks in decode.
|
||||
* 20080218 887 jkorman Reverse null checks in findDuplicate.
|
||||
* Mar 19, 2013 1785 bgonzale Added performance status handler and added status
|
||||
* to decode.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -77,6 +83,9 @@ public class SfcObsDecoder extends AbstractDecoder {
|
|||
// Name of the plugin controlling this decoder.
|
||||
public static final String PLUGIN_NAME = "sfcobs";
|
||||
|
||||
private final IPerformanceStatusHandler perfLog = PerformanceStatus
|
||||
.getHandler("SfcObs:");
|
||||
|
||||
/** The logger */
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
|
@ -124,6 +133,9 @@ public class SfcObsDecoder extends AbstractDecoder {
|
|||
SfcObsSeparator separator = SfcObsSeparator.separate(data, headers);
|
||||
List<PluginDataObject> retVal = new ArrayList<PluginDataObject>();
|
||||
HashMap<String, Boolean> obsMap = new HashMap<String, Boolean>();
|
||||
ITimer timer = TimeUtil.getTimer();
|
||||
|
||||
timer.start();
|
||||
while (separator.hasNext()) {
|
||||
SfcObsDecoderInput input = separator.next();
|
||||
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()]);
|
||||
}
|
||||
|
||||
|
|
|
@ -105,6 +105,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* 05/28/2009 2410 J. Sanchez Posted data for unknstnvalue.
|
||||
* 12/11/2009 2488 M. Duff Fixed problem with storing text products.
|
||||
* 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>
|
||||
*
|
||||
|
@ -1551,8 +1552,8 @@ public class PostShef {
|
|||
shefDataValue.setCreationDateObj(fcstHead[y].getId()
|
||||
.getBasistime());
|
||||
shefDataValue.setValue(fcstHead[y].getValue());
|
||||
}
|
||||
shefList.add(shefDataValue);
|
||||
shefList.add(shefDataValue);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Query = [" + query + "]");
|
||||
|
@ -1707,8 +1708,7 @@ public class PostShef {
|
|||
for (int i = 0; i < ulCount; i++) {
|
||||
tsFirstChk[i] = 0;
|
||||
}
|
||||
|
||||
Timestamp[] row = null;
|
||||
Timestamp row = null;
|
||||
Timestamp validTime = null;
|
||||
for (int i = 0; i < fcstCount; i++) {
|
||||
|
||||
|
@ -1720,8 +1720,8 @@ public class PostShef {
|
|||
basisIndex[i] = MISSING;
|
||||
|
||||
for (int j = 0; ((j < ulCount) && (basisIndex[i] == MISSING)); j++) {
|
||||
row = (Timestamp[]) ulHead[j];
|
||||
ulBasisTime = row[j];
|
||||
row = (Timestamp) ulHead[j];
|
||||
ulBasisTime = row;
|
||||
|
||||
if (ulBasisTime.compareTo(fcstBasisTime) == 0) {
|
||||
basisIndex[i] = j;
|
||||
|
@ -1759,8 +1759,8 @@ public class PostShef {
|
|||
*/
|
||||
|
||||
for (int j = 0; j < ulCount; j++) {
|
||||
row = (Timestamp[]) ulHead[j];
|
||||
basisTime[j] = row[j];
|
||||
row = (Timestamp) ulHead[j];
|
||||
basisTime[j] = row;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -85,6 +85,7 @@ import com.vividsolutions.jts.io.WKBReader;
|
|||
* 02/01/13 1569 D.Hladky Constants
|
||||
* 03/01/13 DR13228 G. Zhang Add VGB county and related code
|
||||
* 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>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -250,11 +251,35 @@ public class FFMPTemplates {
|
|||
"No configuration file found, default settings applied");
|
||||
|
||||
// we use 4 because it is the 90% solution as a start point for
|
||||
// the analysis
|
||||
ArrayList<Integer> hucParams = FFMPUtils.getHucParameters(4,
|
||||
// the analysis. Added check to make sure at least 2 HUC layers are created.
|
||||
int preliminarystart = 4;
|
||||
// first crack
|
||||
ArrayList<Integer> hucParams = FFMPUtils.getHucParameters(preliminarystart,
|
||||
primaryCWA.getCwa());
|
||||
setHucDepthStart(hucParams.get(0));
|
||||
setTotalHucLevels(hucParams.get(1));
|
||||
int startDepth = hucParams.get(0);
|
||||
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);
|
||||
setVirtual(true);
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@ import com.vividsolutions.jts.io.WKTWriter;
|
|||
* 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
|
||||
* 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>
|
||||
* @author dhladky
|
||||
* @version 1
|
||||
|
@ -304,18 +305,20 @@ public class FFMPUtils {
|
|||
int startDepth = prelimstartDepth;
|
||||
|
||||
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) {
|
||||
maxDepth = depth;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// do an 80% analysis to find min (startDepth)
|
||||
if (pfafs.length > 0) {
|
||||
for (int myMinDepth = maxDepth; myMinDepth > 0; myMinDepth--) {
|
||||
int ilevelcount = 0;
|
||||
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) {
|
||||
ilevelcount++;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* Oct 9, 2008 njensen Initial creation
|
||||
* Sep 18, 2012 #1091 randerso added base directory to getGfeConfigIncludePath
|
||||
* 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().
|
||||
* </pre>
|
||||
*
|
||||
|
@ -172,14 +174,14 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
|
||||
public static String getProceduresIncludePath(boolean includeUser) {
|
||||
String baseDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
|
||||
PROCEDURES);
|
||||
String siteDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
|
||||
PROCEDURES);
|
||||
if (includeUser) {
|
||||
String userDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
|
||||
PROCEDURES);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
|
||||
} else {
|
||||
|
@ -193,15 +195,15 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
|
||||
public static String getTextUtilitiesIncludePath(boolean includeUser) {
|
||||
String baseDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), REGULAR);
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE), REGULAR);
|
||||
String configDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.CONFIGURED),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED),
|
||||
REGULAR);
|
||||
String siteDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), REGULAR);
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE), REGULAR);
|
||||
if (includeUser) {
|
||||
String userDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
|
||||
REGULAR);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, configDir,
|
||||
baseDir);
|
||||
|
@ -216,17 +218,17 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
|
||||
public static String getTextProductsIncludePath(boolean includeUser) {
|
||||
String baseDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
|
||||
TEXT_PRODUCTS);
|
||||
String configDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.CONFIGURED),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED),
|
||||
TEXT_PRODUCTS);
|
||||
String siteDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
|
||||
TEXT_PRODUCTS);
|
||||
if (includeUser) {
|
||||
String userDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
|
||||
TEXT_PRODUCTS);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, configDir,
|
||||
baseDir);
|
||||
|
@ -241,14 +243,14 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
|
||||
public static String getSmartToolsIncludePath(boolean includeUser) {
|
||||
String baseDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
|
||||
SMART_TOOLS);
|
||||
String siteDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
|
||||
SMART_TOOLS);
|
||||
if (includeUser) {
|
||||
String userDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
|
||||
SMART_TOOLS);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
|
||||
} else {
|
||||
|
@ -262,14 +264,14 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
|
||||
public static String getUtilitiesIncludePath(boolean includeUser) {
|
||||
String baseDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
|
||||
UTILITIES);
|
||||
String siteDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
|
||||
UTILITIES);
|
||||
if (includeUser) {
|
||||
String userDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
|
||||
UTILITIES);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
|
||||
} else {
|
||||
|
@ -299,12 +301,12 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
|
||||
public static String getConfigIncludePath(boolean includeUser) {
|
||||
String baseDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), CONFIG);
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE), CONFIG);
|
||||
String siteDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE), CONFIG);
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE), CONFIG);
|
||||
if (includeUser) {
|
||||
String userDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
|
||||
CONFIG);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
|
||||
} else {
|
||||
|
@ -328,7 +330,7 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
}
|
||||
|
||||
public static String getTextProductsTemplatesIncludePath() {
|
||||
return getPath(PATH_MANAGER.getContext(LocalizationType.CAVE_STATIC,
|
||||
return getPath(PATH_MANAGER.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.BASE), TEXT_PRODUCTS);
|
||||
}
|
||||
|
||||
|
@ -338,14 +340,14 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
|
||||
public static String getCombinationsIncludePath(boolean includeUser) {
|
||||
String configDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.CONFIGURED),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED),
|
||||
COMBINATIONS);
|
||||
String siteDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE),
|
||||
COMBINATIONS);
|
||||
if (includeUser) {
|
||||
String userDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER),
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER),
|
||||
COMBINATIONS);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, configDir);
|
||||
} else {
|
||||
|
|
|
@ -31,7 +31,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*
|
||||
* 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>
|
||||
*
|
||||
|
@ -48,13 +50,18 @@ public class ImportConfRequest extends AbstractGfeRequest {
|
|||
@DynamicSerializeElement
|
||||
private String failedSite;
|
||||
|
||||
@DynamicSerializeElement
|
||||
private boolean trMode;
|
||||
|
||||
public ImportConfRequest() {
|
||||
|
||||
}
|
||||
|
||||
public ImportConfRequest(String primarySite, String failedSite) {
|
||||
public ImportConfRequest(String primarySite, String failedSite,
|
||||
boolean trMode) {
|
||||
this.primarySite = primarySite;
|
||||
this.failedSite = failedSite;
|
||||
this.trMode = trMode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,4 +94,12 @@ public class ImportConfRequest extends AbstractGfeRequest {
|
|||
this.failedSite = failedSite;
|
||||
}
|
||||
|
||||
public void setTrMode(boolean trMode) {
|
||||
this.trMode = trMode;
|
||||
}
|
||||
|
||||
public boolean isTrMode() {
|
||||
return trMode;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ import com.raytheon.uf.edex.dissemination.transmitted.TransmittedProductList;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 13, 2009 njensen Initial creation
|
||||
* 08/20/2012 DR 15340 D. Friedman Fix BBB problems
|
||||
* 03/08/2013 15564 mgamazaychikov Trimmed extra spaces in afosId
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -71,7 +72,7 @@ public class ModifyProduct {
|
|||
List<AfosToAwips> list = dao.lookupAfosId(ttaaii, cccc).getIdList();
|
||||
String productId = null;
|
||||
for (AfosToAwips ata : list) {
|
||||
String afosId = ata.getAfosid();
|
||||
String afosId = ata.getAfosid().trim();
|
||||
String awipsId = afosId.substring(3);
|
||||
if (awipsId.equals(productAwipsId)) {
|
||||
productId = afosId;
|
||||
|
|
|
@ -71,7 +71,6 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
|
|||
* Dec 3, 2010 rjpeter Initial creation
|
||||
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
|
||||
* Mar 07, 2013 1587 bsteffen rewrite static data generation.
|
||||
* Mar 14, 2013 1587 bsteffen Fix persisting to datastore.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -269,7 +268,7 @@ public class StaticDataGenerator {
|
|||
for (GridRecord staticRecord : datastoreRecords) {
|
||||
populateMessageData(staticRecord);
|
||||
}
|
||||
dao.persistToHDF5(datastoreRecords.toArray(new PluginDataObject[0]));
|
||||
dao.persistToHDF5(databaseRecords.toArray(new PluginDataObject[0]));
|
||||
}
|
||||
if (!databaseRecords.isEmpty()) {
|
||||
dao.persistToDatabase(databaseRecords
|
||||
|
@ -425,8 +424,7 @@ public class StaticDataGenerator {
|
|||
datasets = Collections.emptyList();
|
||||
}
|
||||
}
|
||||
if (!datasets.contains(staticRecord.getParameter()
|
||||
.getAbbreviation())) {
|
||||
if (datasets.contains(missing)) {
|
||||
missing.add(staticRecord);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<doTry>
|
||||
<pipeline>
|
||||
<bean ref="stringToFile" />
|
||||
<bean ref="radarDecompressor" method="decompressToFile" />
|
||||
<bean ref="radarDecompressor" method="decompressWithHeader" />
|
||||
<bean ref="dpaDecodeSrv" method="process"/>
|
||||
<!-- Uncomment when dpaDecodeSrv route properly handles only its own files
|
||||
<bean ref="processUtil" method="log"/>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<pipeline>
|
||||
<bean ref="setIngestHeaderFields"/>
|
||||
<bean ref="stringToFile" />
|
||||
<bean ref="radarDecompressor" method="decompressToFile" />
|
||||
<bean ref="radarDecompressor" method="decompressWithHeader" />
|
||||
<bean ref="dhrDecodeSrv" method="filter" />
|
||||
</pipeline>
|
||||
<doCatch>
|
||||
|
|
|
@ -20,10 +20,8 @@
|
|||
|
||||
package com.raytheon.uf.edex.ohd.pproc;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -35,6 +33,7 @@ import java.util.regex.Pattern;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.esb.Headers;
|
||||
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.edex.core.EdexException;
|
||||
|
@ -50,6 +49,9 @@ import com.raytheon.uf.edex.ohd.MainMethod;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 14, 2008 bphillip Initial creation
|
||||
* Mar 20, 2013 1804 bsteffen Switch all radar decompressing to be in
|
||||
* memory.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -71,9 +73,10 @@ public class DecodeDpaSrv {
|
|||
|
||||
private CoreDao dao;
|
||||
|
||||
public Object process(File file) throws EdexException {
|
||||
public Object process(byte[] message, Headers headers) throws EdexException {
|
||||
boolean proc = false;
|
||||
proc = checkFile(file);
|
||||
File ingestFile = new File(headers.get("ingestfilename").toString());
|
||||
proc = checkFile(message, ingestFile.getName());
|
||||
if (proc == false) {
|
||||
return null;
|
||||
}
|
||||
|
@ -110,30 +113,8 @@ public class DecodeDpaSrv {
|
|||
* @throws EdexException
|
||||
* If IOExceptions occur
|
||||
*/
|
||||
private boolean checkFile(File dpaFile) 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);
|
||||
}
|
||||
}
|
||||
private boolean checkFile(byte[] fileContents, String fileName)
|
||||
throws EdexException {
|
||||
|
||||
/*
|
||||
* Copy off the first few bytes to see if leading bytes are present
|
||||
|
@ -174,8 +155,7 @@ public class DecodeDpaSrv {
|
|||
if (offset != 0) {
|
||||
BufferedOutputStream outStream = null;
|
||||
try {
|
||||
outFile = new File(FileUtil.join(outPath,
|
||||
dpaFile.getName()));
|
||||
outFile = new File(FileUtil.join(outPath, fileName));
|
||||
outStream = new BufferedOutputStream(
|
||||
new FileOutputStream(outFile));
|
||||
} catch (FileNotFoundException e) {
|
||||
|
@ -187,7 +167,7 @@ public class DecodeDpaSrv {
|
|||
outStream.write(fileContents, offset,
|
||||
fileContents.length - offset);
|
||||
logger.info("Re-writing contents of file: "
|
||||
+ dpaFile + " to " + outFile);
|
||||
+ fileName + " to " + outFile);
|
||||
} catch (IOException e) {
|
||||
throw new EdexException(
|
||||
"Error writing updated contents of DPA file: "
|
||||
|
@ -209,18 +189,18 @@ public class DecodeDpaSrv {
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
String radarid = dpaFile.getName().substring(1, 4).toUpperCase();
|
||||
String radarid = fileName.substring(1, 4).toUpperCase();
|
||||
String query = String
|
||||
.format("select * from radarloc where radid='%s' and use_radar='T' ",
|
||||
radarid);
|
||||
dao = new CoreDao(DaoConfig.forDatabase("ihfs"));
|
||||
Object[] rs = dao.executeSQLQuery(query);
|
||||
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
|
||||
+ " decoding with filename.");
|
||||
try {
|
||||
FileUtil.copyFile(dpaFile, outFile);
|
||||
FileUtil.bytes2File(fileContents, outFile);
|
||||
} catch (IOException e) {
|
||||
throw new EdexException(
|
||||
"Error copying file to destination directory: "
|
||||
|
|
|
@ -20,16 +20,15 @@
|
|||
|
||||
package com.raytheon.uf.edex.ohd.pproc;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
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.Pattern;
|
||||
|
||||
import com.raytheon.edex.esb.Headers;
|
||||
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
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
|
||||
* Mar 09, 2012 417 dgilling Refactor to use two-stage queue
|
||||
* process.
|
||||
* Mar 20, 2013 1804 bsteffen Switch all radar decompressing to be in
|
||||
* memory.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author snaples
|
||||
|
@ -174,23 +176,15 @@ public class HPEDhrSrv {
|
|||
* @param hpeFile
|
||||
* The radar file to check.
|
||||
*/
|
||||
public void filter(File hpeFile) {
|
||||
public void filter(byte[] fileContents, Headers headers) {
|
||||
// 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) {
|
||||
return;
|
||||
}
|
||||
|
||||
File hpeFile = new File(headers.get("ingestfilename").toString());
|
||||
|
||||
// check header
|
||||
String fileStartStr = new String(fileContents, 0, 80);
|
||||
// array will hold radar id, dtype, and dt information. using array so
|
||||
|
@ -218,36 +212,6 @@ public class HPEDhrSrv {
|
|||
// 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
|
||||
* be placed onto the queue used by <code>HPEDhrSrv</code> for actual data
|
||||
|
|
|
@ -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.edex.plugin.radar;bundle-version="1.12.1174",
|
||||
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,
|
||||
com.raytheon.uf.common.ohd,
|
||||
com.raytheon.uf.common.status,
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
<bean id="ffmpThreadPool"
|
||||
class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
|
||||
<property name="corePoolSize" value="1" />
|
||||
<property name="maxPoolSize" value="1" />
|
||||
<property name="corePoolSize" value="2" />
|
||||
<property name="maxPoolSize" value="4" />
|
||||
<property name="keepAliveSeconds" value="60000" />
|
||||
</bean>
|
||||
|
||||
|
|
|
@ -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.records.ByteDataRecord;
|
||||
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.LocalizationContext;
|
||||
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.serialization.SerializationException;
|
||||
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.UFStatus;
|
||||
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.
|
||||
* 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.
|
||||
* 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>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -703,51 +705,40 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
|||
fftiSources.add(ffmp.getFFTISource());
|
||||
ffti.processFFTI();
|
||||
}
|
||||
|
||||
// Do the accumulation now, more memory efficient.
|
||||
// Only one piece in memory at a time
|
||||
for (String attribute : ffmp.getAttributes()) {
|
||||
if (attribute.equals(ATTRIBUTE.ACCUM
|
||||
.getAttribute())) {
|
||||
FFTIAccum accum = getAccumulationForSite(
|
||||
ffmpProduct.getDisplayName(),
|
||||
siteKey, dataKey,
|
||||
fftiSource.getDurationHour(),
|
||||
ffmpProduct.getUnit(siteKey));
|
||||
if (statusHandler
|
||||
.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler
|
||||
.debug("Accumulating FFTI for source: "
|
||||
+ ffmpProduct
|
||||
.getDisplayName()
|
||||
+ " site: "
|
||||
+ siteKey
|
||||
+ " data: "
|
||||
+ dataKey
|
||||
+ " duration: "
|
||||
+ fftiSource
|
||||
.getDurationHour()
|
||||
+ " accumulation: "
|
||||
+ accum.getAccumulation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do the accumulation now, more memory efficient.
|
||||
// Only one piece in memory at a time
|
||||
for (String attribute : ffmp.getAttributes()) {
|
||||
if (attribute.equals(ATTRIBUTE.ACCUM
|
||||
.getAttribute())) {
|
||||
FFTIAccum accum = getAccumulationForSite(
|
||||
ffmpProduct.getDisplayName(),
|
||||
siteKey, dataKey,
|
||||
fftiSource.getDurationHour(),
|
||||
ffmpProduct.getUnit(siteKey));
|
||||
if (statusHandler
|
||||
.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler
|
||||
.debug("Accumulating FFTI for source: "
|
||||
+ ffmpProduct
|
||||
.getDisplayName()
|
||||
+ " site: "
|
||||
+ siteKey
|
||||
+ " data: "
|
||||
+ dataKey
|
||||
+ " duration: "
|
||||
+ fftiSource
|
||||
.getDurationHour()
|
||||
+ " accumulation: "
|
||||
+ accum.getAccumulation());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SourceXML source = getSourceConfig().getSource(
|
||||
ffmpRec.getSourceName());
|
||||
|
||||
if (!source.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
String sourceSiteDataKey = getSourceSiteDataKey(source,
|
||||
dataKey, ffmpRec);
|
||||
ffmpData.remove(sourceSiteDataKey);
|
||||
statusHandler.info("Removing from memory: "+sourceSiteDataKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // record not null
|
||||
} // end sitekey for loop
|
||||
} // end datakey loop
|
||||
} // end process
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1829,7 +1820,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
|||
}
|
||||
|
||||
ffmpData.remove(siteDataKey);
|
||||
statusHandler.info("Removing from memory: "+siteDataKey);
|
||||
accumulator.setReset(false);
|
||||
writeFFTIData(siteDataKey, accumulator);
|
||||
}
|
||||
|
@ -1980,7 +1970,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
|||
|
||||
// replace or insert it
|
||||
ffmpData.remove(qpeSiteSourceDataKey);
|
||||
statusHandler.info("Removing from memory: "+qpeSiteSourceDataKey);
|
||||
values.setReset(false);
|
||||
writeFFTIData(siteDataKey, values);
|
||||
}
|
||||
|
@ -2019,30 +2008,39 @@ public class FFMPGenerator extends CompositeProductGenerator implements
|
|||
|
||||
|
||||
/**
|
||||
* Find siteSourceDataKey
|
||||
* Log process statistics
|
||||
*
|
||||
* @param source
|
||||
* @param dataKey
|
||||
* @param ffmpRec
|
||||
* @return
|
||||
* @param message
|
||||
*/
|
||||
private String getSourceSiteDataKey(SourceXML source, String dataKey, FFMPRecord ffmpRec) {
|
||||
|
||||
String sourceName = source.getSourceName();
|
||||
String sourceSiteDataKey = null;
|
||||
|
||||
if (source.getSourceType().equals(
|
||||
SOURCE_TYPE.GUIDANCE.getSourceType())) {
|
||||
sourceName = source.getDisplayName();
|
||||
sourceSiteDataKey = sourceName;
|
||||
|
||||
} else {
|
||||
sourceName = ffmpRec.getSourceName();
|
||||
sourceSiteDataKey = sourceName + "-" + ffmpRec.getSiteKey()
|
||||
+ "-" + dataKey;
|
||||
@Override
|
||||
public void log(URIGenerateMessage message) {
|
||||
|
||||
long curTime = System.currentTimeMillis();
|
||||
ProcessEvent processEvent = new ProcessEvent();
|
||||
|
||||
if (productType != null) {
|
||||
processEvent.setDataType(productType);
|
||||
}
|
||||
|
||||
Long dequeueTime = message.getDeQueuedTime();
|
||||
if (dequeueTime != null) {
|
||||
long elapsedMilliseconds = curTime - dequeueTime;
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -66,7 +66,6 @@ import com.raytheon.uf.edex.database.plugin.PluginDao;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/7/09 1994 bphillip Initial Creation
|
||||
* Mar 14, 2013 1587 bsteffen Fix static data persisting to datastore.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -100,13 +99,10 @@ public class GridDao extends PluginDao {
|
|||
long[] sizes = new long[] { location.getNx(), location.getNy() };
|
||||
String abbrev = gridRec.getParameter().getAbbreviation();
|
||||
String group = gridRec.getDataURI();
|
||||
String datasetName = "Data";
|
||||
if (GridPathProvider.STATIC_PARAMETERS.contains(abbrev)) {
|
||||
group = "/" + location.getId();
|
||||
datasetName = abbrev;
|
||||
}
|
||||
AbstractStorageRecord storageRecord = new FloatDataRecord(
|
||||
datasetName,
|
||||
AbstractStorageRecord storageRecord = new FloatDataRecord("Data",
|
||||
group, (float[]) messageData, 2, sizes);
|
||||
|
||||
storageRecord.setCorrelationObject(gridRec);
|
||||
|
|
|
@ -64,6 +64,7 @@ log_msg 30
|
|||
# Copies the localization information to the staging area
|
||||
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}/vtec $commonDest/site
|
||||
log_msg 40
|
||||
|
||||
log_msg Copying edex site configuration for site ${CAPS_SITE} to temporary directory...
|
||||
|
|
|
@ -49,6 +49,7 @@ then
|
|||
then
|
||||
log_msg You cannot import configuration data for your own site.
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
touch ${LOCK_DIR}/svcbuerr
|
||||
log_msg 100
|
||||
exit 1
|
||||
|
@ -66,6 +67,7 @@ then
|
|||
else
|
||||
log_msg "Unable to locate ${import_file}. Service backup exits now"
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
touch ${LOCK_DIR}/svcbuerr
|
||||
log_msg 100
|
||||
exit 1
|
||||
|
@ -79,6 +81,7 @@ gunzip -c GFEconfig.${SITE}.tar.gz | tar xf -
|
|||
if [ $? -ne 0 ]; then
|
||||
log_msg -e "\nERROR: Could not explode GFEconfig.${SITE_CAPS}.tar.gz..."
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
touch ${LOCK_DIR}/svcbuerr
|
||||
log_msg 100
|
||||
exit 1
|
||||
|
@ -90,6 +93,7 @@ if [ -d GFEconfig ]; then
|
|||
else
|
||||
log_msg "Incorrectly formatted configuration received. Cannot continue!"
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
touch ${LOCK_DIR}/svcbuerr
|
||||
log_msg 100
|
||||
exit 1
|
||||
|
@ -152,6 +156,19 @@ fi
|
|||
|
||||
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
|
||||
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
|
||||
|
@ -170,6 +187,7 @@ cd ${SVCBU_HOME}
|
|||
rm -rf *
|
||||
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
log_msg 100
|
||||
touch ${LOCK_DIR}/${SITE}svcbuMode
|
||||
log_msg "Configuration Import Complete!"
|
||||
|
|
|
@ -21,6 +21,7 @@ then
|
|||
log_msg Lock file not present for importing configuration! Cannot continue!
|
||||
touch ${LOCK_DIR}/svcbuerr
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
log_msg 100
|
||||
exit 1
|
||||
fi
|
||||
|
@ -36,6 +37,7 @@ else
|
|||
log_msg "Script must be run as user root or awips"
|
||||
touch ${LOCK_DIR}/svcbuerr
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
log_msg 100
|
||||
exit 1
|
||||
fi
|
||||
|
@ -46,6 +48,7 @@ if [ $exitValue -ne 0 ]; then
|
|||
log_msg "Receive configuration returned with errors..."
|
||||
touch ${LOCK_DIR}/svcbuerr
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
log_msg 100
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -7,10 +7,11 @@ fi
|
|||
|
||||
# $1 = Primary site
|
||||
# $2 = Failed site
|
||||
# $3 = enable/disable troubleshooting mode
|
||||
|
||||
if [ $# -ne 2 ]
|
||||
if [ $# -ne 3 ]
|
||||
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
|
||||
fi
|
||||
|
||||
|
@ -32,6 +33,10 @@ then
|
|||
fi
|
||||
|
||||
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 0
|
||||
|
@ -42,6 +47,7 @@ if [ -n "${SVCBU_WMO_HEADER}" ]; then
|
|||
if [ $exitValue -ne 0 ]; then
|
||||
log_msg "msg_send failed while requesting configuration for ${CAPS_SITE}`date`"
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
log_msg "msg_send FAILED with exit value $exitValue and the following error: $msgSendOutput"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -51,6 +57,7 @@ else
|
|||
if [ $exitValue -ne 0 ]; then
|
||||
log_msg "msg_send failed while requesting configuration for ${2}`date`"
|
||||
rm -f ${LOCK_DIR}/importConfiguration
|
||||
rm -f ${LOCK_DIR}/trMode
|
||||
log_msg "msg_send FAILED with exit value $exitValue and the following error: $msgSendOutput"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -191,8 +191,8 @@ public class Wes2BridgeManager {
|
|||
/* Disable JMX. */
|
||||
private void updateEdexWrapper(String srcEdexDirectory, String edexDirectory)
|
||||
throws FileNotFoundException, IOException {
|
||||
String srcwrapper_conf = srcEdexDirectory + "/bin/wrapper.conf";
|
||||
String wrapper_conf = edexDirectory + "/bin/wrapper.conf";
|
||||
String srcwrapper_conf = srcEdexDirectory + "/conf/wrapper.conf";
|
||||
String wrapper_conf = edexDirectory + "/conf/wrapper.conf";
|
||||
|
||||
BufferedReader br = this.getBufferedReader(srcwrapper_conf);
|
||||
BufferedWriter bw = this.getBufferedWriter(wrapper_conf);
|
||||
|
@ -269,7 +269,7 @@ public class Wes2BridgeManager {
|
|||
|
||||
final String line1 = "EDEX_INSTALL=";
|
||||
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;
|
||||
while ((line = br.readLine()) != null) {
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 4/7/09 1994 bphillip Initial Creation
|
||||
* Mar 25, 2013 1821 bsteffen Make grib2 decoding more multithreaded
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -138,7 +139,9 @@ static PyObject * grib2_getData(PyObject *self, PyObject* args)
|
|||
long numfields;
|
||||
npy_intp dimSize[1];
|
||||
PyObject *response = PyDict_New();
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
numfields = getRecord(fptr, &gfld, recordNumber, fieldNumber, 1);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
PyObject * numberOfFields = PyInt_FromLong(numfields);
|
||||
PyDict_SetItemString(response, "numFields", numberOfFields);
|
||||
|
|
Loading…
Add table
Reference in a new issue