14.1.1-12 baseline

Former-commit-id: 3b3b8ffbdadc65f41b67f2d649ec18e19521c989
This commit is contained in:
Steve Harris 2013-12-04 16:47:59 -05:00
parent 70a6f1936e
commit b24d9c80b0
24 changed files with 293 additions and 194 deletions

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,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

@ -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

@ -82,8 +82,8 @@ import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlertedAlar
* issue on the images being blank and throwing errors.
* Also cleaned up some code.
*
* Nov 26, 2013 DR16782 gzhang use Display.beep()
* </pre>
*
* @author lvenable
* @version 1.0
*/
@ -934,7 +934,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

@ -270,6 +270,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(

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

@ -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,11 +65,12 @@ 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;
/**
* Composite containing the product editor.
*
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
@ -81,12 +82,12 @@ import com.raytheon.viz.gfe.textformatter.TextFmtParserUtil;
* 03 Dec 2012 15620 ryu Unlock framed cities list for editing.
* 30 APR 2013 16095 ryu Modified updateTextStyle() to not lock edited text.
* 04 SEP 2013 16534 ryu Fixed word wrap to not insert duplicate text; refactor.
*
*
* </pre>
*
*
* @author lvenable
* @version 1.0
*
*
*/
public class StyledTextComp extends Composite {
private static final transient IUFStatusHandler statusHandler = UFStatus
@ -189,7 +190,7 @@ public class StyledTextComp extends Composite {
/**
* Constructor.
*
*
* @param parent
* Parent composite.
*/
@ -207,10 +208,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();
@ -227,6 +230,7 @@ public class StyledTextComp extends Composite {
createTextControl();
this.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent arg0) {
textFont.dispose();
bgColor.dispose();
@ -307,7 +311,7 @@ public class StyledTextComp extends Composite {
/**
* Get the StyledText editor.
*
*
* @return The StyledText editor.
*/
public StyledText getTextEditorST() {
@ -316,7 +320,7 @@ public class StyledTextComp extends Composite {
/**
* Set the product text.
*
*
* @param text
* The product text.
*/
@ -398,8 +402,7 @@ public class StyledTextComp extends Composite {
// should be unlocked. Cities list is unlocked for editing
// when framing codes are present.
if (newProduct) {
if (cityTip != null &&
cityTip.getText().indexOf("|*") > 0) {
if (cityTip != null && cityTip.getText().indexOf("|*") > 0) {
unlockCitySegs.add(ugc);
}
}
@ -411,8 +414,7 @@ public class StyledTextComp extends Composite {
lockLines(productTextArray, startLine, cityStart);
lockLines(productTextArray, cityEnd, endLine);
}
else {
} else {
lockLines(productTextArray, startLine, endLine);
}
}
@ -484,7 +486,7 @@ public class StyledTextComp extends Composite {
/**
* Parse the product text string.
*
*
* @param productText
*/
private void parseProductText(String productText) {
@ -564,7 +566,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);
}
@ -670,7 +672,7 @@ public class StyledTextComp extends Composite {
/**
* Handle the verify key event. This event fires after a change has been
* made to the control (after the text has been updated, for example)
*
*
* @param event
* Verify event that was fired.
*/
@ -731,8 +733,7 @@ public class StyledTextComp extends Composite {
// .getStyleRangeAtOffset(event.start + event.length + 1);
// if it's in a framing code, turn it red
if (startRange != null
&& endRange != null
if (startRange != null && endRange != null
&& event.start > startRange.start
&& event.start + event.length < endRange.start
&& startRange.similarTo(endRange)
@ -763,7 +764,7 @@ public class StyledTextComp extends Composite {
/**
* Handle the key event when a key is released.
*
*
* @param ke
* Key event.
*/
@ -785,7 +786,7 @@ public class StyledTextComp extends Composite {
/**
* Check if there is selected text and if there is locked text in the
* selected text.
*
*
* @return True if there is selected text that contains locked text.
*/
private boolean selectionHasLockedText() {
@ -799,12 +800,12 @@ public class StyledTextComp extends Composite {
/**
* Check if there is locked text in the specified range of text.
*
*
* @param offset
* The starting point of the locked text search.
* @param length
* The length of the search.
*
*
* @return Whether or not there is text in the range that contains locked
* text.
*/
@ -822,7 +823,7 @@ public class StyledTextComp extends Composite {
/**
* Select the framing code and the text contained in the framing code.
*
*
* @param sr
* StyleRange.
*/
@ -834,7 +835,7 @@ public class StyledTextComp extends Composite {
/**
* Check if the key being pressed is a "non-edit" key.
*
*
* @param event
* Verify event.
* @return True if the key is an arrow or "non-edit" key.
@ -856,6 +857,7 @@ public class StyledTextComp extends Composite {
private void createMouseListner() {
mouseListener = new Listener() {
@Override
public void handleEvent(Event e) {
if (e.type == SWT.MouseDown) {
handleMouseDown(e);
@ -868,7 +870,7 @@ public class StyledTextComp extends Composite {
/**
* Handle the mouse down event.
*
*
* @param e
* Event fired.
*/
@ -903,7 +905,7 @@ public class StyledTextComp extends Composite {
/**
* Handle the mouse up event
*
*
* @param e
* Event fired.
*/
@ -1010,7 +1012,7 @@ public class StyledTextComp extends Composite {
/**
* Checks if the system is editing, e.g. updating the issue time every
* minute, vs a user typing text in the text area
*
*
* @return
*/
private boolean isSystemTextChange() {
@ -1035,17 +1037,19 @@ public class StyledTextComp extends Composite {
}
protected boolean isUpperCase(final String word) {
for (int index= word.length() - 1; index >= 0; index--) {
if (Character.isLowerCase(word.charAt(index)))
for (int index = word.length() - 1; index >= 0; index--) {
if (Character.isLowerCase(word.charAt(index))) {
return false;
}
}
return true;
}
protected void upper() {
String text = textEditorST.getText();
if (isUpperCase(text))
if (isUpperCase(text)) {
return;
}
int topIdx = textEditorST.getTopIndex();
setProductText(textEditorST.getText().toUpperCase());
textEditorST.setTopIndex(topIdx);
@ -1161,7 +1165,7 @@ public class StyledTextComp extends Composite {
/**
* Getter for the column at which wrap and auto-wrap will wrap the text.
*
*
* @return the column number
*/
public int getWrapColumn() {
@ -1170,7 +1174,7 @@ public class StyledTextComp extends Composite {
/**
* Getter for the column at which wrap and auto-wrap will wrap the text.
*
*
* @param wrapColumn
* the column number
*/
@ -1209,7 +1213,7 @@ public class StyledTextComp extends Composite {
/**
* Query the prefs for setting. If it does not exist, use colorDft as its
* value. Create an SWT Color for display from the value and return it.
*
*
* @param prefs
* A preference store which might have config values.
* @param display
@ -1232,7 +1236,7 @@ public class StyledTextComp extends Composite {
/**
* Send a PROBLEM message if color1 is exactly equal to color2.
*
*
* @param color1
* the first color
* @param color2
@ -1259,7 +1263,7 @@ public class StyledTextComp extends Composite {
* <p>
* The getter name is different to avoid confusion with the getFgColor()
* method of Control.
*
*
* @return the foreground Color
*/
public Color getFgndColor() {
@ -1270,7 +1274,7 @@ public class StyledTextComp extends Composite {
* Get the framed text color of the StyledTextComp. This is the actual
* color, not a copy. It will be disposed when the StyledTextComp is, and
* should not be disposed before then.
*
*
* @return the frameColor
*/
public Color getFrameColor() {
@ -1281,7 +1285,7 @@ public class StyledTextComp extends Composite {
* Get the insert color of the StyledTextComp. This is the actual color, not
* a copy. It will be disposed when the StyledTextComp is, and should not be
* disposed before then.
*
*
* @return the insertColor
*/
public Color getInsertColor() {
@ -1292,7 +1296,7 @@ public class StyledTextComp extends Composite {
* Get the locked text color of the StyledTextComp. This is the actual
* color, not a copy. It will be disposed when the StyledTextComp is, and
* should not be disposed before then.
*
*
* @return the lockColor
*/
public Color getLockColor() {
@ -1302,7 +1306,7 @@ public class StyledTextComp extends Composite {
/**
* Word wrap the text in the block around cursorIndex. Adjust the cursor
* position to account for inserted or deleted whitespace.
*
*
* @param st
* The StyledText in which word wrap is to be performed
* @param cursorIndex
@ -1336,7 +1340,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;
}
@ -1393,7 +1397,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

@ -147,4 +147,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

@ -106,7 +106,7 @@ public class DupElimSrv {
newPdos.add(pdo);
} else {
// shouldn't be more than 1
PluginDataObject dbPdo = dbPdos.get(1);
PluginDataObject dbPdo = dbPdos.get(0);
if ((dbPdo == null)
|| !pdo.getDataURI().equals(dbPdo.getDataURI())) {
newPdos.add(pdo);

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

@ -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;

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

@ -400,10 +400,10 @@ 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-gfesuite-client"
#buildRPM "awips2-gfesuite-server"
#buildRPM "awips2-python-numpy"
buildRPM "awips2-python"
#buildRPM "awips2-adapt-native"
#unpackHttpdPypies
#if [ $? -ne 0 ]; then