Merge branch 'omaha_14.1.1' (14.1.1-11) into development

Conflicts:
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/SCANUnwarnedDlg.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResourceData.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/tables/AbstractTableDlg.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/tables/SCANCellTableDlg.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/tables/SCANDmdTableDlg.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/tables/SCANMesoTableDlg.java
	cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/tables/SCANTvsTableDlg.java
	cave/com.raytheon.uf.viz.monitor/src/com/raytheon/uf/viz/monitor/ui/dialogs/TableComp.java
	cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java
	cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/AbstractWWAResource.java
	edexOsgi/com.raytheon.edex.ingestsrv/res/spring/persist-ingest.xml
	edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java
	edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/smartinit/IFPWE.java
	edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/iscMosaic.py
	edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java
	edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java
	msi/VizLauncher/VizLauncher/com/raytheon/viz/launcher/process/AbstractProcessLauncher.cs

Change-Id: Iaf9f42e7ee93949d34c70916fd91acf8c838c83a

Former-commit-id: b3b23647b4 [formerly 0c4ae068ad] [formerly b3b23647b4 [formerly 0c4ae068ad] [formerly a0b6ea8bb2 [formerly b09f1559254f06a82afa91f0cc14c8150f88ce64]]]
Former-commit-id: a0b6ea8bb2
Former-commit-id: 60679a818a [formerly da027298d4]
Former-commit-id: fd93b7d85e
This commit is contained in:
Richard Peter 2013-12-05 12:12:27 -06:00
commit ae6e34be4b
97 changed files with 2035 additions and 1469 deletions

View file

@ -25,6 +25,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.viz.core.VizApp;
/**
* Repeats playing the System beep. Same code as
@ -36,9 +39,9 @@ import org.eclipse.core.runtime.jobs.Job;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 03, 2011 #8059 rferrel Initial creation
* Nov 26, 2013 DR16772 gzhang use Display.beep()
*
* </pre>
*
* @author rferrel
* @version 1.0
*/
@ -70,8 +73,8 @@ public class AlarmBeepJob extends Job {
@Override
protected IStatus run(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
if (count > 0) {
Toolkit.getDefaultToolkit().beep();
if (count > 0) {
VizApp.runAsync(new Runnable(){@Override public void run(){Display.getDefault().beep();}}); // DR 16772 //Toolkit.getDefaultToolkit().beep();
reSchedule();
count--;
} else {

View file

@ -24,6 +24,10 @@ import java.util.Calendar;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@ -71,6 +75,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Jul 24, 2013 2220 rferrel Changes to queue size request for all data.
* Aug 01, 2013 2221 rferrel Changes for select configuration.
* Aug 06, 2013 2222 rferrel Changes to display all selected data.
* Nov 14, 2013 2549 rferrel Get category data moved off the UI thread.
* </pre>
*
* @author bgonzale
@ -452,25 +457,57 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
* adjust sizes on the display table.
*/
protected void populateTableComp() {
String archiveName = getSelectedArchiveName();
String categoryName = getSelectedCategoryName();
final String archiveName = getSelectedArchiveName();
final String categoryName = getSelectedCategoryName();
setCursorBusy(true);
try {
setShowingSelected(false);
setShowingSelected(false);
tableComp.populateTable(archiveName, categoryName,
new ArrayList<DisplayData>(0));
tableComp.refresh();
List<DisplayData> displayDatas = sizeJob.changeDisplay(archiveName,
categoryName);
if (displayDatas != null) {
tableComp
.populateTable(archiveName, categoryName, displayDatas);
} else {
tableComp.refresh();
Job job = new Job("populate category table") {
@Override
protected IStatus run(IProgressMonitor monitor) {
getCategoryTableData(archiveName, categoryName);
return Status.OK_STATUS;
}
} finally {
setCursorBusy(false);
}
};
job.schedule();
}
/**
* This gets the desired categories data. Assumed called from non-UI thread
* since it is possible getting the data may take time which would hang up
* the UI thread.
*
* @param archiveName
* @param categoryName
*/
private void getCategoryTableData(final String archiveName,
final String categoryName) {
final List<DisplayData> displayDatas = sizeJob.changeDisplay(
archiveName, categoryName);
VizApp.runAsync(new Runnable() {
@Override
public void run() {
try {
if (displayDatas != null) {
tableComp.populateTable(archiveName, categoryName,
displayDatas);
} else {
tableComp.refresh();
}
} finally {
setCursorBusy(false);
}
}
});
}
/**

View file

@ -250,7 +250,8 @@ public abstract class FFMPTable extends Composite {
event.gc.setForeground(lineColor);
event.gc.setLineWidth(1);
int currentCol = event.index;
TableItem ti = (TableItem) event.item;
Rectangle rect = ((TableItem) event.item).getBounds(currentCol);
event.gc.drawRectangle(rect.x - 1, rect.y - 1, rect.width,
rect.height);
@ -265,6 +266,13 @@ public abstract class FFMPTable extends Composite {
// Draw a top line
event.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
// Draw a bottom line if this is the last row of the table
int index = table.indexOf(ti);
if (index == table.getItemCount() - 1) {
event.gc.drawLine(rect.x, rect.y + rect.height - 2, rect.x
+ rect.width, rect.y + rect.height - 2);
}
if ((tableIndex >= 0) && (tableIndex < table.getItemCount())) {
event.gc.setForeground(parent.getDisplay().getSystemColor(
SWT.COLOR_BLUE));

View file

@ -41,6 +41,22 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
/**
* Time Duration Scale Composite
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 20, 2013 #2488 randerso Changed to use DejaVu font
*
* </pre>
*
* @author randerso
* @version 1.0
*/
public class TimeDurScaleComp extends Composite {
/**
* Parent composite.
@ -252,13 +268,10 @@ public class TimeDurScaleComp extends Composite {
*/
private void init() {
// Create the font
// canvasFont = new Font(parentComp.getDisplay(), "Courier", 10,
// SWT.NORMAL);
// canvasFont = new Font(parentComp.getDisplay(), "Monospace", 10,
// SWT.NORMAL);
FontData fd = parentComp.getDisplay().getSystemFont().getFontData()[0];
fd.setName("Bitstream Vera Sans Mono");
// TODO not have hard coded font name
fd.setName("DejaVu Sans Mono");
canvasFont = new Font(parentComp.getDisplay(), fd);
// Create the time bar colors
@ -307,6 +320,7 @@ public class TimeDurScaleComp extends Composite {
this.pack();
this.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent arg0) {
greyColor.dispose();
yellowColor.dispose();
@ -328,6 +342,7 @@ public class TimeDurScaleComp extends Composite {
timeSliderCanvas.setLayoutData(new GridData(CANVAS_WIDTH + 10,
CANVAS_HEIGHT));
timeSliderCanvas.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
drawTimeSliderCanvas(e.gc);
}

View file

@ -20,9 +20,6 @@
package com.raytheon.uf.viz.monitor.scan.commondialogs;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
@ -53,6 +50,10 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Oct 25, 2009 lvenable Initial creation
* 24 Jul 2013 #2143 skorolev Changes non-blocking dialogs.
* Aug 15, 2013 2143 mpduff Remove resize.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* </pre>
*
* @author lvenable
@ -237,21 +238,14 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.horizontalSpan = 4;
gd.verticalIndent = 20;
unwarnedTorChk = new Button(controlComp, SWT.CHECK);
unwarnedTorChk.setText("Unwarned TOR");
unwarnedTorChk = createCheckLabelColor(controlComp, gd, "Unwarned TOR");
unwarnedTorChk.setSelection(cfgData.getUnwarnedTor());
unwarnedTorChk.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
unwarnedTorChk.setForeground(getDisplay().getSystemColor(
SWT.COLOR_WHITE));
unwarnedTorChk.setLayoutData(gd);
unwarnedTorChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
enableTorControls();
}
});
setupButtonMouseListeners(unwarnedTorChk);
gd = new GridData(SWT.LEFT, SWT.CENTER, false, true);
gd.horizontalSpan = 2;
@ -300,21 +294,14 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.horizontalSpan = 4;
gd.verticalIndent = 20;
unwarnedSvrChk = new Button(controlComp, SWT.CHECK);
unwarnedSvrChk.setText("Unwarned SVR");
unwarnedSvrChk = createCheckLabelColor(controlComp, gd, "Unwarned SVR");
unwarnedSvrChk.setSelection(cfgData.getUnwarnedSvr());
unwarnedSvrChk.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
unwarnedSvrChk.setForeground(getDisplay().getSystemColor(
SWT.COLOR_WHITE));
unwarnedSvrChk.setLayoutData(gd);
unwarnedSvrChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
enableSvrControls();
}
});
setupButtonMouseListeners(unwarnedSvrChk);
gd = new GridData(SWT.LEFT, SWT.CENTER, false, true);
gd.horizontalSpan = 2;
@ -586,33 +573,40 @@ public class SCANUnwarnedDlg extends CaveSWTDialog implements
}
/**
* Setup Button Mouse Listeners.
* Create a composite that contains a checkbox with no text and a colored
* label.
*
* @param btn
* @param parentComp
* Parent composite.
* @param gd
* GridData used for the composite.
* @param labelText
* Text for the label.
* @return The checkbox that is created.
*/
private void setupButtonMouseListeners(final Button btn) {
btn.addMouseMoveListener(new MouseMoveListener() {
@Override
public void mouseMove(MouseEvent e) {
btn.setForeground(shell.getDisplay().getSystemColor(
SWT.COLOR_BLACK));
}
private Button createCheckLabelColor(Composite parentComp, GridData gd,
String labelText) {
});
GridLayout gl = new GridLayout(2, false);
gl.marginHeight = 2;
gl.marginWidth = 2;
gl.horizontalSpacing = 0;
btn.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseExit(MouseEvent e) {
btn.setForeground(shell.getDisplay().getSystemColor(
SWT.COLOR_WHITE));
}
Composite chkLblComp = new Composite(parentComp, SWT.NONE);
chkLblComp.setLayout(gl);
chkLblComp.setLayoutData(gd);
@Override
public void mouseEnter(MouseEvent e) {
btn.setForeground(shell.getDisplay().getSystemColor(
SWT.COLOR_BLACK));
}
});
gd = new GridData(18, SWT.DEFAULT);
Button chkBox = new Button(chkLblComp, SWT.CHECK);
chkBox.setLayoutData(gd);
Label lbl = new Label(chkLblComp, SWT.NONE);
lbl.setBackground(SCANConfig.getInstance().getScanColor(
ScanColors.Unwarned));
lbl.setForeground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
lbl.setText(" " + labelText);
return chkBox;
}
/*

View file

@ -65,6 +65,8 @@ import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
* Jul 24, 2013 2218 mpduff Changed method signature.
* Aug 15, 2013 2143 mpduff Add missing data check.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* 04 Dec 2013 #2592 lvenable Added check to ensure the PluginDataObject
* array has at least one element.
*
* </pre>
*
@ -99,7 +101,9 @@ public class ScanResourceData extends AbstractRequestableResourceData {
protected AbstractVizResource<?, ?> constructResource(
LoadProperties loadProperties, PluginDataObject[] objects)
throws VizException {
if (objects.length > 0) {
List<String> uris = getScan().getAvailableUris(
ScanTables.valueOf(tableType), icao);
try {

View file

@ -39,7 +39,9 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
@ -82,6 +84,10 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Jul 24, 2013 #2218 mpduff Changed method signature.
* Jul 26, 2013 #2143 skorolev Changes for non-blocking dialog.
* Aug 15, 2013 #2143 mpduff Change how the dialogs close to prevent ConcurrentModificationException.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* </pre>
*
* @author lvenable
@ -668,6 +674,62 @@ public abstract class AbstractTableDlg extends CaveSWTDialog implements
// this will mean firing a get graphData Event back to the monitor
}
/**
* This is a method that will create a composite that contains a checkbox
* with no text and a label. Since the upgrade to Redhat 6, a checkbox that
* has its foreground and background color changed can cause the check in
* the checkbox to become invisible if the foreground color is too light.
* This method creates an ordinary checkbox with the label and composite
* background being colored.
*
* @param parentComp
* Parent composite.
* @param bgColor
* Background color.
* @param fgColor
* Foreground color.
* @param labelText
* Text for the label.
* @param colorComposite
* Flag indicating if the composite background color should be
* set.
* @param toolTipText
* Set the toolTipText
* @return The checkbox control that is created.
*/
protected final Button createCheckLabelComposite(Composite parentComp,
Color bgColor, Color fgColor, String labelText,
boolean colorComposite, String toolTipText) {
GridData gd = new GridData();
GridLayout gl = new GridLayout(2, false);
gl.marginHeight = 2;
gl.marginWidth = 2;
gl.horizontalSpacing = 0;
Composite chkLblComp = new Composite(parentComp, SWT.NONE);
chkLblComp.setLayout(gl);
chkLblComp.setLayoutData(gd);
if (colorComposite) {
chkLblComp.setBackground(bgColor);
}
gd = new GridData(18, SWT.DEFAULT);
Button chkBox = new Button(chkLblComp, SWT.CHECK);
chkBox.setLayoutData(gd);
Label lbl = new Label(chkLblComp, SWT.NONE);
lbl.setBackground(bgColor);
lbl.setForeground(fgColor);
lbl.setText(" " + labelText);
chkBox.setToolTipText(toolTipText);
lbl.setToolTipText(toolTipText);
return chkBox;
}
@Override
public ArrayList<IMonitor> getMonitorControlListeners() {
return controlListeners;

View file

@ -95,6 +95,10 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* button if they want to close the dialog.
* Jul 24, 2013 #2218 mpduff Method signature changed.
* Jul 26, 2013 #2143 skorolev Changes for non-blocking dialogs.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
*
* </pre>
*
@ -309,13 +313,11 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
}
});
gd = new GridData();
configBtn = new Button(controlComp, SWT.PUSH);
configBtn.setText("Configurations");
configBtn
.setBackground(scanCfg.getScanColor(ScanColors.Configurations));
configBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
configBtn.setLayoutData(gd);
configBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -346,12 +348,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(rankBtn);
gd = new GridData();
attribBtn = new Button(controlComp, SWT.PUSH);
attribBtn.setText("Attributes");
attribBtn.setBackground(scanCfg.getScanColor(ScanColors.Attributes));
attribBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
attribBtn.setLayoutData(gd);
attribBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -361,12 +361,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(attribBtn);
gd = new GridData();
tablesBtn = new Button(controlComp, SWT.PUSH);
tablesBtn.setText("Tables");
tablesBtn.setBackground(scanCfg.getScanColor(ScanColors.Default));
tablesBtn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tablesBtn.setLayoutData(gd);
tablesBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -379,55 +377,58 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(tablesBtn);
gd = new GridData();
linkToFrameChk = new Button(controlComp, SWT.CHECK);
linkToFrameChk.setText("Link to Frame ");
linkToFrameChk.setBackground(scanCfg
.getScanColor(ScanColors.LinkToFrame));
linkToFrameChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Link to Frame
*/
linkToFrameChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.LinkToFrame),
display.getSystemColor(SWT.COLOR_WHITE), "Link to Frame ",
true, null);
linkToFrameChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getLinkToFrame());
linkToFrameChk.setLayoutData(gd);
linkToFrameChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleLinkToFrame();
}
});
setupButtonMouseListeners(linkToFrameChk);
/*
* CWA Filter
*/
StringBuilder tipText = new StringBuilder();
tipText.append("Activate to remove from the SCAN table all cells,\n");
tipText.append("MESOs, and TVS's that are outside your CWA.\n\n");
tipText.append("Deactivate to include in the SCAN table all cells,\n");
tipText.append("MESOs, and TVS's detected by radar.");
gd = new GridData();
cwaFilterChk = new Button(controlComp, SWT.CHECK);
cwaFilterChk.setText("CWA Filter ");
cwaFilterChk.setBackground(scanCfg.getScanColor(ScanColors.CWAFilter));
cwaFilterChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
cwaFilterChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.CWAFilter),
display.getSystemColor(SWT.COLOR_WHITE), "CWA Filter ", true,
tipText.toString());
cwaFilterChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getFilterOption());
cwaFilterChk.setLayoutData(gd);
cwaFilterChk.setToolTipText(tipText.toString());
cwaFilterChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleCWAFilterAction();
}
});
setupButtonMouseListeners(cwaFilterChk);
// Uses same back ground color as attributes.
gd = new GridData();
unwarnedChk = new Button(controlComp, SWT.CHECK);
unwarnedChk.setText("Unwarned ");
unwarnedChk.setBackground(scanCfg.getScanColor(ScanColors.Attributes));
unwarnedChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Unwarned
*/
unwarnedChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Attributes),
display.getSystemColor(SWT.COLOR_WHITE), "Unwarned ", true,
null);
unwarnedChk.setSelection(cellCfgMgr.getScanCellCfgXML()
.getFilterOption());
unwarnedChk.setLayoutData(gd);
unwarnedChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -435,41 +436,31 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
displayUnwarnedAlarmDialog();
}
});
setupButtonMouseListeners(unwarnedChk);
// Create/Recreate the unwarned config data since the ScanConfig is a
// singleton
// and the data clears out when the CELL table dialog get re-created.
// singleton and the data clears out when the CELL table dialog get
// re-created.
scanCfg.createUnwarnedConfig();
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Vertical - tech blocked
*/
vertChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Vert),
display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setSelection(cellCfgMgr.getScanCellCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
vertChk.setEnabled(false);
/*
* The vertical table is a techblocked DR. This selection listener will
* be commented out until it is needed.
* Tool tips
*/
// vertChk.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
// });
setupButtonMouseListeners(vertChk);
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(cellCfgMgr.getScanCellCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -477,8 +468,10 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
scanTableComp.updateColumnTips();
}
});
setupButtonMouseListeners(tipsChk);
/*
* Alarm button
*/
gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
gd.widthHint = 75;
alarmBtn = new Button(controlComp, SWT.PUSH);

View file

@ -97,6 +97,10 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Jul 24, 2013 2218 mpduff Change method signature.
* Jul 26, 2013 #2143 skorolev Changes for non-blocking dialogs.
* Aug 15, 2013 2143 mpduff Added some isDisposed() checks.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
* </pre>
*
* @author lvenable
@ -431,74 +435,66 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(attribBtn);
gd = new GridData();
linkToFrameChk = new Button(controlComp, SWT.CHECK);
linkToFrameChk.setText("Link to Frame ");
linkToFrameChk.setBackground(scanCfg
.getScanColor(ScanColors.LinkToFrame));
linkToFrameChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Link to frame
*/
linkToFrameChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.LinkToFrame),
display.getSystemColor(SWT.COLOR_WHITE), "Link to Frame ",
true, null);
linkToFrameChk.setSelection(dmdConfigMgr.getScanDmdCfgXML()
.getLinkToFrame());
linkToFrameChk.setLayoutData(gd);
linkToFrameChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleLinkToFrame();
}
});
setupButtonMouseListeners(linkToFrameChk);
/*
* CWA Filter
*/
StringBuilder tipText = new StringBuilder();
tipText.append("Activate to remove from the SCAN table all cells and\n");
tipText.append("DMDs that are outside your CWA.\n\n");
tipText.append("Deactivate to include in the SCAN table all cells and\n");
tipText.append("DMDs detected by radar.");
gd = new GridData();
cwaFilterChk = new Button(controlComp, SWT.CHECK);
cwaFilterChk.setText("CWA Filter ");
cwaFilterChk.setBackground(scanCfg.getScanColor(ScanColors.CWAFilter));
cwaFilterChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
cwaFilterChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.CWAFilter),
display.getSystemColor(SWT.COLOR_WHITE), "CWA Filter ", true,
tipText.toString());
cwaFilterChk.setSelection(dmdConfigMgr.getScanDmdCfgXML()
.getFilterOption());
cwaFilterChk.setLayoutData(gd);
cwaFilterChk.setToolTipText(tipText.toString());
cwaFilterChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleCWAFilterAction();
}
});
setupButtonMouseListeners(cwaFilterChk);
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
vertChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
/*
* The vertical table is a techblocked DR. This will be commented out
* until that is addressed.
* Vertical - tech blocked
*/
// vertChk.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
// });
setupButtonMouseListeners(vertChk);
vertChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Vert),
display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getFilterOption());
vertChk.setEnabled(false);
/*
* Tool tips
*/
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(dmdConfigMgr.getScanDmdCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -507,8 +503,10 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
dmdTableComp.updateColumnTips();
}
});
setupButtonMouseListeners(tipsChk);
/*
* Alarm button
*/
gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
alarmBtn = new Button(controlComp, SWT.PUSH);
alarmBtn.setText("Alarm");

View file

@ -74,6 +74,10 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 29, 2013 #1945 lvenable Code cleanup for SCAN performance.
* 24 Jul 2013 #2143 skorolev Changes non-blocking dialogs.
* Aug 15, 2013 2143 mpduff Added some isDisposed() checks.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
*
* </pre>
*
@ -260,34 +264,26 @@ public class SCANMesoTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(attribBtn);
/*
* Vertical - tech blocked
*/
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
vertChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Vert),
display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setSelection(mesoCfgMgr.getScanMesoCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
vertChk.setEnabled(false);
/*
* The vertical table is a techblocked DR. This selection listener will
* be commented out until it is needed.
* Tool tips
*/
// vertChk.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
// });
setupButtonMouseListeners(vertChk);
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(mesoCfgMgr.getScanMesoCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -296,8 +292,10 @@ public class SCANMesoTableDlg extends AbstractTableDlg implements
scanTableComp.updateColumnTips();
}
});
setupButtonMouseListeners(tipsChk);
/*
* Time
*/
gd = new GridData(SWT.RIGHT, SWT.CENTER, true, true);
gd.widthHint = 160;
timeLbl = new Label(controlComp, SWT.RIGHT);

View file

@ -85,8 +85,8 @@ import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlertedAlar
* Jul 24, 2013 2218 mpduff Change method signature.
* Oct 11, 2013 #2471 lvenable Fix color memory leak.
*
* Nov 26, 2013 DR16782 gzhang use Display.beep()
* </pre>
*
* @author lvenable
* @version 1.0
*/
@ -937,7 +937,7 @@ public abstract class SCANTable extends Composite {
beepTimer.purge();
}
if (mgr.isRing()) {
Toolkit.getDefaultToolkit().beep();
Display.getDefault().beep();//Toolkit.getDefaultToolkit().beep();
} else {
beepTimer.cancel();
beepTimer.purge();

View file

@ -73,6 +73,10 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 29, 2013 #1945 lvenable Code cleanup for SCAN performance.
* 24 Jul 2013 #2143 skorolev Changes for non-blocking dialogs.
* Aug 15, 2013 2143 mpduff Added some isDisposed() checks.
* 04 Dec 2013 #2592 lvenable Update how the checkboxes are handled
* (background/foreground colors) since the Redhat
* 6 upgrade causes the check in the checkbox to be
* colored the same as the background.
*
* </pre>
*
@ -251,34 +255,25 @@ public class SCANTvsTableDlg extends AbstractTableDlg implements
});
setupButtonMouseListeners(attribBtn);
// Vertical tables are not supported at this time.
gd = new GridData();
vertChk = new Button(controlComp, SWT.CHECK);
vertChk.setText("Vert ");
vertChk.setEnabled(false);
vertChk.setBackground(scanCfg.getScanColor(ScanColors.Vert));
vertChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
/*
* Vertical - tech blocked
*/
vertChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Vert),
display.getSystemColor(SWT.COLOR_WHITE), "Vert ", true, null);
vertChk.setSelection(tvsCfgMgr.getScanTvsCfgXML().getFilterOption());
vertChk.setLayoutData(gd);
vertChk.setEnabled(false);
/*
* The vertical table is a techblocked DR. This selection listener will
* be commented out until it is needed.
* Tool tips
*/
// vertChk.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// }
// });
setupButtonMouseListeners(vertChk);
tipsChk = createCheckLabelComposite(controlComp,
scanCfg.getScanColor(ScanColors.Tips),
display.getSystemColor(SWT.COLOR_WHITE), "Tips ", true, null);
gd = new GridData();
tipsChk = new Button(controlComp, SWT.CHECK);
tipsChk.setText("Tips ");
tipsChk.setBackground(scanCfg.getScanColor(ScanColors.Tips));
tipsChk.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
tipsChk.setSelection(tvsCfgMgr.getScanTvsCfgXML().getTipsOption());
tipsChk.setLayoutData(gd);
tipsChk.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -287,8 +282,10 @@ public class SCANTvsTableDlg extends AbstractTableDlg implements
scanTableComp.updateColumnTips();
}
});
setupButtonMouseListeners(tipsChk);
/*
* Time
*/
gd = new GridData(SWT.RIGHT, SWT.CENTER, true, true);
gd.widthHint = 160;
timeLbl = new Label(controlComp, SWT.RIGHT);

View file

@ -277,6 +277,14 @@ public abstract class TableComp extends Composite {
// Draw a top line
event.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
// Draw a bottom line if this is the last row of the table
TableItem ti = (TableItem) event.item;
int idx = table.indexOf(ti);
if (idx == table.getItemCount() - 1) {
event.gc.drawLine(rect.x, rect.y + rect.height - 2, rect.x
+ rect.width, rect.y + rect.height - 2);
}
if (tableIndex >= 0) {
event.gc.setForeground(parent.getDisplay().getSystemColor(
SWT.COLOR_BLUE));

View file

@ -37,7 +37,9 @@ import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.printing.PrintDialog;
@ -85,6 +87,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 04OCT2012 1229 rferrel Changes for non-blocking WindRoseConfigDlg.
* 08OCT2012 1229 rferrel Made non-blocking.
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
* 03Dec2013 16754 zhao Modified printImage()
*
* </pre>
*
@ -734,20 +737,36 @@ public class WindRosePlotDlg extends CaveSWTDialog {
}
private void printImage() {
Image image = windRoseCanvasComp.getWindRoseImage();
ImageData imageData = image.getImageData();
PrintDialog dialog = new PrintDialog(shell, SWT.NULL);
PrinterData printerData = dialog.open();
if (printerData != null) {
// Create the printer object
Printer printer = new Printer(printerData);
Point screenDPI = shell.getDisplay().getDPI();
Point printerDPI = printer.getDPI();
Rectangle bounds = printer.getBounds();
int destX = (screenDPI.x*bounds.width - printerDPI.x*imageData.width)/screenDPI.x/2;
if (destX < 0) {
destX = 0;
}
int destY = (screenDPI.x*bounds.height - printerDPI.x*imageData.height)/screenDPI.x*80/100/2;
if (destY < 0) {
destY = 0;
}
printer.startJob("jj");
GC gc = new GC(printer);
Image printerImage = new Image(printer, imageData);
if (printer.startPage()) {
windRoseCanvasComp.drawCanvas(gc);
gc.drawImage(printerImage, 0, 0, imageData.width, imageData.height, destX, destY,
printerDPI.x*imageData.width/screenDPI.x,
printerDPI.x*imageData.height/screenDPI.x);
printer.endPage();
}
printerImage.dispose();
gc.dispose();
printer.endJob();
printer.dispose();

View file

@ -24,11 +24,12 @@
#------*-python-*-------------------------------------------------------------
# Config file for the GFE (Graphical Forecast Editor).
#
# $Id$
#-----------------------------------------------------------------------------
# Heading
#-----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/20/2013 2488 randerso Changed to use DejaVu fonts
GFESUITE_HOME = "/awips2/GFESuite"
GFESUITE_PRDDIR = "/tmp/products"
@ -262,11 +263,11 @@ MapBackgrounds_default = ['States','CWA']
# style is a font style (one of "regular", "bold", "italic", or "bold italic")
# height is an integer representing the font height.
# Example: Times New Roman-bold-36.
TextFont0 = "Bitstream Vera Sans Mono-regular-9"
TextFont1 = "Bitstream Vera Sans Mono-regular-9"
TextFont2 = "Bitstream Vera Sans Mono-bold-12"
TextFont3 = "Bitstream Vera Sans Mono-bold-14"
TextFont4 = "Bitstream Vera Sans Mono-bold-20"
TextFont0 = "DejaVu Sans Mono-regular-9"
TextFont1 = "DejaVu Sans Mono-regular-9"
TextFont2 = "DejaVu Sans Mono-bold-12"
TextFont3 = "DejaVu Sans Mono-bold-14"
TextFont4 = "DejaVu Sans Mono-bold-20"
# The color which will be used as the background for all of the display
# panes.

View file

@ -25,11 +25,19 @@
# quite finished yet - or have finished only recently.
#
# 2010/04/23 ryu Initial port to AWIPS II.
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/21/13 16770 ryu Change name of temporary files
# for dual domain.
#
#=============================================================================
#
# Do not show this in any menu. Should only be run via runProcedure after
# putting the parms to save in /tmp/FILE (one on each line)
# putting the parms to save in /tmp/<siteId>_FILE (one on each line)
#
#MenuItems = ["Verify"]
#
@ -84,7 +92,7 @@ class Procedure (SmartScript.SmartScript):
# Read the parms from the FILE file
#
parmlist=[]
filename="/tmp/%s"%FILE
filename="/tmp/%s_%s"% (self.getSiteID(), FILE)
if ((os.path.exists(filename)) and (os.path.isfile(filename))):
try:
infile=file(filename,"r")

View file

@ -23,10 +23,18 @@
# 2008/05/28 - version 2.0.5 - bugfix for basetime/starttime when an
# archived grid is constant.
#
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/21/13 16770 ryu Change name of temporary files
# for dual domain.
#=============================================================================
#
# Do not show this in any menu. Should only be run via runProcedure after
# putting the force flag and model to correct in /tmp/FILE
# putting the force flag and model to correct in /tmp/<siteId>_FILE
#
#MenuItems = ["Verify"]
#
@ -97,7 +105,7 @@ class Procedure (SmartScript.SmartScript):
force="0"
model=""
obsmodel=""
filename="/tmp/%s"%FILE
filename="/tmp/%s_%s"% (self.getSiteID(), FILE)
if ((os.path.exists(filename))and(os.path.isfile(filename))):
try:
infile=file(filename,"r")

View file

@ -23,10 +23,18 @@
# this procedure is run via runProcedure.
#
# 2010/04/23 ryu Initial port to AWIPS II.
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/21/13 16770 ryu Change name of temporary files
# for dual domain.
#=============================================================================
#
# Do not show this in any menu. Should only be run via runProcedure after
# putting the model to save in /tmp/FILE
# putting the model to save in /tmp/<siteId>_FILE
#
#MenuItems = ["Verify"] # for debug
#
@ -739,7 +747,7 @@ class Procedure (SmartScript.SmartScript):
#==================================================================
#
# getSaveModels - get list of models to save. First try reading
# the model name from /tmp/$FILE. If not there -
# the model name from /tmp/<siteId>_$FILE. If not there -
# get list of all models in the
# BOIVerify system except Official and ISC
#
@ -749,7 +757,7 @@ class Procedure (SmartScript.SmartScript):
#
# Read the model from the FILE file
#
filename="/tmp/%s"%FILE
filename="/tmp/%s_%s"% (self.getSiteID(), FILE)
if ((os.path.exists(filename))and(os.path.isfile(filename))):
try:
infile=file(filename,"r")

View file

@ -13,6 +13,14 @@
# 2007/10/x25 - version 2.0 - original implementation of this program
#
# 2010/04/23 ryu Initial port to AWIPS II.
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 11/21/13 16770 ryu Change name of temporary files
# for dual domain.
#=====================================================================
#
# S T A R T C O N F I G U R A T I O N S E C T I O N
@ -56,11 +64,6 @@ MODLIST=["Official","MOSGuideBC","MOSGuide","GFS40","GFS40BC",
#
EMAIL_FROM_ADDRESS="nobody.nobody@noaa.gov"
#
# Temporary file where e-mail output is kept. This is automatically
# deleted after the commands below are executed.
#
EMAIL_TEMP_FILE="/tmp/temp_email.txt"
#
# Commands to be executed to send the temporary e-mail file.
# You probably need to reference the EMAIL_TEMP_FILE you
# specified above. This works on a typical AWIPS setup, where it
@ -68,9 +71,9 @@ EMAIL_TEMP_FILE="/tmp/temp_email.txt"
# then does a sendmail command on ls1, and then deletes the temporary
# file on ls1.
#
EMAIL_CMDS=["scp /tmp/temp_email.txt ldad@ls1-boi:/tmp/temp_email.txt",
"ssh ldad@ls1-boi sendmail -t </tmp/temp_email.txt",
"ssh ldad@ls1-boi rm /tmp/temp_email.txt",
EMAIL_CMDS=["scp /tmp/{FILE} ldad@ls1:/tmp/{FILE}",
"ssh ldad@ls1 sendmail -t </tmp/{FILE}",
"ssh ldad@ls1 rm /tmp/{FILE}",
]
#
# Always sends summary to these addresses - even if they were not
@ -102,10 +105,10 @@ SAVE_DIR="/tmp"
# output is created. You can put "{FILE}" in these and it will be
# replaced with the filename before execution.
#
SAVE_CMDS=["scp /tmp/{FILE} ldad@ls1-boi:/tmp/{FILE}",
"ssh ldad@ls1-boi chmod 666 /tmp/{FILE}",
"ssh ldad@ls1-boi cp /tmp/{FILE} /lanfiles/GridVer/{FILE}",
"ssh ldad@ls1-boi rm /tmp/{FILE}",
SAVE_CMDS=["scp /tmp/{FILE} ldad@ls1:/tmp/{FILE}",
"ssh ldad@ls1 chmod 666 /tmp/{FILE}",
"ssh ldad@ls1 cp /tmp/{FILE} /lanfiles/GridVer/{FILE}",
"ssh ldad@ls1 rm /tmp/{FILE}",
]
#
#
@ -159,7 +162,7 @@ class Procedure (SmartScript.SmartScript):
self.obsModel=OBSMODEL
grid=self._empty
#
# See if a time is provided in a /tmp/SumTemps.time file
# See if a time is provided in a /tmp/<siteId>_SumTemps.time file
# or otherwise get the current system time
#
now=self.getNow()
@ -249,8 +252,8 @@ class Procedure (SmartScript.SmartScript):
# Save the clean output for use on webpages
#
(vyea,vmon,vday,vhou,vmin,vsec,vwda,vyda,vdst)=time.gmtime(verifday)
outname="%4.4d%2.2d%2.2d_%s.html"%(vyea,vmon,vday,parm)
fullname="%s/%s"%(SAVE_DIR,outname)
outname="%s_%4.4d%2.2d%2.2d_%s.html"%(self.getSiteID(),vyea,vmon,vday,parm)
fullname="%s/%s_%s"%(SAVE_DIR, outname)
outfile=file(fullname,"w")
outfile.write(cleanoutput)
outfile.close()
@ -265,7 +268,7 @@ class Procedure (SmartScript.SmartScript):
return
#==================================================================
# getNow - sees if there is a specified time in the
# /tmp/SumTemps.time file. If no file exists, or there
# /tmp/<siteId>_SumTemps.time file. If no file exists, or there
# is trouble reading file, it uses the current system
# time as 'now'.
#
@ -277,7 +280,7 @@ class Procedure (SmartScript.SmartScript):
#
# If the file doesn't exist or isn't a real file...return
#
timeFile="/tmp/SumTemps.time"
timeFile="/tmp/%s_SumTemps.time" % self.getSiteID()
if not os.path.exists(timeFile):
return now
if not os.path.isfile(timeFile):
@ -363,6 +366,8 @@ class Procedure (SmartScript.SmartScript):
(gyea,gmon,gday,ghou,gmin,gsec,gwda,gyda,gdst)=time.gmtime(verifday)
subject="%s verification for %s, %s %d, %4.4d"%(parm,DAYS[gwda],
MONS[gmon-1],gday,gyea)
EMAIL_TEMP_FILE="/tmp/%s_temp_email.txt" % self.getSiteID()
outfile=open(EMAIL_TEMP_FILE,"w")
outfile.write("To:%s\n"%to)
outfile.write("From:%s\n"%EMAIL_FROM_ADDRESS)
@ -372,7 +377,8 @@ class Procedure (SmartScript.SmartScript):
outfile.close()
if len(EMAIL_CMDS)>0:
for cmd in EMAIL_CMDS:
os.system(cmd)
newcmd=cmd.replace("{FILE}", EMAIL_TEMP_FILE)
os.system(newcmd)
#os.system("rm %s"%EMAIL_TEMP_FILE)
return
#==================================================================

View file

@ -63,10 +63,11 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 26, 2011 randerso Initial creation
* Oct 26, 2011 randerso Initial creation
* Oct 30, 2012 1298 rferrel Code clean for non-blocking dialog.
* 02/13/2013 #1597 randerso Made number of concurrent save threads a configurable value.
* Feb 13, 2013 1597 randerso Made number of concurrent save threads a configurable value.
* Added logging to support GFE Performance metrics
* Nov 20, 2013 2488 randerso Changed to use DejaVu font
*
* </pre>
*
@ -127,7 +128,8 @@ public abstract class AbstractSaveParameterDialog extends CaveJFACEDialog
master.addDisposeListener(this);
FontData fd = master.getDisplay().getSystemFont().getFontData()[0];
fd.setName("Bitstream Vera Sans Mono");
// TODO not have hard coded font name
fd.setName("DejaVu Sans Mono");
font = new Font(master.getDisplay(), fd);
initializeComponents();

View file

@ -57,8 +57,9 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 21, 2011 randerso Initial creation
* Jan 21, 2011 randerso Initial creation
* Oct 25, 2012 1287 rferrel Code clean up for non-blocking dialog.
* Nov 20, 2013 2488 randerso Changed to use DejaVu font
*
* </pre>
*
@ -107,7 +108,8 @@ public class WERevertDialog extends CaveJFACEDialog implements DisposeListener {
master.addDisposeListener(this);
FontData fd = master.getDisplay().getSystemFont().getFontData()[0];
fd.setName("Bitstream Vera Sans Mono");
// TODO not have hard coded font name
fd.setName("DejaVu Sans Mono");
font = new Font(master.getDisplay(), fd);
String t;

View file

@ -65,6 +65,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.dialogs.formatterlauncher.ProductEditorComp.PTypeCategory;
import com.raytheon.viz.gfe.rsc.GFEFonts;
import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
/**
@ -210,10 +211,12 @@ public class StyledTextComp extends Composite {
private void init() {
String fontSetting = Activator.getDefault().getPreferenceStore()
.getString("ProductOutputDialog_font");
FontData fontData;
if (fontSetting.isEmpty()) {
fontSetting = "Bitstream Vera Sans Mono-bold-12";
fontData = GFEFonts.getFontData(2);
} else {
fontData = StringConverter.asFontData(fontSetting);
}
FontData fontData = StringConverter.asFontData(fontSetting);
textFont = new Font(parent.getDisplay(), fontData);
createMouseListner();
@ -573,7 +576,7 @@ public class StyledTextComp extends Composite {
replaceText(ff, SPC + newfield);
}
} else {
String s = SPC + newfield;
String s = SPC + newfield;
if (!ff.getText().equals(s)) {
replaceText(ff, s);
}
@ -1350,7 +1353,7 @@ public class StyledTextComp extends Composite {
line = st.getLine(searchLine);
int lineOffset = st.getOffsetAtLine(searchLine);
// if line contains locked text, quit looking.
// if line contains locked text, quit looking.
if (rangeHasLockedText(lineOffset, line.length())) {
break;
}
@ -1407,7 +1410,7 @@ public class StyledTextComp extends Composite {
if (endIndex >= st.getCharCount()) {
endIndex = st.getCharCount() - 1;
}
if (endIndex < startIndex) {
return new int[] { startIndex, endIndex, 0 };
}

View file

@ -46,6 +46,7 @@ import com.raytheon.viz.gfe.GFEPreference;
* Apr 27, 2011 #9250 bkowal getStyle and getName are now used to
* get the style and name associated with
* a FontData object.
* Nov 20, 2013 #2488 randerso Changed to use DejaVu fonts
*
* </pre>
*
@ -57,9 +58,9 @@ public class GFEFonts {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(GFEFonts.class);
private static final String DEFAULT_FONT_NAME = "Bitstream Vera Sans";
private static final String DEFAULT_FONT_NAME = "DejaVu Sans Mono";
private static final int[] DEFAULT_FONT_SIZE = { 8, 10, 12, 14, 20 };
private static final int[] DEFAULT_FONT_SIZE = { 9, 9, 12, 14, 20 };
private static final int DEFAULT_FONT_STYLE = SWT.BOLD;

View file

@ -140,4 +140,12 @@
</menu>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.themes">
<fontDefinition
id="com.raytheon.viz.radar.rsc.graphic.RadarGraphicsPage"
label="Radar Graphics Font"
value="Monospaced-regular-12">
</fontDefinition>
</extension>
</plugin>

View file

@ -19,13 +19,12 @@
**/
package com.raytheon.viz.radar.rsc.graphic;
import java.io.File;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.awt.image.BufferedImage;
import javax.measure.converter.UnitConverter;
import javax.measure.unit.NonSI;
@ -42,8 +41,8 @@ import com.raytheon.uf.common.dataplugin.radar.level3.CellTrendDataPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.CellTrendVolumeScanPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.CorrelatedShearPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.DMDPacket.DMDAttributeIDs;
import com.raytheon.uf.common.dataplugin.radar.level3.GFMPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.ETVSPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.GFMPacket;
import com.raytheon.uf.common.dataplugin.radar.level3.HailPositivePacket;
import com.raytheon.uf.common.dataplugin.radar.level3.HailProbablePacket;
import com.raytheon.uf.common.dataplugin.radar.level3.HdaHailPacket;
@ -78,20 +77,19 @@ import com.raytheon.uf.common.dataplugin.radar.level3.generic.GenericDataCompone
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.geospatial.ReferencedGeometry;
import com.raytheon.uf.common.geospatial.ReferencedObject.Type;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.viz.core.DrawableLine;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.IGraphicsTarget.LineStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.data.prep.IODataPreparer;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.IRenderable;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.drawables.ext.ICanvasRenderingExtension;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
import com.raytheon.viz.pointdata.PointWindDisplay;
@ -121,6 +119,7 @@ import com.vividsolutions.jts.geom.LineString;
* Jan 8, 2009 chammack Initial creation
* 03/05/2013 DCS51 zwang Handle GFM product
* 06/24/2013 DR16162 zwang Remove "wind behind"
* 11/20/2013 2488 randerso Removed use of VeraMono font file
*
* </pre>
*
@ -143,7 +142,7 @@ public class RadarGraphicsPage implements IRenderable {
private JTSCompiler compiler;
private IWireframeShape wireframeShape;
private IWireframeShape gfmFcstWireframeShape;
/** Map of ascii strings in local coordinate system */
@ -190,14 +189,15 @@ public class RadarGraphicsPage implements IRenderable {
private boolean drawBorder = false;
private int recordsPerPage = 5;
// for GFM product, add gfmFcstWireframeShape
public RadarGraphicsPage(IDescriptor descriptor, GeneralGridGeometry gg,
IWireframeShape shape, IWireframeShape gfmShape, IGraphicsTarget target, RGB color) {
IWireframeShape shape, IWireframeShape gfmShape,
IGraphicsTarget target, RGB color) {
this(descriptor, gg, shape, target, color);
this.gfmFcstWireframeShape = gfmShape;
}
public RadarGraphicsPage(IDescriptor descriptor, GeneralGridGeometry gg,
IWireframeShape shape, IGraphicsTarget target, RGB color,
DmdModifier tableModifier) {
@ -467,10 +467,10 @@ public class RadarGraphicsPage implements IRenderable {
}
}
// GFM
else if (type == 140) {
List<PlotObject> gfmImages = new ArrayList<PlotObject>();
else if (type == 140) {
List<PlotObject> gfmImages = new ArrayList<PlotObject>();
// Handle each Feature in the GFM Packet
// Handle each Feature in the GFM Packet
for (GenericDataComponent currComponent : stormData
.getDisplayGenericPointData().get(type).values()) {
// Handle Graphic portion
@ -892,104 +892,113 @@ public class RadarGraphicsPage implements IRenderable {
// Handle GFM product
private List<PlotObject> getGfmImage(GenericDataComponent currPt)
throws VizException {
throws VizException {
List<PlotObject> images = new ArrayList<PlotObject>();
UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND.getConverterTo(NonSI.KNOT);
UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND
.getConverterTo(NonSI.KNOT);
boolean isFcst = false;
double x,y;
double x, y;
Coordinate pos1, pos2;
int imgSize = 64;
AreaComponent currFeature = (AreaComponent) currPt;
int numPoints = currFeature.getPoints().size();
int numParam = currFeature.getParameters().size();
String propU, propV, windX, windY;
double pU = 0.0;
double pV = 0.0;
double pV = 0.0;
double wX = 0.0;
double wY = 0.0;
// if the component only has dectect ID and DeltaT
if (numParam == 2) {
isFcst = true;
isFcst = true;
}
// 11 parameters
else {
propU = currFeature.getValue(GFMPacket.GFMAttributeIDs.PROPU.getName());
if ((propU != null) && (propU.length() > 0)) {
pU = metersPerSecondToKnots.convert(new Double(propU));
}
propV = currFeature.getValue(GFMPacket.GFMAttributeIDs.PROPV.getName());
if ((propV != null) && (propV.length() > 0)) {
pV = metersPerSecondToKnots.convert(new Double(propV));
}
windX = currFeature.getValue(GFMPacket.GFMAttributeIDs.WINDBEHINDX.getName());
if ((windX != null) && (windX.length() > 0)) {
wX = Float.parseFloat(windX);
}
windY = currFeature.getValue(GFMPacket.GFMAttributeIDs.WINDBEHINDY.getName());
if ((windY != null) && (windY.length() > 0)) {
wY = Float.parseFloat(windY);
}
// Get the nearest point on the MIGFA front to the wind behind point
// Plot front movement arrow at this point
Coordinate windBehind = new Coordinate(wX, wY);
Coordinate plotPoint = getPlotPoint(currFeature, windBehind);
wX = plotPoint.x;
wY = plotPoint.y;
// Prop wind arrow
PlotObject poWind = new PlotObject();
PointWindDisplay barb = new PointWindDisplay(imgSize * 0.4, 0.5, 2, 0);
barb.setImageParameters(imgSize, imgSize, 255, 255, 255, 1);
barb.setColor(this.color);
// plot the wind arrow in the same length as 50 kts
double spd = Math.sqrt(pU * pU + pV * pV);
if (spd > 0) {
pU *= 50.0 / spd;
pV *= 50.0 / spd;
}
barb.setWind(pU, pV, false);
BufferedImage imgBuf = barb.getWindImage(false, DisplayType.ARROW, 0.2);
IImage img = this.target.initializeRaster(new IODataPreparer(imgBuf, UUID.randomUUID().toString(), 0), null);
poWind.image = img;
ReferencedCoordinate rc = referencedGfmCoord(wX, wY);
try {
poWind.coord = rc.asPixel(this.descriptor.getGridGeometry());
poWind.pixelOffset = new int[] { 0, 0 };
images.add(poWind);
} catch (Exception e) {
throw new VizException("Unable to transform coordinates", e);
}
propU = currFeature.getValue(GFMPacket.GFMAttributeIDs.PROPU
.getName());
if ((propU != null) && (propU.length() > 0)) {
pU = metersPerSecondToKnots.convert(new Double(propU));
}
propV = currFeature.getValue(GFMPacket.GFMAttributeIDs.PROPV
.getName());
if ((propV != null) && (propV.length() > 0)) {
pV = metersPerSecondToKnots.convert(new Double(propV));
}
windX = currFeature.getValue(GFMPacket.GFMAttributeIDs.WINDBEHINDX
.getName());
if ((windX != null) && (windX.length() > 0)) {
wX = Float.parseFloat(windX);
}
windY = currFeature.getValue(GFMPacket.GFMAttributeIDs.WINDBEHINDY
.getName());
if ((windY != null) && (windY.length() > 0)) {
wY = Float.parseFloat(windY);
}
// Get the nearest point on the MIGFA front to the wind behind point
// Plot front movement arrow at this point
Coordinate windBehind = new Coordinate(wX, wY);
Coordinate plotPoint = getPlotPoint(currFeature, windBehind);
wX = plotPoint.x;
wY = plotPoint.y;
// Prop wind arrow
PlotObject poWind = new PlotObject();
PointWindDisplay barb = new PointWindDisplay(imgSize * 0.4, 0.5, 2,
0);
barb.setImageParameters(imgSize, imgSize, 255, 255, 255, 1);
barb.setColor(this.color);
// plot the wind arrow in the same length as 50 kts
double spd = Math.sqrt(pU * pU + pV * pV);
if (spd > 0) {
pU *= 50.0 / spd;
pV *= 50.0 / spd;
}
barb.setWind(pU, pV, false);
BufferedImage imgBuf = barb.getWindImage(false, DisplayType.ARROW,
0.2);
IImage img = this.target.initializeRaster(new IODataPreparer(
imgBuf, UUID.randomUUID().toString(), 0), null);
poWind.image = img;
ReferencedCoordinate rc = referencedGfmCoord(wX, wY);
try {
poWind.coord = rc.asPixel(this.descriptor.getGridGeometry());
poWind.pixelOffset = new int[] { 0, 0 };
images.add(poWind);
} catch (Exception e) {
throw new VizException("Unable to transform coordinates", e);
}
}
// Draw GFM fronts
x = currFeature.getPoints().get(0).getCoordinate1();
y = currFeature.getPoints().get(0).getCoordinate2();
try {
pos1 = referencedGfmCoord(x, y).asLatLon();
for (int k = 1; k < numPoints; k++) {
x = currFeature.getPoints().get(k).getCoordinate1();
y = currFeature.getPoints().get(k).getCoordinate2();
//convert xy to latlon
pos2 = referencedGfmCoord(x, y).asLatLon();
// convert xy to latlon
pos2 = referencedGfmCoord(x, y).asLatLon();
// Connect the dots
if (isFcst) {
gfmFcstWireframeShape.addLineSegment(new Coordinate[] {pos1, pos2 });
}
else {
wireframeShape.addLineSegment(new Coordinate[] {pos1, pos2 });
gfmFcstWireframeShape.addLineSegment(new Coordinate[] {
pos1, pos2 });
} else {
wireframeShape
.addLineSegment(new Coordinate[] { pos1, pos2 });
}
pos1 = pos2;
}
@ -1000,7 +1009,7 @@ public class RadarGraphicsPage implements IRenderable {
}
return images;
}
private PlotObject getImage(HdaHailPoint currPt) throws VizException {
PlotObject image = null;
@ -1190,9 +1199,7 @@ public class RadarGraphicsPage implements IRenderable {
public void paint(IGraphicsTarget target, PaintProperties paintProps)
throws VizException {
if (font == null) {
File fontFile = PathManagerFactory.getPathManager().getStaticFile(
"fonts" + File.separator + "VeraMono.ttf");
this.font = target.initializeFont(fontFile, 12.0f, null);
this.font = target.initializeFont(getClass().getName());
this.font.setMagnification((float) magnification, false);
this.font.setSmoothing(true);
}
@ -1201,9 +1208,9 @@ public class RadarGraphicsPage implements IRenderable {
// GFM forecast positions should be dashed thick lines
if (this.gfmFcstWireframeShape != null) {
target.drawWireframeShape(this.wireframeShape, this.color, 3.0f);
target.drawWireframeShape(this.gfmFcstWireframeShape, this.color, 3.0f, LineStyle.DASHED);
}
else if (this.wireframeShape != null) {
target.drawWireframeShape(this.gfmFcstWireframeShape, this.color,
3.0f, LineStyle.DASHED);
} else if (this.wireframeShape != null) {
target.drawWireframeShape(this.wireframeShape, this.color, 1.0f);
}
@ -1478,35 +1485,36 @@ public class RadarGraphicsPage implements IRenderable {
this.tableX = this.startTableX;
this.tableY = this.startTableY;
}
/**
* Need to convert x/y to lon/lat for GFM product
*/
public ReferencedCoordinate referencedGfmCoord(double i, double j) {
return new ReferencedCoordinate(rectifyCoordinate(new Coordinate(i * 4, j * 4)),
this.gridGeometry, Type.GRID_CENTER);
return new ReferencedCoordinate(rectifyCoordinate(new Coordinate(i * 4,
j * 4)), this.gridGeometry, Type.GRID_CENTER);
}
/**
* Gets the nearest point from GFM front to wind behind point to plot
* front movement arrow
* Gets the nearest point from GFM front to wind behind point to plot front
* movement arrow
*
* @param AreaComponent
* @param Coordinate
* @return Coordinate
*
*/
private Coordinate getPlotPoint(AreaComponent currFeature, Coordinate windBehind) {
private Coordinate getPlotPoint(AreaComponent currFeature,
Coordinate windBehind) {
Coordinate point = new Coordinate();
double minDist = Double.MAX_VALUE;
int numPoints = currFeature.getPoints().size();
double x1 = windBehind.x;
double y1 = windBehind.y;
double x2 = 0.0;
double y2 = 0.0;
double dist = 0.0;
for (int k = 0; k < numPoints; k++) {
x2 = currFeature.getPoints().get(k).getCoordinate1();
y2 = currFeature.getPoints().get(k).getCoordinate2();
@ -1517,8 +1525,8 @@ public class RadarGraphicsPage implements IRenderable {
minDist = dist;
}
}
return point;
}
}

View file

@ -60,7 +60,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* uses the font.
* Feb 03, 2012 14317 mhuang Make alarm display window wider
* Sep 6, 2012 13365 rferrel Accumulate and Display fix.
* Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow.Added DO_NOT_BLOCK.
* Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow.Added DO_NOT_BLOCK.
* Nov 20, 2013 2488 randerso Changed to use DejaVu font
*
* </pre>
*
@ -127,7 +128,8 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
shell.setMinimumSize(300, 100);
FontData fd = shell.getDisplay().getSystemFont().getFontData()[0];
fd.setName("Bitstream Vera Sans Mono");
// TODO not have hard coded font name
fd.setName("DejaVu Sans Mono");
font = new Font(shell.getDisplay(), fd);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
@ -207,7 +209,7 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
@Override
public void widgetSelected(SelectionEvent event) {
PrintDisplay.print(text.getText(),
text.getFont().getFontData()[0],
text.getFont().getFontData()[0],
UFStatus.getHandler(AlarmDisplayWindow.class));
}
});

View file

@ -19,11 +19,10 @@
**/
package com.raytheon.viz.texteditor.alarmalert.util;
import java.awt.Toolkit;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.progress.UIJob;
/**
@ -36,6 +35,8 @@ import org.eclipse.ui.progress.UIJob;
* ------------ ---------- ----------- --------------------------
* Oct 19, 2009 mnash Initial creation
* Jul 25, 2012 15122 rferrel Add sound repeat interval.
* Nov 26, 2013 16781 mgamazaychikov Changed AWT Toolkit.getDefaultToolkit().beep to
* SWT Display.beep()
*
* </pre>
*
@ -78,7 +79,7 @@ public class AlarmBeepJob extends UIJob {
public IStatus runInUIThread(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
if (count < BEEP_COUNT) {
Toolkit.getDefaultToolkit().beep();
Display.getCurrent().beep();
if (!disposed) {
this.schedule(BEEP_INTERVAL);
}

View file

@ -97,7 +97,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* invalid product Id and user want to edit it anyway.
* 09/20/2012 1196 rferrel Changing dialogs being called to not block.
* 11/26/2012 14526 mgamazaychikov Added traverse listener for RETURN key
* 10/07/2012 16664 mgamazaychikov Added padProdDesignatorText method
* 10/07/2013 16664 mgamazaychikov Added padProdDesignatorText method
* 11/21/2013 16633 mgamazaychikov Improved consistency between AFOS PIL and WMO Heading fields.
* </pre>
*
* @author lvenable
@ -1012,6 +1013,17 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
}
}
// reset WMO Heading or AFOS PIL sections to
// make the sections consistent with each other
boolean afosReset = isAfosResetRequired();
boolean wmoidReset = isWmoidResetRequired();
if (callAfosLookup && afosReset) {
setAfosId(null);
}
if (!callAfosLookup && wmoidReset) {
setWmoId("", "");
}
if (!isDisposed()) {
if (tf.getCaretOffset() == tf.getTextLimit()) {
nextTF.setFocus();
@ -1051,4 +1063,31 @@ public class AWIPSHeaderBlockDlg extends CaveSWTDialog implements
});
}
private boolean isAfosResetRequired() {
// returns true if changes are made to WMO Heading for a complete AFOS PIL
boolean wmoSectionComplete = isWmoHeadingComplete();
boolean afosPilComplete = isAfosPilComplete();
return afosPilComplete && !wmoSectionComplete && lookupAllowed;
}
private boolean isWmoidResetRequired() {
// returns true if changes are made to AFOS PIL for a complete WMO Heading
boolean wmoSectionComplete = isWmoHeadingComplete();
boolean afosPilComplete = isAfosPilComplete();
return !afosPilComplete && wmoSectionComplete && lookupAllowed;
}
private boolean isWmoHeadingComplete() {
// returns true for a complete WMO Heading
return wmoTtaaiiTF.getText().length() == wmoTtaaiiTF.getTextLimit() &&
ccccTF.getText().length() == ccccTF.getTextLimit();
}
private boolean isAfosPilComplete() {
// returns true for a complete AFOS PIL
return wsfoIdTF.getText().length() == wsfoIdTF.getTextLimit() &&
prodCatTF.getText().length() == prodCatTF.getTextLimit() &&
prodDesignatorTF.getText().length() == prodDesignatorTF.getTextLimit();
}
}

View file

@ -120,6 +120,7 @@ import com.raytheon.uf.common.dataplugin.text.db.StdTextProductId;
import com.raytheon.uf.common.dataplugin.text.request.RemoteRetrievalRequest;
import com.raytheon.uf.common.dataplugin.text.request.StdTextProductServerRequest;
import com.raytheon.uf.common.dataplugin.text.request.TextProductInfoCreateRequest;
import com.raytheon.uf.common.dissemination.OUPTestRequest;
import com.raytheon.uf.common.dissemination.OUPRequest;
import com.raytheon.uf.common.dissemination.OUPResponse;
import com.raytheon.uf.common.dissemination.OfficialUserProduct;
@ -331,6 +332,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 12Sep2013 DR 2249 rferrel Change Time stamp in file name created by warngen to use
* simulated time.
* 20Sep2013 #2394 lvenable Fixed color memory leaks.
* 20Nov2013 DR 16777 D. Friedman Check if OUPRequest will work before setting ETN.
* </pre>
*
* @author lvenable
@ -4937,53 +4939,61 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
removeOptionalFields();
try {
/* update the vtec string in the message */
// DR14553 (make upper case in product)
if (!resend) {
body = VtecUtil.getVtec(removeSoftReturns(textEditor
.getText().toUpperCase()), true);
}
updateTextEditor(body);
if ((inEditMode || resend)
&& saveEditedProduct(false, resend, true)) {
inEditMode = false;
}
if (!resend) {
StdTextProduct prod = getStdTextProduct();
OUPTestRequest testReq = new OUPTestRequest();
testReq.setOupRequest(
createOUPRequest(prod, prod.getProduct()));
try {
OUPResponse checkResponse = (OUPResponse)
ThriftClient.sendRequest(testReq);
if (checkResponse.hasFailure()) {
statusHandler.handle(Priority.PROBLEM,
"Error during text product transmission check: "
+ checkResponse.getMessage());
inEditMode = true;
return;
}
} catch (VizException e) {
statusHandler.handle(Priority.PROBLEM,
"Error during text product transmission check", e);
inEditMode = true;
return;
}
/* Update the vtec string in the message. It looks wrong to
* do this after saveEditedProduct, but it works because
* for this case (isOpertional && ! resend) case, saveEditedProduct,
* does not actually save anything. */
prod.setProduct(
VtecUtil.getVtec(removeSoftReturns(prod.getProduct()), true));
/*
* This silly bit of code updates the ETN of a VTEC in the
* text pane to reflect the ETN that was actually used, but
* not update any other parts of the text even though they
* may have also been changed just before the product was
* sent.
*
* A1 works similarly.
*/
updateTextEditor(copyEtn(prod.getProduct(), body));
}
String product = TextDisplayModel.getInstance().getProduct(
token);
OUPRequest req = new OUPRequest();
OfficialUserProduct oup = new OfficialUserProduct();
StdTextProduct prod = getStdTextProduct(); // TODO: makes me
// nervous...
String awipsWanPil = prod.getSite() + prod.getNnnid()
+ prod.getXxxid();
String awipsID = prod.getNnnid() + prod.getXxxid();
// TODO: Should not need to call getProduct and the like twice.
StdTextProduct prod = getStdTextProduct();
OUPRequest req = createOUPRequest(prod, product);
if (notify != null) {
notify.add(product);
}
oup.setAwipsWanPil(awipsWanPil);
oup.setNeedsWmoHeader(false);
oup.setProductText(product);
oup.setSource("TextWS");
oup.setWmoType(fixNOR(prod.getBbbid()));
oup.setUserDateTimeStamp(prod.getHdrtime());
StringBuilder fileName = new StringBuilder();
// The .wan extension followed by the 10 digit epoch seconds
// of simulated time is used in EDEX's WarningDecoder to
// determine the base time.
fileName.append(awipsID).append(".wan")
.append(TimeUtil.getUnixTime(TimeUtil.newDate()));
oup.setFilename(fileName.toString());
oup.setAddress(addressee);
if ((attachedFile != null) && (attachedFilename != null)) {
oup.setAttachedFile(attachedFile);
oup.setAttachedFilename(attachedFilename);
}
req.setCheckBBB(true);
req.setProduct(oup);
req.setUser(UserController.getUserObject());
// Code in Run statement goes here!
new Thread(new ThriftClientRunnable(req)).start();
@ -5035,6 +5045,51 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
}
}
private OUPRequest createOUPRequest(StdTextProduct prod, String text) {
OUPRequest req = new OUPRequest();
OfficialUserProduct oup = new OfficialUserProduct();
String awipsWanPil = prod.getSite() + prod.getNnnid()
+ prod.getXxxid();
String awipsID = prod.getNnnid() + prod.getXxxid();
oup.setAwipsWanPil(awipsWanPil);
oup.setNeedsWmoHeader(false);
oup.setProductText(text);
oup.setSource("TextWS");
oup.setWmoType(fixNOR(prod.getBbbid()));
oup.setUserDateTimeStamp(prod.getHdrtime());
StringBuilder fileName = new StringBuilder();
// The .wan extension followed by the 10 digit epoch seconds
// of simulated time is used in EDEX's WarningDecoder to
// determine the base time.
fileName.append(awipsID).append(".wan")
.append(TimeUtil.getUnixTime(TimeUtil.newDate()));
oup.setFilename(fileName.toString());
oup.setAddress(addressee);
if ((attachedFile != null) && (attachedFilename != null)) {
oup.setAttachedFile(attachedFile);
oup.setAttachedFilename(attachedFilename);
}
req.setCheckBBB(true);
req.setProduct(oup);
req.setUser(UserController.getUserObject());
return req;
}
private static String copyEtn(String from, String to) {
VtecObject fromVtec = VtecUtil.parseMessage(from);
if (fromVtec != null && "NEW".equals(fromVtec.getAction())) {
VtecObject toVtec = VtecUtil.parseMessage(to);
if (toVtec != null) {
toVtec.setSequence(fromVtec.getSequence());
return VtecUtil.replaceFirstVtecString(to, fromVtec);
}
}
return to;
}
/**
* Recreates the original message by combining the header and the body from
* the edit windows.

View file

@ -47,6 +47,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.ISimulatedTimeChangeListener;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.viz.core.mode.CAVEMode;
import com.raytheon.viz.ui.actions.ShowTimeDialog;
@ -64,6 +65,8 @@ import com.raytheon.viz.ui.actions.ShowTimeDialog;
* Nov 30,2007 461 bphillip Initial Creation
* 09JUL2008 1234 ebabin Updates for color, and display issues.
* Jan 09, 2013 1442 rferrel Added Simulated Time Change listener.
* Nov 19, 2013 2439 rferrel Adjust timer schedule to update when
* DRT rolls over to the next minute.
*
* </pre>
*
@ -102,8 +105,10 @@ public class TimeDisplay extends ContributionItem {
td.update();
}
long t = System.currentTimeMillis() % 60000;
this.schedule(60000 - t);
// DR 2439 schedule when simulated time minute changes.
long t = TimeUtil.newDate().getTime()
% TimeUtil.MILLIS_PER_MINUTE;
this.schedule(TimeUtil.MILLIS_PER_MINUTE - t);
}
return Status.OK_STATUS;
@ -158,7 +163,8 @@ public class TimeDisplay extends ContributionItem {
@Override
public void timechanged() {
update();
// Force immediate update and reschedule.
updateJob.wakeUp();
}
};
SimulatedTime.getSystemTime().addSimulatedTimeChangeListener(

View file

@ -312,9 +312,24 @@ public class CurrentWarnings {
public AbstractWarningRecord getNewestByTracking(String etn, String phensig) {
AbstractWarningRecord rval = null;
synchronized (officeId) {
List<AbstractWarningRecord> warnings = warningMap.get(toKey(
List<AbstractWarningRecord> keyWarnings = warningMap.get(toKey(
phensig, etn));
if (warnings != null) {
if (keyWarnings != null) {
// filter out "future" warnings.
List<AbstractWarningRecord> warnings = null;
if (SimulatedTime.getSystemTime().isRealTime()) {
warnings = keyWarnings;
} else {
warnings = new ArrayList<AbstractWarningRecord>(
keyWarnings.size());
long currentTime = TimeUtil.newCalendar().getTimeInMillis();
for (AbstractWarningRecord warning : keyWarnings) {
if (warning.getIssueTime().getTimeInMillis() <= currentTime) {
warnings.add(warning);
}
}
}
// See if we have a NEW warning
for (AbstractWarningRecord warning : warnings) {
if (getAction(warning.getAct()) == WarningAction.NEW) {
@ -399,8 +414,7 @@ public class CurrentWarnings {
if (warnings != null) {
Calendar c = TimeUtil.newCalendar();
c.add(Calendar.MINUTE, -10);
TimeRange t = new TimeRange(c.getTime(), SimulatedTime
.getSystemTime().getTime());
TimeRange t = new TimeRange(c.getTime(), TimeUtil.newDate());
for (AbstractWarningRecord warning : warnings) {
if (t.contains(warning.getIssueTime().getTime())) {
@ -438,8 +452,7 @@ public class CurrentWarnings {
ArrayList<AbstractWarningRecord> conProds = new ArrayList<AbstractWarningRecord>();
Calendar c = TimeUtil.newCalendar();
c.add(Calendar.MINUTE, -10);
TimeRange t = new TimeRange(c.getTime(), SimulatedTime
.getSystemTime().getTime());
TimeRange t = new TimeRange(c.getTime(), TimeUtil.newDate());
for (AbstractWarningRecord warning : warnings) {
WarningAction action = getAction(warning.getAct());
if (t.contains(warning.getIssueTime().getTime())
@ -545,12 +558,20 @@ public class CurrentWarnings {
List<AbstractWarningRecord> records = new ArrayList<AbstractWarningRecord>(
recordsMap.values());
// Sort by insert time
// Sort by issue time when null fall back to insert time.
Collections.sort(records, new Comparator<AbstractWarningRecord>() {
@Override
public int compare(AbstractWarningRecord o1,
AbstractWarningRecord o2) {
return o1.getInsertTime().compareTo(o2.getInsertTime());
Calendar c1 = o1.getIssueTime();
if (c1 == null) {
c1 = o1.getInsertTime();
}
Calendar c2 = o2.getIssueTime();
if (c2 == null) {
c2 = o2.getInsertTime();
}
return c1.compareTo(c2);
}
});
@ -602,7 +623,10 @@ public class CurrentWarnings {
Map<String, List<AbstractWarningRecord>> recordMap = new HashMap<String, List<AbstractWarningRecord>>();
for (AbstractWarningRecord rec : newRecords) {
List<AbstractWarningRecord> recs = recordMap.get(rec.getOfficeid());
// This used the key rec.getOfficeid() which can be null; which
// can drop alerts when more then one new Record.
// Changed to use the same key as the put.
List<AbstractWarningRecord> recs = recordMap.get(rec.getXxxid());
if (recs == null) {
recs = new ArrayList<AbstractWarningRecord>();
recordMap.put(rec.getXxxid(), recs);

View file

@ -2,6 +2,7 @@ package com.raytheon.viz.warnings.rsc;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
@ -26,6 +27,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
@ -80,6 +82,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* Check if geometry is null when inspecting.
* Jul 22, 2013 2176 jsanchez Updated the wire frame and text for EMERGENCY warnings.
* Sep 4, 2013 2176 jsanchez Made the polygon line width thicker and made regular text not bold.
* Nov 11, 2013 2439 rferrel Changes to prevent getting future warning when in DRT mode.
* Dec 3, 2013 2576 jsanchez Increased the font size of EMER.
* </pre>
*
@ -127,7 +130,7 @@ public abstract class AbstractWWAResource extends
protected static PreparedGeometryFactory pgf = new PreparedGeometryFactory();
/** one hour ahead, entirely arbitrary/magic **/
private static final long LAST_FRAME_ADJ = (60 * 60 * 1000);
private static final long LAST_FRAME_ADJ = TimeUtil.MILLIS_PER_HOUR;
protected String resourceName;
@ -209,7 +212,8 @@ public abstract class AbstractWWAResource extends
framePeriod = new TimeRange(time.getRefTime(),
frameTimes[frameIdx + 1].getRefTime());
} else {
framePeriod = new TimeRange(time.getRefTime(), LAST_FRAME_ADJ);
framePeriod = getLastFrameTimeRange(time.getRefTime());
lastFrame = true;
}
@ -330,8 +334,7 @@ public abstract class AbstractWWAResource extends
framePeriod = new TimeRange(thisFrameTime.getRefTime(),
frames[index + 1].getRefTime());
} else {
framePeriod = new TimeRange(thisFrameTime.getRefTime(),
LAST_FRAME_ADJ);
framePeriod = getLastFrameTimeRange(thisFrameTime.getRefTime());
lastFrame = true;
}
synchronized (paintLock) {
@ -466,13 +469,12 @@ public abstract class AbstractWWAResource extends
if (lastFrame) {
// use current system time to determine what to display
Date timeToDisplay = SimulatedTime.getSystemTime().getTime();
Date timeToDisplay = TimeUtil.newDate();
// change frame time
frameTime = timeToDisplay;
// point paint time to different time
paintTime = new DataTime(timeToDisplay);
// point framePeriod to new frame
framePeriod = new TimeRange(frameTime, LAST_FRAME_ADJ);
framePeriod = getLastFrameTimeRange(frameTime);
}
// check if the warning is cancelled
@ -500,8 +502,8 @@ public abstract class AbstractWWAResource extends
descFrameTimes.length);
for (int i = 0; i < descFrameTimes.length; i++) {
if (i == descFrameTimes.length - 1) {
framePeriods.add(new TimeRange(descFrameTimes[i].getRefTime(),
LAST_FRAME_ADJ));
framePeriods.add(getLastFrameTimeRange(descFrameTimes[i]
.getRefTime()));
} else {
framePeriods.add(new TimeRange(descFrameTimes[i].getRefTime(),
descFrameTimes[i + 1].getRefTime()));
@ -670,4 +672,27 @@ public abstract class AbstractWWAResource extends
return name;
}
/**
* Determine time range for the last frame. When in simulated time (DRT)
* keep end of time range the start of the base time's next minute.
*
* @param baseTime
* @return timeRange
*/
private TimeRange getLastFrameTimeRange(Date baseTime) {
TimeRange timeRange = null;
if (SimulatedTime.getSystemTime().isRealTime()) {
timeRange = new TimeRange(baseTime, LAST_FRAME_ADJ);
} else {
Calendar cal = TimeUtil.newGmtCalendar();
cal.setTime(baseTime);
// Make the end time for the last frame the start of the next minute
// of the base time to prevent getting "future" warnings.
cal.add(Calendar.MINUTE, 1);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
timeRange = new TimeRange(baseTime, cal.getTime());
}
return timeRange;
}
}

View file

@ -149,4 +149,4 @@ if [ $DEBUG_FLAG == "on" ]; then
echo "To Debug ... Connect to Port: ${EDEX_DEBUG_PORT}."
fi
java -jar ${EDEX_HOME}/bin/yajsw/wrapper.jar -c ${EDEX_HOME}/conf/${CONF_FILE} ${WRAPPER_ARGS}
java -Xmx32m -XX:MaxPermSize=12m -XX:ReservedCodeCacheSize=4m -jar ${EDEX_HOME}/bin/yajsw/wrapper.jar -c ${EDEX_HOME}/conf/${CONF_FILE} ${WRAPPER_ARGS}

View file

@ -0,0 +1,131 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.edex.ingestsrv;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
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.time.util.ITimer;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.edex.database.plugin.PluginDao;
import com.raytheon.uf.edex.database.plugin.PluginFactory;
import com.raytheon.uf.edex.database.query.DatabaseQuery;
/**
* Checks database for duplicates of data. Does not account for clustering.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 11, 2013 2478 rjpeter Initial creation
* </pre>
*
* @author rjpeter
* @version 1.0
*/
public class DupElimSrv {
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(DupElimSrv.class);
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("DupElim:");
/**
* Checks the passed pdos against database for existence. If duplicates
* found returns a new array containing only the new plugin data objects. If
* an errors occurs the original pdos array will be returned.
*
* @param pluginName
* @param pdos
* @return
*/
public PluginDataObject[] dupElim(PluginDataObject[] pdos) {
if ((pdos == null) || (pdos.length == 0)) {
return new PluginDataObject[0];
}
ITimer dupCheckTimer = TimeUtil.getTimer();
dupCheckTimer.start();
int numBefore = pdos.length;
String pluginName = pdos[0].getPluginName();
try {
PluginDao dao = PluginFactory.getInstance()
.getPluginDao(pluginName);
List<PluginDataObject> newPdos = new ArrayList<PluginDataObject>(
pdos.length);
// TODO: Bulk querying, groups of 100 using IN lists?
for (PluginDataObject pdo : pdos) {
DatabaseQuery dbQuery = new DatabaseQuery(pdo.getClass());
Map<String, Object> dataUriFields = DataURIUtil
.createDataURIMap(pdo);
for (Map.Entry<String, Object> field : dataUriFields.entrySet()) {
String fieldName = field.getKey();
// ignore pluginName
if (!DataURIUtil.PLUGIN_NAME_KEY.equals(fieldName)) {
dbQuery.addQueryParam(field.getKey(), field.getValue());
}
}
@SuppressWarnings("unchecked")
List<PluginDataObject> dbPdos = (List<PluginDataObject>) dao
.queryByCriteria(dbQuery);
if (CollectionUtil.isNullOrEmpty(dbPdos)) {
newPdos.add(pdo);
} else {
// shouldn't be more than 1
PluginDataObject dbPdo = dbPdos.get(0);
if ((dbPdo == null)
|| !pdo.getDataURI().equals(dbPdo.getDataURI())) {
newPdos.add(pdo);
}
}
}
if (pdos.length != newPdos.size()) {
pdos = newPdos.toArray(new PluginDataObject[newPdos.size()]);
}
} catch (Exception e) {
statusHandler
.error("Error occurred during duplicate elimination processing",
e);
}
dupCheckTimer.stop();
perfLog.logDuration(pluginName + ": Eliminated "
+ (numBefore - pdos.length) + " of " + numBefore
+ " record(s): Time to process", dupCheckTimer.getElapsedTime());
return pdos;
}
}

View file

@ -85,6 +85,10 @@ import com.raytheon.uf.common.util.Pair;
* Jun 05, 2013 #2063 dgilling Port history() from A1.
* Jun 13, 2013 #2044 randerso Refactored to use non-singleton
* GridParmManager and LockManager
* Nov 11, 2013 #2517 randerso Changed put() to support multiple discontiguous saves
* Added getKeys(tr) to get grid times overlapping a time range
* Removed caching of inventory as it was not being updated when
* grids were updated/deleted
*
* </pre>
*
@ -110,8 +114,6 @@ public class IFPWE {
private final GridParmInfo gpi;
private List<TimeRange> availableTimes;
private final WsId wsId;
/**
@ -134,23 +136,42 @@ public class IFPWE {
}
/**
* Returns the available times of data for the parm
* Returns all available times of data for the parm
*
* @return
* @return the time ranges of all available data for the parm
*/
public List<TimeRange> getKeys() {
if (availableTimes == null) {
availableTimes = new ArrayList<TimeRange>();
List<TimeRange> times = gridParmMgr.getGridInventory(parmId)
.getPayload();
if (times != null) {
Collections.sort(times);
availableTimes.addAll(times);
}
List<TimeRange> availableTimes;
ServerResponse<List<TimeRange>> sr = gridParmMgr
.getGridInventory(parmId);
if (sr.isOkay()) {
availableTimes = sr.getPayload();
} else {
availableTimes = Collections.emptyList();
}
return availableTimes;
}
/**
* Returns available times of data for the parm that overlap a time range
*
* @param tr
* the desired time range
* @return the time ranges of data that overlap the desired time range
*/
public List<TimeRange> getKeys(TimeRange tr) {
List<TimeRange> overlappingTimes;
ServerResponse<List<TimeRange>> sr = GridParmManager.getGridInventory(
parmId, tr);
if (sr.isOkay()) {
overlappingTimes = sr.getPayload();
} else {
overlappingTimes = Collections.emptyList();
}
return overlappingTimes;
}
/**
* Returns the grid parm info
*
@ -252,65 +273,69 @@ public class IFPWE {
* storage.
*
* @param inventory
* A Map of TimeRanges to IGridSlices to be saved. Time is the
* slice's valid time.
* @param timeRangeSpan
* The replacement time range of grids to be saved. Must cover
* each individual TimeRange in inventory.
* A Map of TimeRanges to List of IGridSlices. TimeRange is the
* replacement time range
* @throws GfeException
* If an error occurs while trying to obtain a lock on the
* destination database.
*/
public void put(LinkedHashMap<TimeRange, IGridSlice> inventory,
TimeRange timeRangeSpan) throws GfeException {
statusHandler.debug("Getting lock for ParmID: " + parmId + " TR: "
+ timeRangeSpan);
public void put(LinkedHashMap<TimeRange, List<IGridSlice>> inventory)
throws GfeException {
for (Entry<TimeRange, List<IGridSlice>> entry : inventory.entrySet()) {
TimeRange timeRangeSpan = entry.getKey();
statusHandler.debug("Getting lock for ParmID: " + parmId + " TR: "
+ timeRangeSpan);
ServerResponse<List<LockTable>> lockResponse = lockMgr
.requestLockChange(new LockRequest(parmId, timeRangeSpan,
LockMode.LOCK), wsId);
if (lockResponse.isOkay()) {
statusHandler.debug("LOCKING: Lock granted for: " + wsId
+ " for time range: " + timeRangeSpan);
} else {
statusHandler.error("Could not lock TimeRange " + timeRangeSpan
+ " for parm [" + parmId + "]: " + lockResponse.message());
throw new GfeException("Request lock failed. "
+ lockResponse.message());
}
if (lockResponse.isOkay()) {
statusHandler.debug("LOCKING: Lock granted for: " + wsId
+ " for time range: " + timeRangeSpan);
} else {
statusHandler.error("Could not lock TimeRange " + timeRangeSpan
+ " for parm [" + parmId + "]: "
+ lockResponse.message());
throw new GfeException("Request lock failed. "
+ lockResponse.message());
}
List<GFERecord> records = new ArrayList<GFERecord>(inventory.size());
for (Entry<TimeRange, IGridSlice> entry : inventory.entrySet()) {
GFERecord rec = new GFERecord(parmId, entry.getKey());
rec.setGridHistory(entry.getValue().getHistory());
rec.setMessageData(entry.getValue());
records.add(rec);
}
SaveGridRequest sgr = new SaveGridRequest(parmId, timeRangeSpan,
records);
List<IGridSlice> gridSlices = entry.getValue();
List<GFERecord> records = new ArrayList<GFERecord>(
gridSlices.size());
for (IGridSlice slice : gridSlices) {
GFERecord rec = new GFERecord(parmId, slice.getValidTime());
rec.setGridHistory(slice.getHistory());
rec.setMessageData(slice);
records.add(rec);
}
SaveGridRequest sgr = new SaveGridRequest(parmId, timeRangeSpan,
records);
try {
try {
ServerResponse<?> sr = gridParmMgr.saveGridData(Arrays.asList(sgr),
wsId);
if (sr.isOkay()) {
SendNotifications.send(sr.getNotifications());
} else {
statusHandler.error("Unable to save grids for parm [" + parmId
+ "] over time range " + timeRangeSpan + ": "
+ sr.message());
}
} finally {
if (sr.isOkay()) {
SendNotifications.send(sr.getNotifications());
} else {
statusHandler.error("Unable to save grids for parm ["
+ parmId + "] over time range " + timeRangeSpan
+ ": " + sr.message());
}
} finally {
ServerResponse<List<LockTable>> unLockResponse = lockMgr
.requestLockChange(new LockRequest(parmId, timeRangeSpan,
LockMode.UNLOCK), wsId);
if (unLockResponse.isOkay()) {
statusHandler.debug("LOCKING: Unlocked for: " + wsId + " TR: "
+ timeRangeSpan);
} else {
statusHandler.error("Could not unlock TimeRange "
+ timeRangeSpan + " for parm [" + parmId + "]: "
+ lockResponse.message());
throw new GfeException("Request unlock failed. "
+ unLockResponse.message());
if (unLockResponse.isOkay()) {
statusHandler.debug("LOCKING: Unlocked for: " + wsId
+ " TR: " + timeRangeSpan);
} else {
statusHandler.error("Could not unlock TimeRange "
+ timeRangeSpan + " for parm [" + parmId + "]: "
+ lockResponse.message());
throw new GfeException("Request unlock failed. "
+ unLockResponse.message());
}
}
}
}

View file

@ -1,30 +1,30 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
import string, IrtAccess, JUtil
import string, IrtAccess, JUtil, logging
import xml, pickle, tempfile, os
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, SubElement
import LogStream
from datetime import datetime
from time import gmtime,strftime
from time import gmtime, strftime
from java.io import File
from com.raytheon.uf.common.time import TimeRange
from com.raytheon.uf.common.dataplugin.gfe.db.objects import GridLocation
@ -34,68 +34,69 @@ from com.raytheon.edex.plugin.gfe.config import IFPServerConfig
from com.raytheon.edex.plugin.gfe.config import IFPServerConfigManager
from com.raytheon.uf.common.localization import LocalizationFile
from com.raytheon.uf.common.localization import PathManagerFactory
from com.raytheon.uf.common.localization import LocalizationContext
from com.raytheon.uf.common.localization import LocalizationContext
from com.raytheon.uf.common.localization import LocalizationContext_LocalizationType as LocalizationType
from com.raytheon.uf.common.localization import LocalizationContext_LocalizationLevel as LocalizationLevel
#
# Utility module of isc functions
#
#
# SOFTWARE HISTORY
#
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 07/06/09 1995 bphillip Initial Creation.
# 02/19/13 1637 randerso Removed unused import
# 03/11/13 1759 dgilling Move siteConfig import into
# methods where it's needed.
#
#
# 11/07/13 2517 randerso Allow getLogger to override logLevel
#
#
#
def getEditArea(name, siteID):
def getEditArea(name, siteID):
pathMgr = PathManagerFactory.getPathManager();
commonStaticConfig = pathMgr.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.SITE)
commonStaticConfig.setContextName(siteID)
file = pathMgr.getFile(commonStaticConfig,"gfe/editAreas"+ File.separator + name + ".xml")
file = pathMgr.getFile(commonStaticConfig, "gfe/editAreas" + File.separator + name + ".xml")
if not os.path.exists(file.getPath()):
commonStaticConfig = pathMgr.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED)
commonStaticConfig.setContextName(siteID)
file = pathMgr.getFile(commonStaticConfig,"gfe/editAreas"+ File.separator + name + ".xml")
refData = None
file = pathMgr.getFile(commonStaticConfig, "gfe/editAreas" + File.separator + name + ".xml")
refData = None
try:
if os.path.exists(file.getPath()):
refData = ReferenceData.getJAXBManager().unmarshalFromXmlFile(file.getPath());
else:
LogStream.logProblem("EDIT AREA NOT FOUND: ",name," for site ",siteID)
LogStream.logProblem("EDIT AREA NOT FOUND: ", name, " for site ", siteID)
except:
LogStream.logProblem("Unable to unmarshal " + name + " in iscExtract")
return refData
def saveEditAreaGrid(maskName, iscMask, siteID):
iscMask.getPolygons(CoordinateType.LATLON);
pathMgr = PathManagerFactory.getPathManager();
commonStaticConfig = pathMgr.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED)
commonStaticConfig.setContextName(siteID)
sitePath = pathMgr.getFile(commonStaticConfig,"gfe/editAreas").getPath()
sitePath = pathMgr.getFile(commonStaticConfig, "gfe/editAreas").getPath()
editAreaPath = str(sitePath) + "/" + maskName + ".xml"
ReferenceData.getJAXBManager().marshalToXmlFile(iscMask, editAreaPath)
def deleteEditArea(name, siteID):
def deleteEditArea(name, siteID):
pathMgr = PathManagerFactory.getPathManager()
commonStaticConfig = pathMgr.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED)
commonStaticConfig.setContextName(siteID)
file = pathMgr.getFile(commonStaticConfig,"gfe/editAreas"+ File.separator + name + ".xml")
file = pathMgr.getFile(commonStaticConfig, "gfe/editAreas" + File.separator + name + ".xml")
file.delete()
def transformTime(tr):
def transformTime(tr):
return (int(tr.getStart().getTime() / 1000), int(tr.getEnd().getTime() / 1000))
def toJavaTimeRange(tr):
@ -106,7 +107,7 @@ def swapCoord(coord):
coord.y = coord.x
coord.x = temp
return coord
def serverBoxText(server):
#returns text based on the server dictionary that should be placed
#into the dialog
@ -117,13 +118,13 @@ def serverBoxText(server):
hostport = server['host'] + "-primary"
elif server['port'] == "98000001":
hostport = server['host'] + "-svcbu"
if hostport is None:
hostport = server['host'] + "/" + server['port']
return server['site'] + "-> " + hostport + "@" + \
server['mhsid'].lower()
def sortServers(a, b):
# sort function for the list of servers. Sorts in priority order for
# most likely to have the data. Order is:
@ -135,15 +136,15 @@ def sortServers(a, b):
sameSiteA = (a['mhsid'] == a['site'])
sameSiteB = (b['mhsid'] == b['site'])
if sameSiteA and not sameSiteB:
return - 1
return -1
elif not sameSiteA and sameSiteB:
return 1
return 1
#both are same sites, check for host next
else:
regHostA = (a['host'][0:3] in ['dx4', 'px3'])
regHostB = (b['host'][0:3] in ['dx4', 'px3'])
if regHostA and not regHostB:
return - 1
return -1
elif not regHostA and regHostB:
return 1
# same host, but not preferred host
@ -151,11 +152,11 @@ def sortServers(a, b):
regPortA = (a['port'] == "98000000")
regPortB = (b['port'] == "98000000")
if regPortA and not regPortB:
return - 1
return -1
elif not regPortA and regPortB:
return 1
return 1 #must be non-standard, put at end of list
def createDomainDict(xml):
irt = IrtAccess.IrtAccess("")
#decodes the packet of information from the ISC_REQUEST_QUERY call
@ -171,7 +172,7 @@ def createDomainDict(xml):
return None
if serversE.tag != "servers":
LogStream.logEvent('servers tag not found in createDomainDict')
return None #invalid xml
return None #invalid xml
#decode XML and create dictionary and parms list
domains = {}
@ -185,7 +186,7 @@ def createDomainDict(xml):
if name == "site":
site = value
break
if site is None:
if site is None:
LogStream.logProblem('Malformed domain site XML')
continue
for addressE in domainE.getchildren():
@ -196,62 +197,62 @@ def createDomainDict(xml):
list.append(info)
guiText = serverBoxText(info)
serverDictT2S[guiText] = info
serverDictS2T[str(info)] = guiText
serverDictS2T[str(info)] = guiText
list.sort(sortServers)
domains[site] = list
elif domainE.tag == "welist":
elif domainE.tag == "welist":
for parmE in domainE.getchildren():
welist.append(parmE.text)
welist.append(parmE.text)
welist.sort()
retVal = {}
retVal['serverDictS2T'] = serverDictS2T
retVal['serverDictT2S'] = serverDictT2S
retVal['domains'] = domains
tempfile.tempdir = "/tmp/"
tempfile.tempdir = "/tmp/"
fname = tempfile.mktemp(".bin")
FILE = open(fname, "w")
pickle.dump(retVal, FILE)
FILE.close()
FILE = open(fname, "r")
lines = FILE.readlines()
FILE.close()
os.remove(fname)
pickledFile = ""
for line in lines:
pickledFile += line
return pickledFile
def unPickle(str):
import pickle,tempfile,os,JUtil
tempfile.tempdir = "/tmp/"
import pickle, tempfile, os, JUtil
tempfile.tempdir = "/tmp/"
fname = tempfile.mktemp(".bin")
FILE = open(fname,"w")
FILE = open(fname, "w")
FILE.write(str)
FILE.close()
FILE = open(fname,"r")
FILE = open(fname, "r")
retVal = pickle.load(FILE)
FILE.close()
return retVal
def getRequestXML(xml,selectedServers, selectedWEList):
def getRequestXML(xml, selectedServers, selectedWEList):
irt = IrtAccess.IrtAccess("")
selectedServers = JUtil.javaStringListToPylist(selectedServers)
selectedWElist = JUtil.javaStringListToPylist(selectedWEList)
response = unPickle(createDomainDict(xml))
response = unPickle(createDomainDict(xml))
serverDictT2S = response['serverDictT2S']
domainDict = response['domains']
iscReqE = Element('iscrequest')
servers = []
servers = []
for serverT in selectedServers:
server = serverDictT2S[serverT]
servers.append(server)
@ -275,46 +276,44 @@ def getRequestXML(xml,selectedServers, selectedWEList):
# send to ifpServer
xmlreq = ElementTree.tostring(iscReqE)
return xmlreq;
def getLogger(scriptName, logName=None):
import logging
# be relocating this import here we allow
def getLogger(scriptName, logName=None, logLevel=logging.INFO):
# be relocating this import here we allow
# com.raytheon.edex.plugin.gfe.isc.IscScript to dynamically
# modify its include path with the proper siteConfig just before
# execution time
import siteConfig
if logName is None:
logPath=siteConfig.GFESUITE_LOGDIR+"/"+strftime("%Y%m%d", gmtime())
logName=scriptName+".log"
logPath = siteConfig.GFESUITE_LOGDIR + "/" + strftime("%Y%m%d", gmtime())
logName = scriptName + ".log"
else:
logPath=os.path.dirname(logName)
if len(logPath)==0:
logPath=siteConfig.GFESUITE_LOGDIR+"/"+strftime("%Y%m%d", gmtime())
logName=os.path.basename(logName)
logFile=logPath+"/"+logName
logPath = os.path.dirname(logName)
if len(logPath) == 0:
logPath = siteConfig.GFESUITE_LOGDIR + "/" + strftime("%Y%m%d", gmtime())
logName = os.path.basename(logName)
logFile = logPath + "/" + logName
if not os.path.exists(logPath):
os.makedirs(logPath)
theLog = logging.getLogger(scriptName)
theLog.setLevel(logging.INFO)
theLog.setLevel(logLevel)
ch = logging.FileHandler(logFile)
ch.setLevel(logging.INFO)
ch.setLevel(logLevel)
formatter = logging.Formatter("%(levelname)s %(asctime)s [%(process)d:%(thread)d] %(filename)s: %(message)s")
ch.setFormatter(formatter)
for h in theLog.handlers:
theLog.removeHandler(h)
theLog.addHandler(ch)
return theLog
def tupleToString(*msg):
concatMsg=""
concatMsg = ""
for m in msg:
concatMsg=concatMsg+" "+str(m)
concatMsg = concatMsg + " " + str(m)
return concatMsg

View file

@ -1,19 +1,19 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
@ -30,14 +30,15 @@ import LogStream, fcntl
# Vector: ((magGrid, dirGrid), history)
# Weather: ((byteGrid, key), history)
# Discrete: ((byteGrid, key), history)
#
#
# SOFTWARE HISTORY
#
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 07/06/09 1995 bphillip Initial Creation.
#
#
# 11/05/13 2517 randerso Improve memory utilization
#
#
#
@ -54,7 +55,7 @@ class MergeGrid:
# gridType = 'SCALAR', 'VECTOR', 'WEATHER', 'DISCRETE'
#---------------------------------------------------------------------
def __init__(self, creationTime, siteID, inFillValue, outFillValue,
areaMask, gridType, discreteKeys = None):
areaMask, gridType, discreteKeys=None):
self.__creationTime = creationTime
self.__siteID = siteID
self.__inFillV = inFillValue
@ -91,13 +92,13 @@ class MergeGrid:
gridB = wxB[0]
key = wxA[1]
newGrid = numpy.zeros_like(gridB)
for k in range(len(wxB[1])):
index = self.__findKey(wxB[1][k], key)
newGrid = numpy.where(gridB == k, index, newGrid)
newGrid[gridB == k] = index
return (key, wxA[0], newGrid)
#---------------------------------------------------------------------
# update history strings
@ -107,17 +108,17 @@ class MergeGrid:
# returns None if no history is present.
#---------------------------------------------------------------------
def __updateHistoryStrings(self, historyA, historyB):
out = []
# removal any old entry
# removal any old entry
if historyB is not None:
for h in historyB:
index = string.find(h, ":"+ self.__siteID + "_GRID")
index = string.find(h, ":" + self.__siteID + "_GRID")
if index == -1:
out.append(h)
# if add mode, add in new entries
out.append(h)
# if add mode, add in new entries
if historyA is not None:
for h in historyA:
out.append(h)
@ -125,33 +126,33 @@ class MergeGrid:
if len(out) > 0:
return out
else:
return None
return None
#---------------------------------------------------------------------
# merge scalar grid
# Note: gridA can be None, which indicates that the data
# is to be blanked out, i.e., made invalid. gridB can also be
# none, which indicates that there is no destination grid and one must
# be created.
# be created.
#---------------------------------------------------------------------
def __mergeScalarGrid(self, gridA, gridB):
if gridA is None and gridB is None:
if gridA is None and gridB is None:
return None
# merge the grids
if gridA is not None:
inMask = numpy.not_equal(gridA, self.__inFillV)
mask = numpy.logical_and(inMask, self.__areaMask)
mask = numpy.not_equal(gridA, self.__inFillV)
numpy.logical_and(mask, self.__areaMask, mask)
if gridB is None:
gridB = numpy.zeros(gridA.shape) + self.__outFillV
return numpy.where(mask, gridA, gridB)
return numpy.where(mask, gridA, self.__outFillV)
else:
return numpy.where(mask, gridA, gridB)
# blank out the data
else:
blankGrid = numpy.zeros(gridB.shape) + self.__outFillV
return numpy.where(self.__areaMask, blankGrid, gridB)
return numpy.where(self.__areaMask, self.__outFillV, gridB)
#---------------------------------------------------------------------
# merge vector grid
# Note: gridA can be None, which indicates that the data
@ -159,50 +160,47 @@ class MergeGrid:
# none, which indicates that there is no destination grid and one must
# be created.
#---------------------------------------------------------------------
def __mergeVectorGrid(self, gridA, gridB):
def __mergeVectorGrid(self, gridA, gridB):
if gridA is None and gridB is None:
return None
# merge the grids
if gridA is not None:
inMask = numpy.not_equal(gridA[0], self.__inFillV)
mask = numpy.logical_and(inMask, self.__areaMask)
mask = numpy.not_equal(gridA[0], self.__inFillV)
numpy.logical_and(mask, self.__areaMask, mask)
if gridB is None:
gridSize = gridA[0].shape
gridB = (numpy.zeros(gridSize) + self.__outFillV,
numpy.zeros(gridSize) + 0.0)
magGrid = numpy.where(mask, gridA[0], gridB[0])
dirGrid = numpy.where(mask, gridA[1], gridB[1])
magGrid = numpy.where(mask, gridA[0], self.__outFillV)
dirGrid = numpy.where(mask, gridA[1], 0.0)
else:
magGrid = numpy.where(mask, gridA[0], gridB[0])
dirGrid = numpy.where(mask, gridA[1], gridB[1])
return (magGrid, dirGrid)
# blank out the data
else:
blankGrid = numpy.zeros(gridB[0].shape) + self.__outFillV
blankDirGrid = numpy.zeros_like(gridB[1])
magGrid = numpy.where(self.__areaMask, blankGrid, gridB[0])
dirGrid = numpy.where(self.__areaMask, blankDirGrid, gridB[1])
magGrid = numpy.where(self.__areaMask, self.__outFillV, gridB[0])
dirGrid = numpy.where(self.__areaMask, 0.0, gridB[1])
return (magGrid, dirGrid)
#---------------------------------------------------------------------
# merge weather grid
#
# Note the outFillV is ignored for now, all out-of-bounds points will
# get the <NoWx> value.
#---------------------------------------------------------------------
def __mergeWeatherGrid(self, gridA, gridB):
if gridA is None and gridB is None:
def __mergeWeatherGrid(self, gridA, gridB):
if gridA is None and gridB is None:
return None
noWx = "<NoCov>:<NoWx>:<NoInten>:<NoVis>:"
# merge the grids
if gridA is not None:
inMask = numpy.not_equal(gridA[0], self.__inFillV)
mask = numpy.logical_and(inMask, self.__areaMask)
mask = numpy.not_equal(gridA[0], self.__inFillV)
numpy.logical_and(mask, self.__areaMask, mask)
if gridB is None: #make an empty grid
noWxKeys = []
noWxGrid = numpy.empty_like(gridA[0])
@ -211,15 +209,15 @@ class MergeGrid:
(commonkey, remapG, dbG) = self.__commonizeKey(gridA, gridB)
mergedGrid = numpy.where(mask, remapG, dbG)
return (mergedGrid, commonkey)
# blank out the data
else:
else:
blankGrid = numpy.empty_like(gridB[0])
blankGrid.fill(self.__findKey(noWx, gridB[1]))
key = gridB[1]
grid = numpy.where(self.__areaMask, blankGrid, gridB[0])
return (grid, key)
#---------------------------------------------------------------------
# merge discrete grid
#
@ -231,23 +229,23 @@ class MergeGrid:
return None
noKey = self.__discreteKeys[0]
# merge the grids
if gridA is not None:
inMask = numpy.not_equal(gridA[0], self.__inFillV)
mask = numpy.logical_and(inMask, self.__areaMask)
mask = numpy.not_equal(gridA[0], self.__inFillV)
numpy.logical_and(mask, self.__areaMask)
if gridB is None: #make an empty grid
noKeys = []
noGrid = numpy.empty_like(gridA[0])
noGrid.fill(self.__findKey(noKey, noKeys))
gridB = (noGrid, noKeys)
(commonkey, remapG, dbG) = \
self.__commonizeKey(gridA, gridB)
mergedGrid = numpy.where(mask, remapG, dbG)
return (mergedGrid, commonkey)
# blank out the data
else:
blankGrid = numpy.empty_like(gridB[0])
@ -255,7 +253,7 @@ class MergeGrid:
key = gridB[1]
grid = numpy.where(self.__areaMask, blankGrid, gridB[0])
return (grid, key)
#---------------------------------------------------------------------
# mergeGrid
# Merges the grid
@ -270,8 +268,8 @@ class MergeGrid:
# none, which indicates that there is no destination grid and one must
# be created.
#---------------------------------------------------------------------
def mergeGrid(self, gridAIn, gridBIn):
# merge the grids
def mergeGrid(self, gridAIn, gridBIn):
# merge the grids
if gridAIn is not None:
gridA = gridAIn[0]
historyA = gridAIn[1]
@ -279,28 +277,28 @@ class MergeGrid:
gridA = None
historyA = None
if gridBIn is not None:
gridB = gridBIn[0]
gridB = gridBIn[0]
historyB = gridBIn[1]
else:
gridB = None
historyB = None
if self.__gridType == 'SCALAR':
mergedGrid = self.__mergeScalarGrid(gridA, gridB)
if self.__gridType == 'SCALAR':
mergedGrid = self.__mergeScalarGrid(gridA, gridB)
elif self.__gridType == 'VECTOR':
mergedGrid = self.__mergeVectorGrid(gridA, gridB)
elif self.__gridType == 'WEATHER':
mergedGrid = self.__mergeWeatherGrid(gridA, gridB)
elif self.__gridType == 'DISCRETE':
mergedGrid = self.__mergeDiscreteGrid(gridA, gridB)
else:
mergedGrid = None
# merge History
history = self.__updateHistoryStrings(historyA, historyB)
return (mergedGrid, history)

View file

@ -78,7 +78,7 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao;
* assembler.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Oct 15, 2013 2473 bsteffen Remove deprecated method calls.
*
* Nov 19, 2013 2478 rjpeter Make update process update database also.
*
* </pre>
*
@ -281,7 +281,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor {
assembledRecord.setMessageData(rec.getFloatData());
mergeData(record, assembledRecord, thinned);
assembledRecord.setOverwriteAllowed(true);
dao.persistToHDF5(assembledRecord);
dao.persistRecords(assembledRecord);
} catch (PluginException e) {
throw new GribException("Error storing assembled grid to HDF5", e);
}

View file

@ -1,67 +1,53 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="obsDecoder" class="com.raytheon.edex.plugin.obs.ObsDecoder"/>
<bean id="metarPointData" class="com.raytheon.edex.plugin.obs.metar.MetarPointDataTransform"/>
<bean id="obsSeparator" class="com.raytheon.edex.plugin.obs.metar.MetarSeparator" />
<bean id="obsDecoder" class="com.raytheon.edex.plugin.obs.ObsDecoder" />
<bean id="obsDistRegistry" factory-bean="distributionSrv"
factory-method="register">
<constructor-arg value="obs" />
<constructor-arg value="jms-dist:queue:Ingest.obs"/>
</bean>
<bean id="metarPointData" class="com.raytheon.edex.plugin.obs.metar.MetarPointDataTransform" />
<bean id="obsCamelRegistered" factory-bean="contextManager"
factory-method="register"
depends-on="persistCamelRegistered,
<bean id="obsSeparator" class="com.raytheon.edex.plugin.obs.metar.MetarSeparator" />
<bean id="obsDistRegistry" factory-bean="distributionSrv" factory-method="register">
<constructor-arg value="obs" />
<constructor-arg value="jms-dist:queue:Ingest.obs" />
</bean>
<bean id="obsCamelRegistered" factory-bean="contextManager" factory-method="register"
depends-on="persistCamelRegistered,
shefCamelRegistered,
metarToHMDBCamelRegistered">
<constructor-arg ref="obs-camel"/>
</bean>
<constructor-arg ref="obs-camel" />
</bean>
<camelContext id="obs-camel"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler"
autoStartup="false">
<!--
<endpoint id="metarFileEndpoint" uri="file:${edex.home}/data/sbn/metar?noop=true&amp;idempotent=false" />
<route id="metarFileConsumerRoute">
<from ref="metarFileEndpoint" />
<bean ref="fileToString" />
<setHeader headerName="pluginName">
<constant>obs</constant>
</setHeader>
<to uri="jms-durable:queue:Ingest.obs" />
</route>
-->
<!-- Begin METAR routes -->
<route id="metarIngestRoute">
<from uri="jms-durable:queue:Ingest.obs"/>
<setHeader headerName="pluginName">
<constant>obs</constant>
</setHeader>
<doTry>
<pipeline>
<bean ref="stringToFile" />
<bean ref="obsDecoder" method="decode" />
<bean ref="metarPointData" method="toPointData" />
<multicast>
<to uri="direct-vm:persistIndexAlert" />
<to uri="direct-vm:metarToShef" />
<to uri="direct-vm:metarToHMDB"/>
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:metar?level=ERROR"/>
</doCatch>
</doTry>
</route>
</camelContext>
<camelContext id="obs-camel" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler" autoStartup="false">
<!-- Begin METAR routes -->
<route id="metarIngestRoute">
<from uri="jms-durable:queue:Ingest.obs" />
<setHeader headerName="pluginName">
<constant>obs</constant>
</setHeader>
<doTry>
<pipeline>
<bean ref="stringToFile" />
<bean ref="obsDecoder" method="decode" />
<bean ref="dupElim" />
<bean ref="metarPointData" method="toPointData" />
<multicast>
<to uri="direct-vm:persistIndexAlert" />
<to uri="direct-vm:metarToShef" />
<to uri="direct-vm:metarToHMDB" />
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:metar?level=ERROR" />
</doCatch>
</doTry>
</route>
</camelContext>
</beans>

View file

@ -1,68 +1,52 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="sfcobsDecoder" class="com.raytheon.edex.plugin.sfcobs.SfcObsDecoder" />
<bean id="sfcobsSeparator" class="com.raytheon.edex.plugin.sfcobs.SfcObsSeparator" />
<bean id="sfcobsDecoder" class="com.raytheon.edex.plugin.sfcobs.SfcObsDecoder" />
<bean id="sfcobsSeparator" class="com.raytheon.edex.plugin.sfcobs.SfcObsSeparator" />
<bean id="sfcobsPointData" class="com.raytheon.edex.plugin.sfcobs.SfcObsPointDataTransform">
<constructor-arg ref="sfcobsPluginName" />
</bean>
<bean id="sfcobsDistRegistry" factory-bean="distributionSrv"
factory-method="register">
<constructor-arg value="sfcobs" />
<constructor-arg value="jms-dist:queue:Ingest.sfcobs"/>
</bean>
<bean id="sfcobsCamelRegistered" factory-bean="contextManager"
factory-method="register"
depends-on="persistCamelRegistered,
<bean id="sfcobsDistRegistry" factory-bean="distributionSrv" factory-method="register">
<constructor-arg value="sfcobs" />
<constructor-arg value="jms-dist:queue:Ingest.sfcobs" />
</bean>
<bean id="sfcobsCamelRegistered" factory-bean="contextManager" factory-method="register"
depends-on="persistCamelRegistered,
shefCamelRegistered">
<constructor-arg ref="sfcobs-camel"/>
</bean>
<constructor-arg ref="sfcobs-camel" />
</bean>
<camelContext id="sfcobs-camel"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler"
autoStartup="false">
<!--
<endpoint id="sfcobsFileEndpoint"
uri="file:${edex.home}/data/sbn/sfcobs?noop=true&amp;idempotent=false" />
<camelContext id="sfcobs-camel" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler" autoStartup="false">
<route id="sfcobsFileConsumerRoute">
<from ref="sfcobsFileEndpoint" />
<bean ref="fileToString" />
<setHeader headerName="pluginName">
<constant>sfcobs</constant>
</setHeader>
<to uri="jms-durable:queue:Ingest.sfcobs" />
</route>
-->
<!-- Begin sfcobs routes -->
<route id="sfcobsIngestRoute">
<from uri="jms-durable:queue:Ingest.sfcobs"/>
<setHeader headerName="pluginName">
<constant>sfcobs</constant>
</setHeader>
<bean ref="stringToFile" />
<doTry>
<pipeline>
<bean ref="sfcobsDecoder" method="decode" />
<!-- Begin sfcobs routes -->
<route id="sfcobsIngestRoute">
<from uri="jms-durable:queue:Ingest.sfcobs" />
<setHeader headerName="pluginName">
<constant>sfcobs</constant>
</setHeader>
<bean ref="stringToFile" />
<doTry>
<pipeline>
<bean ref="sfcobsDecoder" method="decode" />
<bean ref="dupElim" />
<bean ref="sfcobsPointData" method="toPointData" />
<multicast>
<to uri="direct-vm:persistIndexAlert" />
<to uri="direct-vm:synopticToShef"/>
<to uri="direct-vm:persistIndexAlert" />
<to uri="direct-vm:synopticToShef" />
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:sfcobs?level=ERROR"/>
</doCatch>
</doTry>
</route>
</camelContext>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:sfcobs?level=ERROR" />
</doCatch>
</doTry>
</route>
</camelContext>
</beans>

View file

@ -0,0 +1,43 @@
package com.raytheon.uf.common.dissemination;
import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
/**
* Request to check if an OUPRequest will work
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 20, 2013 DR 16777 D. Friedman Initial creation
*
* </pre>
*
*/
@DynamicSerialize
public class OUPTestRequest extends AbstractPrivilegedRequest {
@DynamicSerializeElement
OUPRequest oupRequest;
public IUser getUser() {
return oupRequest.getUser();
}
public void setUser(IUser user) {
oupRequest.setUser(user);
}
public OUPRequest getOupRequest() {
return oupRequest;
}
public void setOupRequest(OUPRequest oupRequest) {
this.oupRequest = oupRequest;
}
}

View file

@ -6,6 +6,8 @@ archive.cron=0+40+*+*+*+?
archive.purge.enable=true
# purge archives
archive.purge.cron=0+5+0/3+*+*+?
# compress database records
archive.compression.enable=true
# to disable a specific archive, use property archive.disable=pluginName,pluginName...
#archive.disable=grid,text,acars

View file

@ -19,6 +19,8 @@
**/
package com.raytheon.uf.edex.archive;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
@ -80,7 +82,8 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
* Jan 18, 2013 1469 bkowal Removed the hdf5 data directory.
* Oct 23, 2013 2478 rferrel Make date format thread safe.
* Add debug information.
* Nov 05, 2013 2499 rjpeter Repackaged, removed config files, always compresses.
* Nov 05, 2013 2499 rjpeter Repackaged, removed config files, always compresses hdf5.
* Nov 11, 2013 2478 rjpeter Updated data store copy to always copy hdf5.
* </pre>
*
* @author rjpeter
@ -114,12 +117,17 @@ public class DatabaseArchiver implements IPluginArchiver {
/** Cluster time out on lock. */
private static final int CLUSTER_LOCK_TIMEOUT = 60000;
/** Chunk size for I/O Buffering and Compression */
private static final int CHUNK_SIZE = 8192;
/** Mapping for plug-in formatters. */
private final Map<String, IPluginArchiveFileNameFormatter> pluginArchiveFormatters;
/** When true dump the pdos. */
private final boolean debugArchiver;
private final boolean compressDatabaseFiles;
/**
* The constructor.
*/
@ -128,6 +136,8 @@ public class DatabaseArchiver implements IPluginArchiver {
pluginArchiveFormatters.put("default",
new DefaultPluginArchiveFileNameFormatter());
debugArchiver = Boolean.getBoolean("archive.debug.enable");
compressDatabaseFiles = Boolean
.getBoolean("archive.compression.enable");
}
@Override
@ -259,12 +269,9 @@ public class DatabaseArchiver implements IPluginArchiver {
.join(archivePath, pluginName, dataStoreFile));
try {
// data must be older than 30 minutes, and no older than
// hours to keep hours need to lookup plugin and see if
// compression matches, or embed in configuration the
// compression level on archive, but would still need to
// lookup plugin
ds.copy(outputDir, compRequired, "lastArchived", 0, 0);
// copy the changed hdf5 file, does repack if
// compRequired, otherwise pure file copy
ds.copy(outputDir, compRequired, null, 0, 0);
} catch (StorageException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage());
@ -325,7 +332,11 @@ public class DatabaseArchiver implements IPluginArchiver {
path.setLength(path.length() - 3);
}
int pathDebugLength = path.length();
path.append(".bin.gz");
if (compressDatabaseFiles) {
path.append(".bin.gz");
} else {
path.append(".bin");
}
File file = new File(path.toString());
List<PersistableDataObject> pdosToSerialize = entry.getValue();
@ -338,7 +349,13 @@ public class DatabaseArchiver implements IPluginArchiver {
try {
// created gzip'd stream
is = new GZIPInputStream(new FileInputStream(file), 8192);
if (compressDatabaseFiles) {
is = new GZIPInputStream(new FileInputStream(file),
CHUNK_SIZE);
} else {
is = new BufferedInputStream(new FileInputStream(file),
CHUNK_SIZE);
}
// transform back for list append
@SuppressWarnings("unchecked")
@ -400,7 +417,12 @@ public class DatabaseArchiver implements IPluginArchiver {
}
// created gzip'd stream
os = new GZIPOutputStream(new FileOutputStream(file), 8192);
if (compressDatabaseFiles) {
os = new GZIPOutputStream(new FileOutputStream(file), CHUNK_SIZE);
} else {
os = new BufferedOutputStream(new FileOutputStream(file),
CHUNK_SIZE);
}
// Thrift serialize pdo list
SerializationUtil.transformToThriftUsingStream(pdosToSerialize,

View file

@ -27,6 +27,7 @@
* Aug 05, 2013 2224 rferrel Changes to add dataSet tags.
* Oct 01, 2013 2147 rferrel Date time stamp no longer requires an hour field.
* Nov 05, 2013 2497 rferrel Change root directory.
* Nov 13, 2013 2549 rferrel Changes to GFE and modelsounding.
*
* @author rferrel
* @version 1.0
@ -151,7 +152,7 @@
<dateGroupIndices>3,4,5,6</dateGroupIndices>
</dataSet>
<dataSet>
<dirPattern>gfe/(.*)/(Fcst|Official)</dirPattern>
<dirPattern>gfe/(.*)/(.*)</dirPattern>
<filePattern>.*_(\d{4})(\d{2})(\d{2})_.*</filePattern>
<displayLabel>{1} - {2}</displayLabel>
<dateGroupIndices>3,4,5</dateGroupIndices>
@ -177,11 +178,11 @@
<filePattern>.*-(\d{4})-(\d{2})-(\d{2})-(\d{2})-.*</filePattern>
</dataSet>
<dataSet>
<dirPattern>(modelsounding)/(.*)</dirPattern>
<dirPattern>(modelsounding)/(.*)/.*</dirPattern>
<dirPattern>(bufrmos)(.*)</dirPattern>
<displayLabel>{1} - {2}</displayLabel>
<dateGroupIndices>3,4,5,6</dateGroupIndices>
<filePattern>.*(\d{4})-(\d{2})-(\d{2})[-_](\d{2}).*</filePattern>
<filePattern>.*(\d{4})-(\d{2})-(\d{2})-(\d{2}).*</filePattern>
</dataSet>
</category>
<category>

View file

@ -219,6 +219,20 @@
<dateGroupIndices>1,2,3,4</dateGroupIndices>
</dataSet>
</category>
<category>
<name>Radar (Local)</name>
<extRetentionHours>168</extRetentionHours>
<dataSet>
<dirPattern>radar/([k|t|e|f]\w{3})/.*</dirPattern> <!-- one level like GSM or HI --> <!-- e and f are for FAA ASR and ARSR radars -->
<dirPattern>radar/(k...|t...|e...|f...)/.*/.*</dirPattern> <!-- two levels like ML -->
<dirPattern>radar/(k...|t...|e...|f...)/.*/.*/.*</dirPattern> <!-- three levels like ML -->
<dirPattern>radar/(k...|t...|e...|f...)/.*/.*/.*/.*</dirPattern> <!-- four levels like Z -->
<dirPattern>radar/(k...|t...|e...|f...)/.*/.*/.*/.*/.*</dirPattern> <!-- five levels like Z (superres) -->
<filePattern>(\w{4}).(\d*).(\d{4})(\d{2})(\d{2})_(\d{2})(\d{2})(.*)</filePattern>
<displayLabel>{1}</displayLabel>
<dateGroupIndices>4,5,6,7</dateGroupIndices>
</dataSet>
</category>
<category>
<name>Satellite</name>
<extRetentionHours>168</extRetentionHours>

View file

@ -7,10 +7,17 @@
<bean id="oupHandler" class="com.raytheon.uf.edex.dissemination.OUPHandler">
<property name="ackManager" ref="oupAckMgr" />
</bean>
<bean id="oupTestHandler" class="com.raytheon.uf.edex.dissemination.OUPTestHandler">
<property name="oupHandler" ref="oupHandler" />
</bean>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.dissemination.OUPRequest" />
<constructor-arg ref="oupHandler" />
</bean>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.dissemination.OUPTestRequest" />
<constructor-arg ref="oupTestHandler" />
</bean>
<camelContext id="handleoupAckMgrContext" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">

View file

@ -58,6 +58,7 @@ import com.raytheon.uf.edex.dissemination.transmitted.TransProdHeader;
* Oct 22, 2009 njensen Initial creation
* Oct 12, 2012 DR 15418 D. Friedman Use clustered TransmittedProductList
* Jun 07, 2013 1981 mpduff This is now a priviledged request handler.
# Nov 20, 2013 DR 16777 D. Friedman Add a test mode.
*
* </pre>
*
@ -76,6 +77,10 @@ public class OUPHandler extends AbstractPrivilegedRequestHandler<OUPRequest> {
@Override
public OUPResponse handleRequest(OUPRequest request) throws Exception {
return handleOUPRequest(request, false);
}
public OUPResponse handleOUPRequest(OUPRequest request, boolean test) throws Exception {
OfficialUserProduct oup = request.getProduct();
OUPResponse resp = new OUPResponse();
boolean changedBbb = false;
@ -85,7 +90,7 @@ public class OUPHandler extends AbstractPrivilegedRequestHandler<OUPRequest> {
request = ModifyProduct.addWmoHeader(request);
}
TransProdHeader header = ModifyProduct.getProductHeader(oup);
if (request.isCheckBBB()) {
if (request.isCheckBBB() && ! test) {
changedBbb = ModifyProduct.checkBBBField(oup, header);
if (changedBbb) {
resp.setChangedBBB(request.getProduct().getWmoType());
@ -104,6 +109,7 @@ public class OUPHandler extends AbstractPrivilegedRequestHandler<OUPRequest> {
args.put("afosID", header.getProductId());
args.put("resp", resp);
args.put("ackMgr", ackManager);
args.put("test", test);
resp.setAttempted(true);
py.execute("process", args);
} catch (JepException e) {

View file

@ -0,0 +1,45 @@
package com.raytheon.uf.edex.dissemination;
import com.raytheon.uf.common.auth.exception.AuthorizationException;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.dissemination.OUPTestRequest;
import com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler;
import com.raytheon.uf.edex.auth.resp.AuthorizationResponse;
/**
* Check if an OUPRequest will work
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 20, 2013 DR 16777 D. Friedman Initial creation
*
* </pre>
*
*/
public class OUPTestHandler extends AbstractPrivilegedRequestHandler<OUPTestRequest> {
private OUPHandler oupHandler;
@Override
public Object handleRequest(OUPTestRequest request) throws Exception {
return oupHandler.handleOUPRequest(request.getOupRequest(), true);
}
@Override
public AuthorizationResponse authorized(IUser user,
OUPTestRequest request) throws AuthorizationException {
return oupHandler.authorized(user, request.getOupRequest());
}
public OUPHandler getOupHandler() {
return oupHandler;
}
public void setOupHandler(OUPHandler oupHandler) {
this.oupHandler = oupHandler;
}
}

View file

@ -34,6 +34,7 @@
# 04/13/12 DR 10388 D. Friedman Correct acknowledgment handling
# 08/17/12 DR 15304 D. Friedman Use unique output file names
# 10/12/12 DR 15418 D. Friedman Use unique attachment file names
# 11/20/13 DR 16777 D. Friedman Add a test mode.
#
#
@ -71,7 +72,7 @@ INGEST_DIR = dataDir + 'manual'
INGEST_ROUTE = 'handleoupFilePush'
SITE_ID = env.getEnvValue('SITENAME')
def process(oup, afosID, resp, ackMgr = None):
def process(oup, afosID, resp, ackMgr = None, test = False):
_Logger.info("handleOUP.py received " + str(oup.getFilename()))
wmoTypeString = ""
userDateTimeStamp = ""
@ -137,7 +138,7 @@ def process(oup, afosID, resp, ackMgr = None):
_Logger.debug(msg)
resp.setMessage(msg)
return
else:
elif not test:
try:
from com.raytheon.uf.edex.plugin.manualIngest import MessageGenerator
if MessageGenerator.getInstance().sendFileToIngest(awipsPathname, INGEST_ROUTE):
@ -166,7 +167,22 @@ def process(oup, afosID, resp, ackMgr = None):
fos.write(attachedFile)
fos.flush()
fos.close()
if test:
try:
os.remove(awipsPathname)
except EnvironmentError:
pass # ignore
if attachedFilename:
try:
os.remove(attachedFilename)
except EnvironmentError:
pass # ignore
resp.setSendLocalSuccess(True)
resp.setSendWANSuccess(True)
return
messageIdToAcknowledge = None
#----------
# Check if product should be distributed over WAN via NCF

View file

@ -6,6 +6,7 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="dupElim" class="com.raytheon.uf.edex.ingest.DupElimSrv"/>
<bean id="persist" class="com.raytheon.uf.edex.ingest.PersistSrv" factory-method="getInstance"/>
<bean id="index" class="com.raytheon.uf.edex.ingest.IndexSrv"/>

View file

@ -105,7 +105,7 @@ then
log_msg "Finished running iscMosaic..."
# Generate a GFE message saying new Grids have arrived in Restore database.
cd ${GFESUITE_BIN}
sendGfeMessage -h ${SVCBU_HOST} -p ${CDSPORT} -u -m "Restore database has been populated with new grids."
./sendGfeMessage -h ${SVCBU_HOST} -p ${CDSPORT} -u -m "Restore database has been populated with new grids."
else
log_msg "Unable to locate the gridded data of the site,${import_file} You will need to request your backup site to send grids again."
log_msg 100

View file

@ -14,12 +14,14 @@ namespace VizLauncher.com.raytheon.viz.launcher.process
protected static readonly String LOG_SUFFIX = ".log";
protected Process process = null;
private StreamWriter logFileWriter;
protected VizEnvironment vizEnvironment;
private bool ready = false;
private String exceptionText = null;
public AbstractProcessLauncher(VizEnvironment vizEnvironment)
{
this.vizEnvironment = vizEnvironment;
// Prepare the log file.
if (Directory.Exists(vizEnvironment.getLogDirectory()) == false)
{
@ -56,8 +58,10 @@ namespace VizLauncher.com.raytheon.viz.launcher.process
{
ProcessStartInfo processStartInfo =
new ProcessStartInfo(this.constructProcessName(vizEnvironment.getLocation()));
// include the default system PATH in the application PATH
String systemPath = System.Environment.GetEnvironmentVariable("PATH");
processStartInfo.EnvironmentVariables[EnvironmentProperties.ENVIRONMENT_VARIABLE_PATH] =
vizEnvironment.getPath();
vizEnvironment.getPath() + this.getApplicationSpecificPath() + systemPath;
processStartInfo.EnvironmentVariables[EnvironmentProperties.ENVIRONMENT_VARIABLE_PYTHON_PATH] =
vizEnvironment.getPythonPath();
processStartInfo.UseShellExecute = false;
@ -119,6 +123,11 @@ namespace VizLauncher.com.raytheon.viz.launcher.process
return this.exceptionText;
}
protected virtual String getApplicationSpecificPath()
{
return String.Empty;
}
protected abstract String constructProcessName(String location);
protected abstract String constructLogName(String logDate);

View file

@ -12,14 +12,21 @@ namespace VizLauncher.com.raytheon.viz.launcher.process.impl
{
private static readonly String LOG_PREFIX = "cave_";
private static readonly String COMMAND_LINE_ARGUMENTS = "-component thinclient";
private static readonly String CAVE_EXECUTABLE =
Path.DirectorySeparatorChar + "CAVE" + Path.DirectorySeparatorChar + "cave.exe";
private static readonly String CAVE_DIRECTORY = Path.DirectorySeparatorChar + "CAVE";
private static readonly String CAVE_EXECUTABLE =
CAVE_DIRECTORY + Path.DirectorySeparatorChar + "cave.exe";
public CaveProcessLauncher(VizEnvironment vizEnvironment)
: base(vizEnvironment)
{
}
protected override String getApplicationSpecificPath()
{
return Path.PathSeparator + this.vizEnvironment.getLocation() +
CAVE_DIRECTORY + Path.DirectorySeparatorChar + "lib" + Path.PathSeparator;
}
protected override String constructProcessName(String location)
{
return location + CAVE_EXECUTABLE;

View file

@ -1 +1 @@
1a32b06c313e625de84f906b3a788e18d5fbf5a4
7d5b051039964b49fc7ac2336857ce70d216028f

View file

@ -1 +1 @@
8fe0a749af6fc67549da23d33fd3d63a094c1466
80c11668bbfe3803e0c4919198ed9da9a1a39b1b

Binary file not shown.

View file

@ -1 +1 @@
1a32b06c313e625de84f906b3a788e18d5fbf5a4
7d5b051039964b49fc7ac2336857ce70d216028f

View file

@ -1 +1 @@
8fe0a749af6fc67549da23d33fd3d63a094c1466
80c11668bbfe3803e0c4919198ed9da9a1a39b1b

View file

@ -29,6 +29,7 @@
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11/17/09 3580 brockwoo Initial Creation
* 11/19/13 2495 bclement changed dim arrays/lists to use npy_intp
*
* </pre>
*
@ -50,7 +51,7 @@ static int dimensions(PyObject * array) {
if (aDim == 3) {
returnValue |= 4; // 2d arrays
} else if (aDim == 2) {
npy_int * aDimList = PyArray_DIMS(array);
npy_intp * aDimList = PyArray_DIMS(array);
if (aDimList[0] == 1) {
returnValue |= 1; //linear array
}
@ -79,9 +80,9 @@ static PyObject * defineNumpySlice(PyObject *self, PyObject* args)
int * param3dDim;
int levelCount;
int vnz, pnz, vny , pny , vnx , pnx;
int dimSize[2];
npy_int * vdimList;
npy_int * pdimList;
npy_intp dimSize[2];
npy_intp * vdimList;
npy_intp * pdimList;
if (!PyArg_ParseTuple(args, "OOfi", &vc, &param, &targetLevel, &sense)) {
return NULL;
@ -211,9 +212,9 @@ static PyObject * createNumpySlice(PyObject *self, PyObject* args)
int * vc3dDim ;
int levelCount;
float * vc2d ;
int dimSize[2];
npy_int * vdimList;
npy_int * sdimList;
npy_intp dimSize[2];
npy_intp * vdimList;
npy_intp * sdimList;
if (!PyArg_ParseTuple(args, "OOOi|i", &vc, &s3d, &targetLevel, &sense, &hyb)) {
return NULL;

6
pythonPackages/numpy/numpy/core/numeric.py Executable file → Normal file
View file

@ -1493,8 +1493,10 @@ def set_string_function(f, repr=True):
else:
return multiarray.set_string_function(f, repr)
set_string_function(array_str, 0)
set_string_function(array_repr, 1)
# randerso DR #2513 remove calls to non-threadsafe set_string_function
# https://github.com/numpy/numpy/issues/3961
# set_string_function(array_str, 0)
# set_string_function(array_repr, 1)
little_endian = (sys.byteorder == 'little')

View file

@ -1,178 +0,0 @@
#
# AWIPS II Eclipse Spec File
#
# --define arguments:
# %{_uframe_eclipse}
# %{_build_root}
# %{_baseline_workspace}
Name: awips2-eclipse
Summary: AWIPS II Eclipse Distribution
Version: 3.6.1
Release: 1
Group: AWIPSII
BuildRoot: %{_build_root}
URL: N/A
License: N/A
Distribution: N/A
Vendor: Raytheon
Packager: Bryan Kowal
AutoReq: no
provides: awips2-eclipse
%description
AWIPS II Eclipse Distribution - Contains the AWIPS II Eclipse Distribution.
# Turn off the brp-python-bytecompile script
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
%prep
# Verify That The User Has Specified A BuildRoot.
if [ "%{_build_root}" = "/tmp" ]
then
echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
echo "Unable To Continue ... Terminating"
exit 1
fi
if [ -d %{_build_root} ]; then
rm -rf %{_build_root}
fi
mkdir -p %{_build_root}/awips2/eclipse
%build
%install
mkdir -p %{_build_root}/awips2/eclipse
# The location of the awips2 eclipse source directory will be
# specified as a command line argument. Fail if the specified
# directory cannot be found.
if [ ! -d %{_uframe_eclipse} ]; then
echo "ERROR: Unable To Find The AWIPS II Eclipse Distribution."
echo "Unable To Continue ... Terminating"
exit 1
fi
# Copy the uframe eclipse distribution.
cp -r %{_uframe_eclipse}/* %{_build_root}/awips2/eclipse
# Copy eclipse.sh to our build-directory.
cp %{_baseline_workspace}/rpms/awips2.ade/Installer.eclipse/scripts/* \
%{_build_root}/awips2/eclipse
# delete the basemaps and etc links
rm -f %{_build_root}/awips2/eclipse/basemaps
rm -f %{_build_root}/awips2/eclipse/etc
%pre
JAVA_INSTALL="<Not Installed>"
PYTHON_INSTALL="<Not Installed>"
ANT_INSTALL="<Not Installed>"
INSTALL_PATH="/awips2/java"
if [ -d ${INSTALL_PATH} ]; then
JAVA_INSTALL=${INSTALL_PATH}
fi
INSTALL_PATH="/awips2/python"
if [ -d ${INSTALL_PATH} ]; then
PYTHON_INSTALL=${INSTALL_PATH}
fi
INSTALL_PATH="/awips2/ant"
if [ -d ${INSTALL_PATH} ]; then
ANT_INSTALL=${INSTALL_PATH}
fi
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| Installing the AWIPS II Eclipse Distribution...\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m Java Detected At: ${JAVA_INSTALL}\e[m"
echo -e "\e[1;34m Python Detected At: ${PYTHON_INSTALL}\e[m"
echo -e "\e[1;34m Ant Detected At: ${ANT_INSTALL}\e[m"
%post
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;34m\| Creating ADE Eclipse Desktop Shortcut...\e[m"
echo -e "\e[1;34m--------------------------------------------------------------------------------\e[m"
ADE_ECLIPSE_SHORTCUT="ade-eclipse"
SHORTCUT_OWNER="${USER}"
CREATE_SHORTCUT="true"
if [ ! "${SUDO_USER}" = "" ]; then
SHORTCUT_OWNER="${SUDO_USER}"
fi
echo -e "\e[1;34m Creating Shortcut For User: ${SHORTCUT_OWNER}\e[m"
USER_HOME_DIR="~${SHORTCUT_OWNER}"
if [ ! -d ${USER_HOME_DIR} ]; then
USER_HOME_DIR="/home/${SHORTCUT_OWNER}"
echo " (Assuming User Home Directory Is Under '/home')"
fi
if [ ! -d ${USER_HOME_DIR}/Desktop ]; then
echo -e "\e[1;31m ERROR: Unable To Find The User's Desktop!!!"
CREATE_SHORTCUT="false"
fi
if [ "${CREATE_SHORTCUT}" = "true" ]; then
SHORTCUT_TMP="${USER_HOME_DIR}/Desktop/${ADE_ECLIPSE_SHORTCUT}.tmp"
SHORTCUT="${USER_HOME_DIR}/Desktop/${ADE_ECLIPSE_SHORTCUT}.desktop"
if [ -f ${SHORTCUT} ]; then
echo -n " Attempting To Remove The Existing Shortcut ... "
sudo -u ${SHORTCUT_OWNER} rm -f ${SHORTCUT}
if [ ! -f ${SHORTCUT} ]; then
echo -n "SUCCESS"
else
echo -n "FAILURE"
fi
echo ""
fi
sudo -u ${SHORTCUT_OWNER} touch ${SHORTCUT_TMP}
sudo -u ${SHORTCUT_OWNER} chmod 666 ${SHORTCUT_TMP}
echo "[Desktop Entry]" >> ${SHORTCUT_TMP}
echo "Version=1.0" >> ${SHORTCUT_TMP}
echo "Encoding=UTF-8" >> ${SHORTCUT_TMP}
echo "Name=ADE Eclipse" >> ${SHORTCUT_TMP}
echo "GenericName=Eclipse" >> ${SHORTCUT_TMP}
echo "Comment=IDE" >> ${SHORTCUT_TMP}
echo "Exec=/bin/bash -i -c \"xterm -title 'AWIPS II ADE Eclipse' -e '/awips2/eclipse/eclipseShortcutWrap.sh'\"" >> ${SHORTCUT_TMP}
echo "Icon=/awips2/eclipse/icon.xpm" >> ${SHORTCUT_TMP}
echo "Terminal=false" >> ${SHORTCUT_TMP}
echo "Type=Application" >> ${SHORTCUT_TMP}
echo "Categories=Development;IDE;" >> ${SHORTCUT_TMP}
sudo -u ${SHORTCUT_OWNER} mv ${SHORTCUT_TMP} ${SHORTCUT}
sudo -u ${SHORTCUT_OWNER} chmod 644 ${SHORTCUT}
fi
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
echo -e "\e[1;32m\| AWIPS II Eclipse Distribution Installation - COMPLETE\e[m"
echo -e "\e[1;32m--------------------------------------------------------------------------------\e[m"
%preun
%postun
%clean
rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(644,awips,fxalpha,755)
%dir /awips2/eclipse
/awips2/eclipse/*
%defattr(755,awips,fxalpha,755)
/awips2/eclipse/about.html
/awips2/eclipse/artifacts.xml
/awips2/eclipse/eclipse
/awips2/eclipse/eclipse.ini
/awips2/eclipse/eclipse.sh
/awips2/eclipse/eclipseShortcutWrap.sh
/awips2/eclipse/epl-v10.html
/awips2/eclipse/icon.xpm
/awips2/eclipse/libcairo-swt.so
/awips2/eclipse/notice.html

View file

@ -9,7 +9,7 @@
Name: awips2-python
Summary: AWIPS II Python Distribution
Version: 2.7.1
Release: 9.el6
Release: 10.el6
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: %{_build_arch}

View file

@ -48,4 +48,4 @@ if [ ! -f ${JAVA} ]; then
exit 1
fi
$JAVA -jar ${QPID_HOME}/bin/yajsw/wrapper.jar -c ${QPID_HOME}/conf/${CONF_FILE}
$JAVA -Xmx32m -XX:MaxPermSize=12m -XX:ReservedCodeCacheSize=4m -jar ${QPID_HOME}/bin/yajsw/wrapper.jar -c ${QPID_HOME}/conf/${CONF_FILE}

View file

@ -411,14 +411,17 @@ if [ "${1}" = "-viz" ]; then
buildRPM "awips2"
buildRPM "awips2-common-base"
#buildRPM "awips2-python-dynamicserialize"
#buildRPM "awips2-gfesuite-client"
#buildRPM "awips2-gfesuite-server"
#buildRPM "awips2-python-numpy"
buildRPM "awips2-python"
buildRPM "awips2-adapt-native"
#buildRPM "awips2-adapt-native"
#unpackHttpdPypies
#if [ $? -ne 0 ]; then
# exit 1
#fi
#buildRPM "awips2-httpd-pypies"
buildRPM "awips2-hydroapps-shared"
#buildRPM "awips2-hydroapps-shared"
#buildRPM "awips2-rcm"
#buildRPM "awips2-tools"
#buildRPM "awips2-cli"

View file

@ -9,7 +9,7 @@
Name: awips2-python-numpy
Summary: AWIPS II Python numpy Distribution
Version: 1.5.0
Release: 3.el6
Release: 3.el6.p1
Group: AWIPSII
BuildRoot: %{_build_root}
BuildArch: %{_build_arch}