VLab Issue #4003 - NCEP CAVE Plugins delivery for 14.2.1-n

Many configuration changes. Fixes for various display resources

Change-Id: I590a5c3770372ea234d693bbf53748793c7a4c47

Former-commit-id: 7c15e79189 [formerly 1a675e7e3f [formerly c23c487d0bdf5b0105e1fe297caee2406fcc2ed8]]
Former-commit-id: 1a675e7e3f
Former-commit-id: a232ad326d
This commit is contained in:
Stephen Gilbert 2014-07-23 15:54:48 -04:00
parent 8e79558516
commit 90e2c8b4f8
66 changed files with 7365 additions and 5885 deletions

View file

@ -15,6 +15,7 @@
* a NCMapEditor object as one of the arguments * a NCMapEditor object as one of the arguments
* Removed the call to setNcEditor() * Removed the call to setNcEditor()
* 08/17/2012 T655 B. Hebbard Added paintProps as parameter to IDisplayable draw (2) * 08/17/2012 T655 B. Hebbard Added paintProps as parameter to IDisplayable draw (2)
* 07/10/2014 Chin Chen added NcText new Admin Message Group
*/ */
package gov.noaa.nws.ncep.ui.nctextui.rsc; package gov.noaa.nws.ncep.ui.nctextui.rsc;
@ -424,7 +425,7 @@ public class NctextuiResource extends
each.dispose(); each.dispose();
} catch (Exception e) { } catch (Exception e) {
// e.printStackTrace(); e.printStackTrace();
// System.out.println("paintInternal caught draw exception!"); // System.out.println("paintInternal caught draw exception!");
} }
} }

View file

@ -11,6 +11,7 @@
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------- ------- -------- ----------- * ------- ------- -------- -----------
* 04/26/2011 229 Chin Chen Initial coding * 04/26/2011 229 Chin Chen Initial coding
* 07/16/2014 TTR828 Chin Chen swapped wind direction and wind speed lines at edit dialog
* *
* </pre> * </pre>
* *
@ -19,13 +20,13 @@
*/ */
package gov.noaa.nws.ncep.ui.nsharp.view; package gov.noaa.nws.ncep.ui.nsharp.view;
import java.util.List;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer; import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer;
import gov.noaa.nws.ncep.ui.nsharp.NsharpConstants; import gov.noaa.nws.ncep.ui.nsharp.NsharpConstants;
import gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor; import gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor;
import gov.noaa.nws.ncep.ui.nsharp.display.rsc.NsharpResourceHandler; import gov.noaa.nws.ncep.ui.nsharp.display.rsc.NsharpResourceHandler;
import java.util.List;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.window.IShellProvider; import org.eclipse.jface.window.IShellProvider;
@ -48,21 +49,33 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
public class NsharpEditDataDialog extends Dialog { public class NsharpEditDataDialog extends Dialog {
//private NcepLogger logger = NcepLoggerManager.getNcepCaveLogger(this.getClass()); // private NcepLogger logger =
// NcepLoggerManager.getNcepCaveLogger(this.getClass());
private List<NcSoundingLayer> curSoundingLayerList; private List<NcSoundingLayer> curSoundingLayerList;
private Text curTempText, newTempText, curDewText, newDewText, curWSpText, newWSpText, curWDirText, newWDirText,
curPressText, newPressText;//curHeightText, newHeightText; private Text curTempText, newTempText, curDewText, newDewText, curWSpText,
newWSpText, curWDirText, newWDirText, curPressText, newPressText;// curHeightText,
// newHeightText;
private static NsharpEditDataDialog thisDialog = null; private static NsharpEditDataDialog thisDialog = null;
private org.eclipse.swt.widgets.List pressureList; private org.eclipse.swt.widgets.List pressureList;
private String tempStr = "", dewStr = "", wspStr = "", wdirStr = ""; private String tempStr = "", dewStr = "", wspStr = "", wdirStr = "";
private org.eclipse.swt.graphics.Color lightGrey = new org.eclipse.swt.graphics.Color(Display.getDefault(), 211,211,211);
private org.eclipse.swt.graphics.Color lightGrey = new org.eclipse.swt.graphics.Color(
Display.getDefault(), 211, 211, 211);
private enum EditType { private enum EditType {
SELECTED_LEVEL, NEW_LEVEL SELECTED_LEVEL, NEW_LEVEL
} }
private EditType currentEditType; private EditType currentEditType;
private int selIndex = -1; private int selIndex = -1;
protected Composite top; protected Composite top;
public NsharpEditDataDialog(Shell parentShell) { public NsharpEditDataDialog(Shell parentShell) {
super(parentShell); super(parentShell);
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
@ -79,8 +92,7 @@ public class NsharpEditDataDialog extends Dialog {
thisDialog = new NsharpEditDataDialog(parShell); thisDialog = new NsharpEditDataDialog(parShell);
// System.out.println("new parcel dialog INSTANCE created"); // System.out.println("new parcel dialog INSTANCE created");
} } else {
else {
// System.out.println("current load dialog INSTANCE returned!"); // System.out.println("current load dialog INSTANCE returned!");
} }
@ -102,8 +114,11 @@ public class NsharpEditDataDialog extends Dialog {
Group pressureListGp = new Group(topGp, SWT.SHADOW_ETCHED_IN); Group pressureListGp = new Group(topGp, SWT.SHADOW_ETCHED_IN);
pressureListGp.setText("Pressure Level:"); pressureListGp.setText("Pressure Level:");
pressureList = new org.eclipse.swt.widgets.List(pressureListGp, SWT.BORDER | SWT.V_SCROLL ); pressureList = new org.eclipse.swt.widgets.List(pressureListGp,
pressureList.setBounds(pressureListGp.getBounds().x,pressureListGp.getBounds().y+ NsharpConstants.labelGap, NsharpConstants.listWidth, NsharpConstants.listHeight ); SWT.BORDER | SWT.V_SCROLL);
pressureList.setBounds(pressureListGp.getBounds().x,
pressureListGp.getBounds().y + NsharpConstants.labelGap,
NsharpConstants.listWidth + 40, NsharpConstants.listHeight);
NsharpResourceHandler rsc = null; NsharpResourceHandler rsc = null;
if (NsharpEditor.getActiveNsharpEditor() != null) if (NsharpEditor.getActiveNsharpEditor() != null)
rsc = NsharpEditor.getActiveNsharpEditor().getRscHandler(); rsc = NsharpEditor.getActiveNsharpEditor().getRscHandler();
@ -129,16 +144,19 @@ public class NsharpEditDataDialog extends Dialog {
public void handleEvent(Event event) { public void handleEvent(Event event) {
currentEditType = EditType.SELECTED_LEVEL; currentEditType = EditType.SELECTED_LEVEL;
if (selIndex != -1) { if (selIndex != -1) {
NcSoundingLayer selLevelSounding = curSoundingLayerList.get(selIndex); NcSoundingLayer selLevelSounding = curSoundingLayerList
.get(selIndex);
curTempText.setText("" + selLevelSounding.getTemperature()); curTempText.setText("" + selLevelSounding.getTemperature());
curDewText.setText("" + selLevelSounding.getDewpoint()); curDewText.setText("" + selLevelSounding.getDewpoint());
curWSpText.setText("" + selLevelSounding.getWindSpeed()); curWSpText.setText("" + selLevelSounding.getWindSpeed());
curWDirText.setText("" + selLevelSounding.getWindDirection()); curWDirText.setText(""
+ selLevelSounding.getWindDirection());
curPressText.setText("" + selLevelSounding.getPressure()); curPressText.setText("" + selLevelSounding.getPressure());
newTempText.setText("" + selLevelSounding.getTemperature()); newTempText.setText("" + selLevelSounding.getTemperature());
newDewText.setText("" + selLevelSounding.getDewpoint()); newDewText.setText("" + selLevelSounding.getDewpoint());
newWSpText.setText("" + selLevelSounding.getWindSpeed()); newWSpText.setText("" + selLevelSounding.getWindSpeed());
newWDirText.setText("" + selLevelSounding.getWindDirection()); newWDirText.setText(""
+ selLevelSounding.getWindDirection());
newPressText.setText("" + selLevelSounding.getPressure()); newPressText.setText("" + selLevelSounding.getPressure());
} }
} }
@ -162,7 +180,6 @@ public class NsharpEditDataDialog extends Dialog {
} }
}); });
Group top_form = new Group(top, SWT.SHADOW_ETCHED_IN); Group top_form = new Group(top, SWT.SHADOW_ETCHED_IN);
FormLayout formlayout = new FormLayout(); FormLayout formlayout = new FormLayout();
formlayout.marginRight = 20; formlayout.marginRight = 20;
@ -176,7 +193,8 @@ public class NsharpEditDataDialog extends Dialog {
string.getChars(0, chars.length, chars, 0); string.getChars(0, chars.length, chars, 0);
// to make sure user enter digits only // to make sure user enter digits only
for (int i = 0; i < chars.length; i++) { for (int i = 0; i < chars.length; i++) {
if (!('0' <= chars [i] && chars [i] <= '9') && chars [i] != '.' ) { if (!('0' <= chars[i] && chars[i] <= '9')
&& chars[i] != '.') {
e.doit = false; e.doit = false;
return; return;
} }
@ -190,7 +208,8 @@ public class NsharpEditDataDialog extends Dialog {
string.getChars(0, chars.length, chars, 0); string.getChars(0, chars.length, chars, 0);
// to make sure user enter digits only // to make sure user enter digits only
for (int i = 0; i < chars.length; i++) { for (int i = 0; i < chars.length; i++) {
if (!('0' <= chars [i] && chars [i] <= '9') && chars [i] != '.' && chars [i] != '-') { if (!('0' <= chars[i] && chars[i] <= '9')
&& chars[i] != '.' && chars[i] != '-') {
e.doit = false; e.doit = false;
return; return;
} }
@ -201,7 +220,7 @@ public class NsharpEditDataDialog extends Dialog {
curlbl.setText("Current Value"); curlbl.setText("Current Value");
FormData fd = new FormData(100, 20); FormData fd = new FormData(100, 20);
fd.top = new FormAttachment(0, 15); fd.top = new FormAttachment(0, 15);
fd.left = new FormAttachment( 0, 110 ); fd.left = new FormAttachment(0, 120);
fd.right = new FormAttachment(100, -105); fd.right = new FormAttachment(100, -105);
curlbl.setLayoutData(fd); curlbl.setLayoutData(fd);
@ -212,7 +231,8 @@ public class NsharpEditDataDialog extends Dialog {
fd2.left = new FormAttachment(curlbl, 10, SWT.RIGHT); fd2.left = new FormAttachment(curlbl, 10, SWT.RIGHT);
newlbl.setLayoutData(fd2); newlbl.setLayoutData(fd2);
curPressText = new Text( top_form, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); curPressText = new Text(top_form, SWT.SINGLE | SWT.BORDER
| SWT.READ_ONLY);
curPressText.setBackground(lightGrey); curPressText.setBackground(lightGrey);
fd = new FormData(100, 20); fd = new FormData(100, 20);
fd.top = new FormAttachment(curlbl, 5, SWT.BOTTOM); fd.top = new FormAttachment(curlbl, 5, SWT.BOTTOM);
@ -235,8 +255,8 @@ public class NsharpEditDataDialog extends Dialog {
newPressText.setLayoutData(fd2); newPressText.setLayoutData(fd2);
newPressText.addListener(SWT.Verify, positiveNumberListeener); newPressText.addListener(SWT.Verify, positiveNumberListeener);
curTempText = new Text(top_form, SWT.SINGLE | SWT.BORDER
curTempText = new Text( top_form, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); | SWT.READ_ONLY);
curTempText.setText(tempStr); curTempText.setText(tempStr);
curTempText.setBackground(lightGrey); curTempText.setBackground(lightGrey);
fd = new FormData(100, 20); fd = new FormData(100, 20);
@ -284,37 +304,14 @@ public class NsharpEditDataDialog extends Dialog {
newDewText.setLayoutData(fd2); newDewText.setLayoutData(fd2);
newDewText.addListener(SWT.Verify, numberListeener); newDewText.addListener(SWT.Verify, numberListeener);
curWSpText = new Text( top_form, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY ); curWDirText = new Text(top_form, SWT.SINGLE | SWT.BORDER
curWSpText.setText(wspStr); | SWT.READ_ONLY);
curWSpText.setBackground(lightGrey); curWDirText.setText(wdirStr);
curWDirText.setBackground(lightGrey);
fd = new FormData(100, 20); fd = new FormData(100, 20);
fd.top = new FormAttachment(curDewText, 5, SWT.BOTTOM); fd.top = new FormAttachment(curDewText, 5, SWT.BOTTOM);
fd.left = new FormAttachment(curDewText, 0, SWT.LEFT); fd.left = new FormAttachment(curDewText, 0, SWT.LEFT);
fd.right = new FormAttachment(curDewText, 0, SWT.RIGHT); fd.right = new FormAttachment(curDewText, 0, SWT.RIGHT);
curWSpText.setLayoutData( fd );
Label wsplbl = new Label( top_form, SWT.NONE );
wsplbl.setText("Wind Speed (Knot)");
fd1 = new FormData();
fd1.bottom = new FormAttachment( curWSpText, -4, SWT.BOTTOM );
fd1.right = new FormAttachment( curWSpText, -10, SWT.LEFT );
wsplbl.setLayoutData( fd1 );
newWSpText = new Text( top_form, SWT.SINGLE | SWT.BORDER );
newWSpText.setText("");
fd2 = new FormData(100, 20 );
fd2.bottom = new FormAttachment(curWSpText , 0, SWT.BOTTOM );
fd2.left = new FormAttachment( curWSpText, 10, SWT.RIGHT );
newWSpText.setLayoutData( fd2 );
newWSpText.addListener (SWT.Verify, positiveNumberListeener);
curWDirText = new Text( top_form, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
curWDirText.setText(wdirStr);
curWDirText.setBackground(lightGrey);
fd = new FormData( 100, 20 );
fd.top = new FormAttachment( curWSpText, 5, SWT.BOTTOM );
fd.left = new FormAttachment( curWSpText, 0, SWT.LEFT );
fd.right = new FormAttachment( curWSpText, 0, SWT.RIGHT );
curWDirText.setLayoutData(fd); curWDirText.setLayoutData(fd);
Label wdirlbl = new Label(top_form, SWT.NONE); Label wdirlbl = new Label(top_form, SWT.NONE);
@ -332,8 +329,32 @@ public class NsharpEditDataDialog extends Dialog {
newWDirText.setLayoutData(fd2); newWDirText.setLayoutData(fd2);
newWDirText.addListener(SWT.Verify, positiveNumberListeener); newWDirText.addListener(SWT.Verify, positiveNumberListeener);
curWSpText = new Text(top_form, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
curWSpText.setText(wspStr);
curWSpText.setBackground(lightGrey);
fd = new FormData(100, 20);
fd.top = new FormAttachment(curWDirText, 5, SWT.BOTTOM);
fd.left = new FormAttachment(curWDirText, 0, SWT.LEFT);
fd.right = new FormAttachment(curWDirText, 0, SWT.RIGHT);
curWSpText.setLayoutData(fd);
Label wsplbl = new Label(top_form, SWT.NONE);
wsplbl.setText("Wind Speed (Knot)");
fd1 = new FormData();
fd1.bottom = new FormAttachment(curWSpText, -4, SWT.BOTTOM);
fd1.right = new FormAttachment(curWSpText, -10, SWT.LEFT);
wsplbl.setLayoutData(fd1);
newWSpText = new Text(top_form, SWT.SINGLE | SWT.BORDER);
newWSpText.setText("");
fd2 = new FormData(100, 20);
fd2.bottom = new FormAttachment(curWSpText, 0, SWT.BOTTOM);
fd2.left = new FormAttachment(curWSpText, 10, SWT.RIGHT);
newWSpText.setLayoutData(fd2);
newWSpText.addListener(SWT.Verify, positiveNumberListeener);
} }
@Override @Override
protected void configureShell(Shell shell) { protected void configureShell(Shell shell) {
super.configureShell(shell); super.configureShell(shell);
@ -360,44 +381,38 @@ public class NsharpEditDataDialog extends Dialog {
try { try {
if ((textStr != null) && !(textStr.isEmpty())) { if ((textStr != null) && !(textStr.isEmpty())) {
winDir = Float.parseFloat(textStr); winDir = Float.parseFloat(textStr);
} } else
else
winDir = Float.parseFloat(curWDirText.getText()); winDir = Float.parseFloat(curWDirText.getText());
textStr = newWSpText.getText(); textStr = newWSpText.getText();
if ((textStr != null) && !(textStr.isEmpty())) { if ((textStr != null) && !(textStr.isEmpty())) {
winSpd = Float.parseFloat(textStr); winSpd = Float.parseFloat(textStr);
} } else
else
winSpd = Float.parseFloat(curWSpText.getText()); winSpd = Float.parseFloat(curWSpText.getText());
textStr = newDewText.getText(); textStr = newDewText.getText();
if ((textStr != null) && !(textStr.isEmpty())) { if ((textStr != null) && !(textStr.isEmpty())) {
dp = Float.parseFloat(textStr); dp = Float.parseFloat(textStr);
} } else
else
dp = Float.parseFloat(curDewText.getText()); dp = Float.parseFloat(curDewText.getText());
textStr = newTempText.getText(); textStr = newTempText.getText();
if ((textStr != null) && !(textStr.isEmpty())) { if ((textStr != null) && !(textStr.isEmpty())) {
tp = Float.parseFloat(textStr); tp = Float.parseFloat(textStr);
} } else
else
tp = Float.parseFloat(curTempText.getText()); tp = Float.parseFloat(curTempText.getText());
textStr = newPressText.getText(); textStr = newPressText.getText();
if ((textStr != null) && !(textStr.isEmpty())) { if ((textStr != null) && !(textStr.isEmpty())) {
press = Float.parseFloat(textStr); press = Float.parseFloat(textStr);
} } else
else
press = Float.parseFloat(curPressText.getText()); press = Float.parseFloat(curPressText.getText());
if ((dp > tp) || winDir >= 360.0) { if ((dp > tp) || winDir >= 360.0) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); Shell shell = PlatformUI.getWorkbench()
MessageBox mb = new MessageBox(shell, SWT.ICON_WARNING .getActiveWorkbenchWindow().getShell();
| SWT.OK); MessageBox mb = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
mb.setMessage("Invalid Data! (Dew Point > Temperature or Wind direction > 360)"); mb.setMessage("Invalid Data! (Dew Point > Temperature or Wind direction > 360)");
mb.open(); mb.open();
} } else {
else {
NsharpEditor editor = NsharpEditor.getActiveNsharpEditor(); NsharpEditor editor = NsharpEditor.getActiveNsharpEditor();
if (editor != null) { if (editor != null) {
NsharpResourceHandler rscHandler = editor.getRscHandler(); NsharpResourceHandler rscHandler = editor.getRscHandler();
@ -406,7 +421,8 @@ public class NsharpEditDataDialog extends Dialog {
rscHandler.addNewLayer(tp, dp, winSpd, winDir, press); rscHandler.addNewLayer(tp, dp, winSpd, winDir, press);
break; break;
case SELECTED_LEVEL: case SELECTED_LEVEL:
rscHandler.updateLayer(selIndex,tp, dp, winSpd, winDir, press); rscHandler.updateLayer(selIndex, tp, dp, winSpd,
winDir, press);
break; break;
default: default:
return; return;
@ -414,30 +430,36 @@ public class NsharpEditDataDialog extends Dialog {
editor.refresh(); editor.refresh();
} }
} }
} } catch (Exception e) {
catch (Exception e) {
// System.out.println("bad input entered " ); // System.out.println("bad input entered " );
return; return;
} }
} }
private boolean verifyNewlevelInput() { private boolean verifyNewlevelInput() {
if((newWDirText.getText().isEmpty()) || curWDirText.getText().isEmpty() if ((newWDirText.getText().isEmpty())
|| curWSpText.getText().isEmpty() || curDewText.getText().isEmpty() || curWDirText.getText().isEmpty()
|| curWSpText.getText().isEmpty()
|| curDewText.getText().isEmpty()
|| curTempText.getText().isEmpty()) { || curTempText.getText().isEmpty()) {
return false; return false;
} }
return true; return true;
} }
@Override @Override
public void createButtonsForButtonBar(Composite parent) { public void createButtonsForButtonBar(Composite parent) {
// create Apply and Close buttons by default // create Apply and Close buttons by default
Button okBtn = createButton(parent, IDialogConstants.CLIENT_ID, "Apply", true); Button okBtn = createButton(parent, IDialogConstants.CLIENT_ID,
"Apply", true);
okBtn.addListener(SWT.MouseUp, new Listener() { okBtn.addListener(SWT.MouseUp, new Listener() {
public void handleEvent(Event event) { public void handleEvent(Event event) {
// System.out.println("OK listener is called"); // System.out.println("OK listener is called");
if(currentEditType == EditType.NEW_LEVEL && verifyNewlevelInput()== false){ if (currentEditType == EditType.NEW_LEVEL
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); && verifyNewlevelInput() == false) {
Shell shell = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell();
MessageBox mb = new MessageBox(shell, SWT.ICON_WARNING MessageBox mb = new MessageBox(shell, SWT.ICON_WARNING
| SWT.OK); | SWT.OK);
@ -460,7 +482,6 @@ public class NsharpEditDataDialog extends Dialog {
}); });
} }
// @Override // @Override
// This function name is miss leading.... // This function name is miss leading....
// This function is called when CR is preseed, but NOT "ok" button. // This function is called when CR is preseed, but NOT "ok" button.

View file

@ -142,7 +142,7 @@ import com.vividsolutions.jts.linearref.LocationIndexedLine;
* 12/13 #1091 J. Wu Added getLayerMergeOption() * 12/13 #1091 J. Wu Added getLayerMergeOption()
* 05/14 TTR 995 J. Wu Added getContourLabelAutoPlacement(). * 05/14 TTR 995 J. Wu Added getContourLabelAutoPlacement().
* 05/14 TTR998 J. Wu Added pixelToLatlon(). * 05/14 TTR998 J. Wu Added pixelToLatlon().
* * 07/14 Chin Chen In latlonToPixel(), make sure not to add null pixel to its return pixel array
* </pre> * </pre>
* *
* @author * @author
@ -834,12 +834,14 @@ public class PgenUtil {
IMapDescriptor mapDescriptor) { IMapDescriptor mapDescriptor) {
double[] point = new double[3]; double[] point = new double[3];
double[][] pixels = new double[pts.length][3]; double[][] pixels = new double[pts.length][3];
double[] pixel;
for (int i = 0; i < pts.length; i++) { for (int i = 0; i < pts.length; i++) {
point[0] = pts[i].x; point[0] = pts[i].x;
point[1] = pts[i].y; point[1] = pts[i].y;
point[2] = 0.0; point[2] = 0.0;
pixels[i] = mapDescriptor.worldToPixel(point); pixel = mapDescriptor.worldToPixel(point);
if (pixel != null)
pixels[i] = pixel;
} }
return pixels; return pixels;

View file

@ -141,6 +141,7 @@ import com.vividsolutions.jts.operation.distance.DistanceOp;
* 11/13 TTR 752 J. Wu added methods to compute an element's range record. * 11/13 TTR 752 J. Wu added methods to compute an element's range record.
* 12/13 #1089 B. Yin Modify watch to display county list * 12/13 #1089 B. Yin Modify watch to display county list
* 05/14 TTR 995 J. Wu Make contour label auto-placement an option. * 05/14 TTR 995 J. Wu Make contour label auto-placement an option.
* 07/14 ? B. Yin Added support for dashed-line circle for TCM 12 feet sea.
* </pre> * </pre>
* *
* @author sgilbert * @author sgilbert
@ -1522,19 +1523,22 @@ public class DisplayElementFactory {
ArrayList<Coordinate> trackPts = new ArrayList<Coordinate>(); ArrayList<Coordinate> trackPts = new ArrayList<Coordinate>();
// draw wave quarters
slist.addAll(createDisplayElements(tcm.getWaveQuarters(), paintProps));
// draw wind forecast quarters and labels // draw wind forecast quarters and labels
for (TcmFcst tcmFcst : tcm.getTcmFcst()) { for (TcmFcst tcmFcst : tcm.getTcmFcst()) {
String[] txt = new String[2]; String[] txt = new String[2];
Calendar fcstHr = (Calendar) tcm.getAdvisoryTime().clone(); Calendar fcstHr = tcmFcst.getEndtime();
if (fcstHr == null) {
fcstHr = (Calendar) tcm.getAdvisoryTime().clone();
fcstHr.add(Calendar.HOUR_OF_DAY, tcmFcst.getFcstHr()); fcstHr.add(Calendar.HOUR_OF_DAY, tcmFcst.getFcstHr());
}
if (tcmFcst.equals(tcm.getTcmFcst().get(0))) { if (tcmFcst.equals(tcm.getTcmFcst().get(0))) {
txt[0] = tcm.getStormName() + "/" txt[1] = tcm.getStormName()
+ (int) tcm.getCentralPressure() + "mb"; + "/"
txt[1] = String.format("%1$td/%1$tH%1$tM", fcstHr); + (tcm.getCentralPressure() > 0 ? tcm
.getCentralPressure() : "xxx") + "mb";
txt[0] = String.format("%1$td/%1$tH%1$tM", fcstHr);
} else { } else {
txt[0] = String.format("%1$td/%1$tH%1$tM", fcstHr); txt[0] = String.format("%1$td/%1$tH%1$tM", fcstHr);
txt[1] = ""; txt[1] = "";
@ -1544,6 +1548,12 @@ public class DisplayElementFactory {
trackPts.add(tcmFcst.getQuarters()[0].getLocation()); trackPts.add(tcmFcst.getQuarters()[0].getLocation());
} }
// draw wave quarters
if (tcm.getWaveQuarters() != null) {
slist.addAll(createDisplayElements(tcm.getWaveQuarters(),
paintProps));
}
// draw track // draw track
if (trackPts.size() >= 2) { if (trackPts.size() >= 2) {
Line trackLn = new Line(null, Line trackLn = new Line(null,
@ -1581,7 +1591,7 @@ public class DisplayElementFactory {
TextJustification.LEFT_JUSTIFY, TextJustification.LEFT_JUSTIFY,
tcmFcst.getQuarters()[0].getLocation(), 0.0, tcmFcst.getQuarters()[0].getLocation(), 0.0,
/* TTR 895 TextRotation.NORTH_RELATIVE, */ /* TTR 895 TextRotation.NORTH_RELATIVE, */
TextRotation.SCREEN_RELATIVE, txt, FontStyle.REGULAR, TextRotation.SCREEN_RELATIVE, txt, FontStyle.BOLD,
getDisplayColor(Color.YELLOW), 4, 0, false, getDisplayColor(Color.YELLOW), 4, 0, false,
DisplayType.NORMAL, "Text", "General Text"); DisplayType.NORMAL, "Text", "General Text");
@ -1592,8 +1602,8 @@ public class DisplayElementFactory {
} }
/** /**
* Returns the TCM symbol according to the wind speed. Hurricane >= 64 knots * Returns the TCM symbol according to the wind speed. Hurricane >= 64
* TS >= 50 knots TD >= 32 knots Lx < 32 knots * knots, TS >= 34 knots, TD < 34 knots
* *
* @param tcmFcst * @param tcmFcst
* @return * @return
@ -1604,6 +1614,11 @@ public class DisplayElementFactory {
int maxWind = 0; int maxWind = 0;
if (tcmFcst instanceof TcmFcst) {
maxWind = ((TcmFcst) tcmFcst).getWindMax();
}
if (maxWind == 0) {
for (ITcmWindQuarter qtr : quarters) { for (ITcmWindQuarter qtr : quarters) {
double[] radius = qtr.getQuarters(); double[] radius = qtr.getQuarters();
for (double r : radius) { for (double r : radius) {
@ -1614,6 +1629,7 @@ public class DisplayElementFactory {
} }
} }
} }
}
double lat = quarters[0].getLocation().y; double lat = quarters[0].getLocation().y;
if (maxWind >= 64) { if (maxWind >= 64) {
@ -1621,15 +1637,15 @@ public class DisplayElementFactory {
ret = "HURRICANE_NH"; ret = "HURRICANE_NH";
else else
ret = "HURRICANE_SH"; ret = "HURRICANE_SH";
} else if (maxWind >= 50) { } else if (maxWind >= 34) {
if (lat > 0) if (lat > 0)
ret = "TROPICAL_STORM_NH"; ret = "TROPICAL_STORM_NH";
else else
ret = "TROPICAL_STORM_SH"; ret = "TROPICAL_STORM_SH";
} else if (maxWind >= 32) {
ret = "TROPICAL_DEPRESSION";
} else { } else {
ret = "LOW_X_FILLED"; ret = "TROPICAL_DEPRESSION";
// } else {
// ret = "LOW_X_FILLED";
} }
return ret; return ret;
@ -1648,13 +1664,58 @@ public class DisplayElementFactory {
ITcmWindQuarter quatros, PaintProperties paintProps) { ITcmWindQuarter quatros, PaintProperties paintProps) {
ArrayList<IDisplayable> slist = new ArrayList<IDisplayable>(); ArrayList<IDisplayable> slist = new ArrayList<IDisplayable>();
Coordinate center = quatros.getLocation();
Color color = Color.GREEN; Color color = Color.GREEN;
switch (quatros.getWindSpeed()) { switch (quatros.getWindSpeed()) {
case 0: case 0:
color = Color.GREEN; color = Color.GREEN;
break; Arc quatro1 = new Arc(null, color, (float) 1.5, 1.0, false, false,
case 32: 0, null, "Circle", center,
color = Color.BLUE; this.calculateDestinationPointMap(center, 0,
quatros.getQuarters()[0]), "Arc", 1, 0, 90);
Arc quatro2 = new Arc(null, color, (float) 1.5, 1.0, false, false,
0, null, "Circle", center,
this.calculateDestinationPointMap(center, 0,
quatros.getQuarters()[1]), "Arc", 1, 90, 180);
Arc quatro3 = new Arc(null, color, (float) 1.5, 1.0, false, false,
0, null, "Circle", center,
this.calculateDestinationPointMap(center, 0,
quatros.getQuarters()[2]), "Arc", 1, 180, 270);
Arc quatro4 = new Arc(null, color, (float) 1.5, 1.0, false, false,
0, null, "Circle", center,
this.calculateDestinationPointMap(center, 0,
quatros.getQuarters()[3]), "Arc", 1, 270, 360);
slist.addAll(createDisplayElements((IArc) quatro1, paintProps, 3));
slist.addAll(createDisplayElements((IArc) quatro2, paintProps, 3));
slist.addAll(createDisplayElements((IArc) quatro3, paintProps, 3));
slist.addAll(createDisplayElements((IArc) quatro4, paintProps, 3));
Line ln1 = getWindQuatroLine(getPointOnArc(quatro1, 0),
getPointOnArc(quatro2, 0), color);
ln1.setPgenType("LINE_DASHED_4");
Line ln2 = getWindQuatroLine(getPointOnArc(quatro2, 90),
getPointOnArc(quatro3, 90), color);
ln2.setPgenType("LINE_DASHED_4");
Line ln3 = getWindQuatroLine(getPointOnArc(quatro3, 180),
getPointOnArc(quatro4, 180), color);
ln3.setPgenType("LINE_DASHED_4");
Line ln4 = getWindQuatroLine(getPointOnArc(quatro4, 270),
getPointOnArc(quatro1, 270), color);
ln4.setPgenType("LINE_DASHED_4");
slist.addAll(createDisplayElements((ILine) ln1, paintProps));
slist.addAll(createDisplayElements((ILine) ln2, paintProps));
slist.addAll(createDisplayElements((ILine) ln3, paintProps));
slist.addAll(createDisplayElements((ILine) ln4, paintProps));
return slist;
case 34:
// make it consistent with NMAP
color = new Color(0, 150, 255);
break; break;
case 50: case 50:
color = Color.YELLOW; color = Color.YELLOW;
@ -1664,10 +1725,10 @@ public class DisplayElementFactory {
break; break;
} }
Coordinate center = quatros.getLocation();
Arc quatro1 = new Arc(null, color, (float) 1.5, 1.0, false, false, 0, Arc quatro1 = new Arc(null, color, (float) 1.5, 1.0, false, false, 0,
null, "Circle", center, this.calculateDestinationPointMap( null, "Circle", center, this.calculateDestinationPointMap(
center, 0, quatros.getQuarters()[0]), "Arc", 1, 0, 90); center, 0, quatros.getQuarters()[0]), "Arc", 1, 0, 90);
Arc quatro2 = new Arc(null, color, (float) 1.5, 1.0, false, false, 0, Arc quatro2 = new Arc(null, color, (float) 1.5, 1.0, false, false, 0,
null, "Circle", center, this.calculateDestinationPointMap( null, "Circle", center, this.calculateDestinationPointMap(
center, 0, quatros.getQuarters()[1]), "Arc", 1, 90, 180); center, 0, quatros.getQuarters()[1]), "Arc", 1, 90, 180);
@ -1704,6 +1765,121 @@ public class DisplayElementFactory {
return slist; return slist;
} }
/**
* Creates a list of IDisplayable Objects from an IArc object using
* dashed-line.
*
* @param arc
* A PGEN Drawable Element of an arc object
* @param paintProps
* The paint properties associated with the target
* @param dashlength
* length of dash segment in screen pixel.
* @return A list of IDisplayable elements
*/
public ArrayList<IDisplayable> createDisplayElements(IArc arc,
PaintProperties paintProps, double dashlength) {
setScales(paintProps);
/*
* Create the List to be returned, and wireframe shape
*/
ArrayList<IDisplayable> slist = new ArrayList<IDisplayable>();
IWireframeShape arcpts = target
.createWireframeShape(false, iDescriptor);
/*
* Convert center and circumference point from lat/lon to pixel
* coordinates.
*/
double[] tmp = { arc.getCenterPoint().x, arc.getCenterPoint().y, 0.0 };
double[] center = iDescriptor.worldToPixel(tmp);
double[] tmp2 = { arc.getCircumferencePoint().x,
arc.getCircumferencePoint().y, 0.0 };
double[] circum = iDescriptor.worldToPixel(tmp2);
/*
* calculate angle of major axis
*/
double axisAngle = Math.toDegrees(Math.atan2((circum[1] - center[1]),
(circum[0] - center[0])));
double cosineAxis = Math.cos(Math.toRadians(axisAngle));
double sineAxis = Math.sin(Math.toRadians(axisAngle));
/*
* calculate half lengths of major and minor axes
*/
double diff[] = { circum[0] - center[0], circum[1] - center[1] };
double major = Math.sqrt((diff[0] * diff[0]) + (diff[1] * diff[1]));
double minor = major * arc.getAxisRatio();
// calculate length of a single dash segment in degree.
double deltaAngle = (dashlength / (major / this.screenToExtent)) * 180;
int deltaA = (int) Math.round(deltaAngle);
if (deltaA <= 1)
deltaA = 2;
/*
* Calculate points along the arc
*/
double angle = arc.getStartAngle();
int numpts = (int) Math.round(arc.getEndAngle() - arc.getStartAngle()
+ 1.0);
double[][] path = new double[deltaA + 1][3];
int kk = 0;
boolean dash = false;
for (int j = 0; j < numpts; j++) {
if (!dash) {
double thisSine = Math.sin(Math.toRadians(angle));
double thisCosine = Math.cos(Math.toRadians(angle));
// Can maybe use simpler less expensive calculations for circle,
// if ever necessary.
// if ( arc.getAxisRatio() == 1.0 ) {
// path[j][0] = center[0] + (major * thisCosine );
// path[j][1] = center[1] + (minor * thisSine );
// }
// else {
path[kk][0] = center[0] + (major * cosineAxis * thisCosine)
- (minor * sineAxis * thisSine);
path[kk][1] = center[1] + (major * sineAxis * thisCosine)
+ (minor * cosineAxis * thisSine);
// }
// add a line segment for dash line
kk++;
if (kk - 1 == deltaA) {
arcpts.addLineSegment(path);
kk = 0;
dash = !dash;
}
} else {
// add a blank segement for the dash line
kk++;
if (kk >= deltaA - 2) {
dash = !dash;
kk = 0;
}
}
angle += 1.0;
}
/*
* Create new LineDisplayElement from wireframe shapes and add it to
* return list
*/
arcpts.compile();
slist.add(new LineDisplayElement(arcpts, getDisplayColor(arc
.getColors()[0]), arc.getLineWidth()));
// slist.addAll(adjustContourCircleLabel(arc, paintProps, path));
return slist;
}
/** /**
* Creates a list of IDisplayable Objects from an IArc object * Creates a list of IDisplayable Objects from an IArc object
* *

View file

@ -60,7 +60,7 @@ public class TcmFcst extends SinglePointElement implements ITcmFcst{
this.fcstHr = fcstHr; this.fcstHr = fcstHr;
this.setLocation(loc); this.setLocation(loc);
winds = new TcmWindQuarters[3]; winds = new TcmWindQuarters[3];
winds[0] = new TcmWindQuarters( loc, 32, quatros[0][0], quatros[1][0], quatros[2][0], quatros[3][0]); winds[0] = new TcmWindQuarters( loc, 34, quatros[0][0], quatros[1][0], quatros[2][0], quatros[3][0]);
winds[1] = new TcmWindQuarters( loc, 50, quatros[0][1], quatros[1][1], quatros[2][1], quatros[3][1]); winds[1] = new TcmWindQuarters( loc, 50, quatros[0][1], quatros[1][1], quatros[2][1], quatros[3][1]);
winds[2] = new TcmWindQuarters( loc, 64, quatros[0][2], quatros[1][2], quatros[2][2], quatros[3][2]); winds[2] = new TcmWindQuarters( loc, 64, quatros[0][2], quatros[1][2], quatros[2][2], quatros[3][2]);

View file

@ -6,24 +6,22 @@ import java.util.Date;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
/** /**
* *
* Model grid attribute sets must allow for a GDATTIM parameter that allows users to control * Model grid attribute sets must allow for a GDATTIM parameter that allows
* the default timeline tic mark pre-selection in terms of forecast hours. * users to control the default timeline tic mark pre-selection in terms of
* Typical use cases would be for precipitation (omit the first forecast hour F00), or when * forecast hours. Typical use cases would be for precipitation (omit the first
* the desk only performs analyses at F06, F12, F18 and F24 but the model data is of a much * forecast hour F00), or when the desk only performs analyses at F06, F12, F18
* higher frequency. These are just two examples. * and F24 but the model data is of a much higher frequency. These are just two
* examples.
* *
* Valid formats are numerous but currently only the following are implemented: * Valid formats are numerous but currently only the following are implemented:
* *
* LIST: GDATTIM=F1;F2;F3; ... ;Fn (forecast hours separated by semicolons, * LIST: GDATTIM=F1;F2;F3; ... ;Fn (forecast hours separated by semicolons,
* RANGE: GDATTIM=F1-F2[-INCR] (forecast hour range with an increment) * RANGE: GDATTIM=F1-F2[-INCR] (forecast hour range with an increment) ALL:
* ALL: GDATTIM=FALL (all forecast hours) * GDATTIM=FALL (all forecast hours)
* *
* Examples: * Examples: GDATTIM=F06;F12;F18;F24 GDATTIM=F06-F24-6 (same as above)
* GDATTIM=F06;F12;F18;F24
* GDATTIM=F06-F24-6 (same as above)
* GDATTIM=F12-F48-12 * GDATTIM=F12-F48-12
* *
* <pre> * <pre>
@ -32,6 +30,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
* ------------ ---------- --------------- -------------------------- * ------------ ---------- --------------- --------------------------
* 11/28/11 #518 Greg Hull created * 11/28/11 #518 Greg Hull created
* 04/24/13 689 Xiaochuan Add the frame should include end of time. * 04/24/13 689 Xiaochuan Add the frame should include end of time.
* 07/23/14 ? B. Yin Handle AllFxx and FirstFxx-LastFxx for grid analysis.
* *
* </pre> * </pre>
* *
@ -47,14 +46,13 @@ public class SelectableFrameTimeMatcher {
private ArrayList<DataTime> selectableTimes = new ArrayList<DataTime>(); private ArrayList<DataTime> selectableTimes = new ArrayList<DataTime>();
public SelectableFrameTimeMatcher(String timeMatchStr) throws VizException { public SelectableFrameTimeMatcher(String timeMatchStr) throws VizException {
// parse the string and create a list of times // parse the string and create a list of times
// //
if (timeMatchStr == null || timeMatchStr.isEmpty()) { if (timeMatchStr == null || timeMatchStr.isEmpty()) {
throw new VizException("SelectableFrameTimeMatcher: null/empty string"); throw new VizException(
"SelectableFrameTimeMatcher: null/empty string");
} }
timeMatchStr = timeMatchStr.toLowerCase().trim(); timeMatchStr = timeMatchStr.toLowerCase().trim();
@ -64,6 +62,14 @@ public class SelectableFrameTimeMatcher {
return; return;
} }
// for grid analysis GDATTIM in format "ALLFxx" or "FIRSTFxx-LASTFxx"
if (timeMatchStr.toUpperCase().contains("ALLF")
|| (timeMatchStr.toUpperCase().contains("FIRSTF") && timeMatchStr
.toUpperCase().contains("LASTF"))) {
matchAll = true;
return;
}
String[] subStrs = timeMatchStr.split(";"); String[] subStrs = timeMatchStr.split(";");
// each semi-colon delimited subString may be either // each semi-colon delimited subString may be either
@ -75,10 +81,11 @@ public class SelectableFrameTimeMatcher {
// //
if (subStr.indexOf('-') > 0) { if (subStr.indexOf('-') > 0) {
String startEndIncrStrs[] = subStr.split("-"); String startEndIncrStrs[] = subStr.split("-");
if( startEndIncrStrs.length < 2 || if (startEndIncrStrs.length < 2 || startEndIncrStrs.length > 3) {
startEndIncrStrs.length > 3 ) { // System.out.println("Error Parsing GDATTIME string "+timeMatchStr
// System.out.println("Error Parsing GDATTIME string "+timeMatchStr ); // );
throw new VizException("SelectableFrameTimeMatcher: Error Parsing GDATTIME string: " throw new VizException(
"SelectableFrameTimeMatcher: Error Parsing GDATTIME string: "
+ timeMatchStr); + timeMatchStr);
} }
@ -97,14 +104,14 @@ public class SelectableFrameTimeMatcher {
// Note : this logic will need to change when we add parsing of // Note : this logic will need to change when we add parsing of
// full GDATTIM syntax. // full GDATTIM syntax.
for( Integer f = startTime.getFcstTime() ; f <= endTime.getFcstTime() ; f += incr ) { for (Integer f = startTime.getFcstTime(); f <= endTime
selectableTimes.add( .getFcstTime(); f += incr) {
new DataTime( startTime.getRefTime(), f )); selectableTimes
.add(new DataTime(startTime.getRefTime(), f));
} }
} } else { // else if matching a single time
else { // else if matching a single time
DataTime dt = parseTime(subStr.trim()); DataTime dt = parseTime(subStr.trim());
if (dt != null) { if (dt != null) {
@ -124,14 +131,13 @@ public class SelectableFrameTimeMatcher {
// 'null' refTime and fcst time in seconds // 'null' refTime and fcst time in seconds
return new DataTime(new Date(0), fcstHr * 60 * 60); // return new DataTime(new Date(0), fcstHr * 60 * 60); //
} } else if (timeStr.equals("last")) {
else if( timeStr.equals("last") ) {
// 'null' refTime and fcst time in seconds // 'null' refTime and fcst time in seconds
return new DataTime(new Date(0), MAX_FCST_HR * 60 * 60); // return new DataTime(new Date(0), MAX_FCST_HR * 60 * 60); //
} } else {
else {
// System.out.println("SelectableFrameTimeMatcher can't parse GDATTIM token"+timeStr); // System.out.println("SelectableFrameTimeMatcher can't parse GDATTIM token"+timeStr);
throw new VizException("SelectableFrameTimeMatcher: Error Parsing GDATTIME token: " throw new VizException(
"SelectableFrameTimeMatcher: Error Parsing GDATTIME token: "
+ timeStr); + timeStr);
} }
} }
@ -143,7 +149,8 @@ public class SelectableFrameTimeMatcher {
for (DataTime dt : selectableTimes) { for (DataTime dt : selectableTimes) {
// TODO : add check for ref time later. For now just test the forecast times. // TODO : add check for ref time later. For now just test the
// forecast times.
// //
// if( dt.getRefTime() != null ) { // if( dt.getRefTime() != null ) {
// //
@ -157,4 +164,3 @@ public class SelectableFrameTimeMatcher {
return false; return false;
} }
} }

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>ECMWF0P25</resource>
<attrSetGroupName>standard</attrSetGroupName>
<attrSetNames>500mb_hght_geoabsv,850mb_tmp,ethkn,pmsl_ethkn</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>ECMWF_HR</resource>
<attrSetGroupName>standard</attrSetGroupName>
<attrSetNames>500mb_hght_geoabsv,850mb_tmp,ethkn,pmsl_ethkn</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType">
<resource>GFS0P5</resource>
<attrSetGroupName>basic_wx</attrSetGroupName>
<attrSetNames>1000-470mb_rh_rs_t_700mb_vv_global,1000-500mb_rh,200mb_vorticity_pw,250mb_vorticity_pw,300-700_q-vctrs_thkn,300mb_vorticity_pw,bl_thte_wind_global,ct_index_global,great_lakes_snow_global,great_lakes_snow2_global,lifted_index_global,pmsl_thkn_wind,pmsl_1000-850_thk_global,pmsl_bl_temp_wind,precip_6hr_1000-500_thkn,precip_type_global,precip_type_vv_global,pmsl_thkn</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>hurricane</attrSetGroupName>
<attrSetNames>250mb_hght_wind,250mb_wind_and_rel_vort,500mb_hght_absv,500mb_wind_and_rel_vort,700mb_wind_and_rel_vort,850-300mb_wind_shear,850mb_wind_and_rel_vort</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>intl_sam</attrSetGroupName>
<attrSetNames>bl_2-meter_temp_c,bl_dwpt_c,svrwx_intl</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>marine</attrSetGroupName>
<attrSetNames>1000mb_hght_absv,500mb_hght_absv,850mb_hght_absv,bl_moisture_conv_thtae,pmsl_1000-850_thk_global,pmsl_bl_temp_wind,pmsl_and_bl_wind_global,pmsl_and_bl_wind_global,precip_water_pmsl,stability_850mb_wnd_global,stability_950mb_wnd</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>medr</attrSetGroupName>
<attrSetNames>1000-500_thkn,bl_1000mb_temp,bl_2-meter_temp,bl_sgma_9950_temp</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>misc</attrSetGroupName>
<attrSetNames>300-700_q-vctrs_thkn</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>monochrome</attrSetGroupName>
<attrSetNames>bl_thte_wind_mono_global,pmsl_thkn_wind_mono_global</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>no_col-fill</attrSetGroupName>
<attrSetNames>250mb_hght_wind_ncf,400mb_avg_rh_ncf,500mb_absv_ncf,500mb_hght_absv_ncf,700mb_hght_rh_omega_ncf,850mb_hght_tmp_wind_ncf,850mb_wind_pw,850mb_wind_pw_mm_ncf,bl_h2o_conv_ncf_global,lifted_index_ncf,pcpn_potential_ncf_global,precip_type_vv_ncf_global</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType">
<resource>GFS0P5</resource>
<attrSetGroupName>precip</attrSetGroupName>
<attrSetNames>precip_12hr,precip_12hr_mm,precip_24hr,precip_24hr_mm,precip_3-day,precip_4-day,precip_48hr,precip_5-day,precip_54hr,precip_60hr,precip_66hr,precip_6hr,precip_6hr_mslp,precip_6hr_mslp_sfchght,precip_6hr_mslphilo,precip_72hr,precip_78hr</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>qpf</attrSetGroupName>
<attrSetNames>300mb_ageo_div_isotachs,700mb_hght_wind_dwpt,850mb_h2o_transport,850mb_hght_wind_dwpt,850mb_thtae_advection,850mb_wind_pw,bl_moistconv_wind_dwpt_global,kindex_700mbtemp_bldwpt_mslp_global,lifted_index_global,pcpn_potential_global,pw_emsl_c-vec,ransnocsi_500-850,ransnocsi_700-850,svrwx_global,hud_hvyqpf_stnd</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType">
<resource>GFS0P5</resource>
<attrSetGroupName>standard</attrSetGroupName>
<attrSetNames>1000-500_thkn,1000-850_thkn,1000mb_hght_tmp_wind,100mb_hght_wind,150mb_hght_wind,200mb_div_isotachs,200mb_hght_wind,250mb_ageo_div_isotachs,250mb_hght_wind,250mb_wind_and_rel_vort,300mb_div_isotachs,300mb_hght_absv_adv,300mb_hght_wind,300mb_hght_tmp_wind,500mb_hght_absv,500mb_hght_absv_adv,500mb_hght_absv_wnd,500mb_hght_color,500mb_hght_geoabsv,500mb_hght_wind,500mb_hght_tmp_wind,50mb_hght_wind,600mb_hght_rh_omega,700mb_hght_rh_omega,700mb_hght_tmp_wind,700mb_rh_rs_temp_global,70mb_hght_wind,850-700_thkn,850mb_hght_tmp_wind,pmsl,pmsl_thkn,pmsl_and_bl_wind_global,300-200mb_pv,400-200mb_pv,400-250mb_pv_global,500-250mb_pv,500-300mb_pv,500mb_hght</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>surface</attrSetGroupName>
<attrSetNames>1000-500_thkn,1000-850_thkn,500mb_absv_ncf,500mb_hght,850-700_thkn,850mb_thtae_ncf,bl_thte_ncf,pmsl</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType" xmlns:ns3="group">
<resource>GFS0P5</resource>
<attrSetGroupName>tropical</attrSetGroupName>
<attrSetNames>1000-500mb_rh,500mb_hght_absv,850-300mb_wind_shear,850mb_wind_pw_mm,bl_moisture_conv_thtae,bl_thte_wind_global,mlw_pmsl,pmsl_bl_temp_wind,pmsl_thkn_850mb_wind,pmsl_and_bl_wind_global,precip_water_pmsl,precip_water_pmsl_mm</attrSetNames>
</AttributeSetGroup>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AttributeSetGroup xmlns:ns2="http://www.example.org/productType">
<resource>RTMA_HR</resource>
<attrSetGroupName>standard</attrSetGroupName>
<attrSetNames>surface_pressure</attrSetNames>
</AttributeSetGroup>

View file

@ -21,7 +21,7 @@
<Position>LR</Position> <Position>LR</Position>
<Color red="205" green="133" blue="0"/> <Color red="205" green="133" blue="0"/>
</PlotModelElement> </PlotModelElement>
<PlotModelElement symbolSize="2" textStyle="Bold" textFont="Courier" textSize="14" paramName="BRBK"> <PlotModelElement symbolSize="1" textStyle="Bold" textFont="Courier" textSize="14" paramName="BRBK">
<Position>WD</Position> <Position>WD</Position>
<Color red="0" green="255" blue="255"/> <Color red="0" green="255" blue="255"/>
</PlotModelElement> </PlotModelElement>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<predefinedArea areaName="Africa" mapCenter="38.00 3.0 0.0"> <predefinedArea areaName="Africa" mapCenter="18.00 3.0 0.0">
<zoomLevel>.22</zoomLevel> <zoomLevel>.36</zoomLevel>
<gridGeometry envelopeMaxY="1.3E7" envelopeMinY="-1.3E7" envelopeMaxX="2.0E7" envelopeMinX="-2.0E7" rangeY="0 9999" rangeX="0 15384"> <gridGeometry envelopeMaxY="1.3E7" envelopeMinY="-1.3E7" envelopeMaxX="2.0E7" envelopeMinX="-2.0E7" rangeY="0 9999" rangeX="0 15384">
<CRS>PROJCS["Mercator_1SP", <CRS>PROJCS["Mercator_1SP",
GEOGCS["WGS84", GEOGCS["WGS84",
@ -14,7 +14,7 @@
PARAMETER["semi_major", 6371200.0], PARAMETER["semi_major", 6371200.0],
PARAMETER["semi_minor", 6371200.0], PARAMETER["semi_minor", 6371200.0],
PARAMETER["latitude_of_origin", 0.0], PARAMETER["latitude_of_origin", 0.0],
PARAMETER["central_meridian", -180.0], PARAMETER["central_meridian", 0.0],
PARAMETER["scale_factor", 1.0], PARAMETER["scale_factor", 1.0],
PARAMETER["false_easting", 0.0], PARAMETER["false_easting", 0.0],
PARAMETER["false_northing", 0.0], PARAMETER["false_northing", 0.0],

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResourceDefinition xmlns:ns2="group" xmlns:ns3="http://www.example.org/productType">
<inventoryEnabled>true</inventoryEnabled>
<resourceDefnName>ECMWF0P25</resourceDefnName>
<resourceCategory>GRID</resourceCategory>
<resourceParameters>
GDFILE=ecmwf0p25
pluginName=grid
</resourceParameters>
<rscImplementation>ModelFcstGridContours</rscImplementation>
<subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>CLOSEST_BEFORE_OR_AFTER</timeMatchMethod>
<frameSpan>60</frameSpan>
<timelineGenMethod>USE_CYCLE_TIME_FCST_HOURS</timelineGenMethod>
<dfltFrameCount>999</dfltFrameCount>
<dfltTimeRange>48</dfltTimeRange>
<dfltGeogArea>BasicWX_US</dfltGeogArea>
</ResourceDefinition>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResourceDefinition xmlns:ns2="http://www.example.org/productType">
<resourceDefnName>ECMWF_HR</resourceDefnName>
<resourceCategory>GRID</resourceCategory>
<rscImplementation>ModelFcstGridContours</rscImplementation>
<subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>CLOSEST_BEFORE_OR_AFTER</timeMatchMethod>
<frameSpan>60</frameSpan>
<timelineGenMethod>USE_CYCLE_TIME_FCST_HOURS</timelineGenMethod>
<dfltFrameCount>999</dfltFrameCount>
<dfltTimeRange>48</dfltTimeRange>
<dfltGeogArea>BasicWX_US</dfltGeogArea>
<resourceParameters>
pluginName=grid
GDFILE=ecmwfP25
</resourceParameters>
<inventoryEnabled>true</inventoryEnabled>
</ResourceDefinition>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResourceDefinition xmlns:ns2="group" xmlns:ns3="http://www.example.org/productType">
<inventoryEnabled>true</inventoryEnabled>
<resourceDefnName>GFS0P5</resourceDefnName>
<resourceCategory>GRID</resourceCategory>
<resourceParameters>
GDFILE=GFS230
pluginName=grid
</resourceParameters>
<rscImplementation>ModelFcstGridContours</rscImplementation>
<subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>CLOSEST_BEFORE_OR_AFTER</timeMatchMethod>
<frameSpan>60</frameSpan>
<timelineGenMethod>USE_CYCLE_TIME_FCST_HOURS</timelineGenMethod>
<dfltFrameCount>999</dfltFrameCount>
<dfltTimeRange>384</dfltTimeRange>
<dfltGeogArea>BasicWX_US</dfltGeogArea>
</ResourceDefinition>

View file

@ -10,6 +10,7 @@ color=RGB {155, 155, 155}
<rscImplementation>SVRL</rscImplementation> <rscImplementation>SVRL</rscImplementation>
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>EVENT</timeMatchMethod>
<frameSpan>10</frameSpan> <frameSpan>10</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>37</dfltFrameCount> <dfltFrameCount>37</dfltFrameCount>

View file

@ -10,6 +10,7 @@ color=RGB {155, 155, 155}
<rscImplementation>Warn</rscImplementation> <rscImplementation>Warn</rscImplementation>
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>EVENT</timeMatchMethod>
<frameSpan>10</frameSpan> <frameSpan>10</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>37</dfltFrameCount> <dfltFrameCount>37</dfltFrameCount>

View file

@ -13,6 +13,7 @@ legendName=WATCH
<rscImplementation>WATCH</rscImplementation> <rscImplementation>WATCH</rscImplementation>
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>EVENT</timeMatchMethod>
<frameSpan>10</frameSpan> <frameSpan>10</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>37</dfltFrameCount> <dfltFrameCount>37</dfltFrameCount>

View file

@ -10,6 +10,7 @@ color=RGB {155, 155, 155}
<rscImplementation>WCN</rscImplementation> <rscImplementation>WCN</rscImplementation>
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>EVENT</timeMatchMethod>
<frameSpan>10</frameSpan> <frameSpan>10</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>37</dfltFrameCount> <dfltFrameCount>37</dfltFrameCount>

View file

@ -10,6 +10,7 @@ color=RGB {0, 100, 255}
<rscImplementation>WCP</rscImplementation> <rscImplementation>WCP</rscImplementation>
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>EVENT</timeMatchMethod>
<frameSpan>10</frameSpan> <frameSpan>10</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>37</dfltFrameCount> <dfltFrameCount>37</dfltFrameCount>

View file

@ -10,6 +10,7 @@ color=RGB {155, 155, 155}
<rscImplementation>WOU</rscImplementation> <rscImplementation>WOU</rscImplementation>
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>EVENT</timeMatchMethod>
<frameSpan>10</frameSpan> <frameSpan>10</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>37</dfltFrameCount> <dfltFrameCount>37</dfltFrameCount>

View file

@ -11,6 +11,7 @@ legendColor=RGB {255, 255, 255}
<rscImplementation>WSTM</rscImplementation> <rscImplementation>WSTM</rscImplementation>
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>EVENT</timeMatchMethod>
<frameSpan>30</frameSpan> <frameSpan>30</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>25</dfltFrameCount> <dfltFrameCount>25</dfltFrameCount>

View file

@ -95,6 +95,9 @@
<ResourceDefinitionFilter isEnabled="true" rscDefnName="SHIP"> <ResourceDefinitionFilter isEnabled="true" rscDefnName="SHIP">
<filters>Observed</filters> <filters>Observed</filters>
</ResourceDefinitionFilter> </ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="SHIP6HR">
<filters>Observed</filters>
</ResourceDefinitionFilter>
<!-- PGEN Display Resources --> <!-- PGEN Display Resources -->
<ResourceDefinitionFilter isEnabled="true" rscDefnName="CCFP"> <ResourceDefinitionFilter isEnabled="true" rscDefnName="CCFP">
<filters>CCFP</filters> <filters>CCFP</filters>
@ -913,7 +916,13 @@
<filters>Forecast,Ensemble,SBN</filters> <filters>Forecast,Ensemble,SBN</filters>
</ResourceDefinitionFilter> </ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="ECMWF_NH"> <ResourceDefinitionFilter isEnabled="true" rscDefnName="ECMWF_NH">
</ResourceDefinitionFilter>
<filters>Forecast,SBN</filters> <filters>Forecast,SBN</filters>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="ECMWF_HR">
<filters>Forecast,NSBN</filters>
</ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="ECMWF0P25">
<filters>Forecast,NSBN</filters>
</ResourceDefinitionFilter> </ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="RAP40"> <ResourceDefinitionFilter isEnabled="true" rscDefnName="RAP40">
<filters>Forecast,Regional,SBN</filters> <filters>Forecast,Regional,SBN</filters>
@ -936,6 +945,9 @@
<ResourceDefinitionFilter isEnabled="true" rscDefnName="GFS"> <ResourceDefinitionFilter isEnabled="true" rscDefnName="GFS">
<filters>Forecast,Global</filters> <filters>Forecast,Global</filters>
</ResourceDefinitionFilter> </ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="GFS0P5">
<filters>Forecast,Global</filters>
</ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="UKENS_NA"> <ResourceDefinitionFilter isEnabled="true" rscDefnName="UKENS_NA">
<filters>Forecast,Ensemble</filters> <filters>Forecast,Ensemble</filters>
</ResourceDefinitionFilter> </ResourceDefinitionFilter>
@ -1344,10 +1356,10 @@
<ResourceDefinitionFilter isEnabled="false" rscDefnName="METEOSAT8"> <ResourceDefinitionFilter isEnabled="false" rscDefnName="METEOSAT8">
<filters>McIdas,METEOSAT</filters> <filters>McIdas,METEOSAT</filters>
</ResourceDefinitionFilter> </ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="METEOSAT9"> <ResourceDefinitionFilter isEnabled="false" rscDefnName="METEOSAT9">
<filters>Standard,McIdas,METEOSAT</filters> <filters>Standard,McIdas,METEOSAT</filters>
</ResourceDefinitionFilter> </ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="false" rscDefnName="METEOSAT10"> <ResourceDefinitionFilter isEnabled="true" rscDefnName="METEOSAT10">
<filters>McIdas,METEOSAT</filters> <filters>McIdas,METEOSAT</filters>
</ResourceDefinitionFilter> </ResourceDefinitionFilter>
<ResourceDefinitionFilter isEnabled="true" rscDefnName="GINI_GOES11"> <ResourceDefinitionFilter isEnabled="true" rscDefnName="GINI_GOES11">

View file

@ -13,7 +13,7 @@ legendColor=RGB {0, 255, 0}
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>CLOSEST_BEFORE_OR_AFTER</timeMatchMethod> <timeMatchMethod>CLOSEST_BEFORE_OR_AFTER</timeMatchMethod>
<frameSpan>360</frameSpan> <frameSpan>60</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>10</dfltFrameCount> <dfltFrameCount>10</dfltFrameCount>
<dfltTimeRange>48</dfltTimeRange> <dfltTimeRange>48</dfltTimeRange>

View file

@ -0,0 +1,5 @@
! Parameters and Attributes for the default UAIR Resource
plotModel=@PlotModels/sfcobs/ship_standard.xml
plotDensity=12
conditionalFilter=
reportType=1003,1004,1005,1006,1007

View file

@ -2,3 +2,4 @@
plotModel=@PlotModels/sfcobs/ship_standard.xml plotModel=@PlotModels/sfcobs/ship_standard.xml
plotDensity=12 plotDensity=12
conditionalFilter= conditionalFilter=
reportType=1003

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResourceDefinition xmlns:ns2="group" xmlns:ns3="http://www.example.org/productType">
<resourceDefnName>SHIP6HR</resourceDefnName>
<resourceCategory>SURFACE</resourceCategory>
<resourceParameters>
legendString=SHIP
pluginName=sfcobs
reportType=1003
spiFile=MTR.spi
legendColor=RGB {0, 255, 0}
</resourceParameters>
<rscImplementation>SurfacePlot</rscImplementation>
<subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>CLOSEST_AFTER_OR_EQUAL</timeMatchMethod>
<frameSpan>360</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>10</dfltFrameCount>
<dfltTimeRange>48</dfltTimeRange>
<dfltGeogArea>BasicWX_US</dfltGeogArea>
</ResourceDefinition>

View file

@ -0,0 +1,5 @@
! Parameters and Attributes for the default UAIR Resource
plotModel=@PlotModels/sfcobs/ship_standard.xml
plotDensity=12
conditionalFilter=
reportType=1003

View file

@ -1,5 +1,5 @@
! Parameters and Attributes for the default UAIR Resource ! Parameters and Attributes for the default UAIR Resource
levelKey=700 levelKey=700
plotModel=@PlotModels/ncuair/standard.xml plotModel=@PlotModels/ncuair/standard.xml
plotDensity=10 plotDensity=30
conditionalFilter= conditionalFilter=

View file

@ -13,7 +13,7 @@ legendColor=RGB {0, 255, 0}
<subTypeGenerator></subTypeGenerator> <subTypeGenerator></subTypeGenerator>
<rscTypeGenerator></rscTypeGenerator> <rscTypeGenerator></rscTypeGenerator>
<timeMatchMethod>CLOSEST_BEFORE_OR_AFTER</timeMatchMethod> <timeMatchMethod>CLOSEST_BEFORE_OR_AFTER</timeMatchMethod>
<frameSpan>720</frameSpan> <frameSpan>180</frameSpan>
<timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod> <timelineGenMethod>USE_FRAME_INTERVAL</timelineGenMethod>
<dfltFrameCount>4</dfltFrameCount> <dfltFrameCount>4</dfltFrameCount>
<dfltTimeRange>48</dfltTimeRange> <dfltTimeRange>48</dfltTimeRange>

View file

@ -1,5 +1,5 @@
! Parameters and Attributes for the default UAIR Resource ! Parameters and Attributes for the default UAIR Resource
levelKey=500 levelKey=500
plotModel=@PlotModels/ncuair/standard.xml plotModel=@PlotModels/ncuair/standard.xml
plotDensity=10 plotDensity=30
conditionalFilter= conditionalFilter=

View file

@ -1,5 +1,5 @@
! Parameters and Attributes for the default UAIR Resource ! Parameters and Attributes for the default UAIR Resource
levelKey=500 levelKey=500
plotModel=@PlotModels/ncuair/standard.xml plotModel=@PlotModels/ncuair/standard.xml
plotDensity=10 plotDensity=30
conditionalFilter= conditionalFilter=

View file

@ -86,6 +86,7 @@ import com.raytheon.uf.common.time.DataTime;
* 06/19/12 #657 Greg Hull removeSpinnerListeners() before setting the * 06/19/12 #657 Greg Hull removeSpinnerListeners() before setting the
* spinner maxvalues. * spinner maxvalues.
* 06/24/14 TTR1029 J. Wu Distinguish clicks in/outside of the slider box. * 06/24/14 TTR1029 J. Wu Distinguish clicks in/outside of the slider box.
* 07/11/14 TTR1032 J. Wu reload data times as necessary to keep timeline current.
* *
* </pre> * </pre>
* *
@ -304,7 +305,28 @@ public class TimelineControl extends Composite {
timeMatcher = tm; timeMatcher = tm;
timeMatcher.loadTimes(false); // timeMatcher.loadTimes(false);
/*
* TTR1032 - when current time passes the latest previously-loaded time
* for given frame interval, we need to reload times to keep timeline
* current.
*/
boolean reload = false;
if (timeMatcher.isCurrentRefTime()) {
reload = true;
if (timeMatcher.getSelectableDataTimes() != null
&& !timeMatcher.getSelectableDataTimes().isEmpty()) {
long curtime = Calendar.getInstance().getTimeInMillis();
long pretime = timeMatcher.getSelectableDataTimes()
.get(timeMatcher.getSelectableDataTimes().size() - 1)
.getRefTime().getTime();
if (curtime < (pretime + timeMatcher.getFrameInterval() * 60 * 1000)) {
reload = false;
}
}
}
timeMatcher.loadTimes(reload);
if (timeMatcher.getDominantResourceName() != null) { if (timeMatcher.getDominantResourceName() != null) {
for (int i = 0; i < dom_rsc_combo.getItemCount(); i++) { for (int i = 0; i < dom_rsc_combo.getItemCount(); i++) {

View file

@ -1,7 +1,5 @@
package gov.noaa.nws.ncep.viz.resources.attributes; package gov.noaa.nws.ncep.viz.resources.attributes;
import java.io.File;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData; import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData;
import gov.noaa.nws.ncep.viz.resources.manager.ResourceName; import gov.noaa.nws.ncep.viz.resources.manager.ResourceName;
import gov.noaa.nws.ncep.viz.ui.display.NcDisplayMngr; import gov.noaa.nws.ncep.viz.ui.display.NcDisplayMngr;
@ -11,9 +9,6 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Dialog; import org.eclipse.swt.widgets.Dialog;
@ -47,23 +42,26 @@ import org.eclipse.swt.widgets.Shell;
public abstract class AbstractEditResourceAttrsDialog extends Dialog { public abstract class AbstractEditResourceAttrsDialog extends Dialog {
protected Shell shell; protected Shell shell;
protected String dlgTitle = null; protected String dlgTitle = null;
protected INatlCntrsResourceData rscData; protected INatlCntrsResourceData rscData;
protected ResourceAttrSet editedRscAttrSet = null; protected ResourceAttrSet editedRscAttrSet = null;
protected boolean hasApplyBtn = false; protected boolean hasApplyBtn = false;
protected boolean ok = false; protected boolean ok = false;
public AbstractEditResourceAttrsDialog( Shell parentShell, public AbstractEditResourceAttrsDialog(Shell parentShell, INatlCntrsResourceData r, Boolean apply) {
INatlCntrsResourceData r, Boolean apply ) {
super(parentShell); super(parentShell);
rscData = r; rscData = r;
ResourceName rscName = rscData.getResourceName(); ResourceName rscName = rscData.getResourceName();
this.dlgTitle = "Edit " + rscName.toString() + " Attributes"; this.dlgTitle = "Edit " + rscName.toString() + " Attributes";
hasApplyBtn = apply; hasApplyBtn = apply;
// editedRscAttrSet = new ResourceAttrSet( rscData.getRscAttrSet().getRscAttrSetName() ); // editedRscAttrSet = new ResourceAttrSet(
// rscData.getRscAttrSet().getRscAttrSetName() );
} }
public abstract Composite createDialog(Composite topComp); public abstract Composite createDialog(Composite topComp);
@ -102,7 +100,6 @@ public abstract class AbstractEditResourceAttrsDialog extends Dialog {
gd.horizontalAlignment = SWT.FILL; gd.horizontalAlignment = SWT.FILL;
sep.setLayoutData(gd); sep.setLayoutData(gd);
Composite okCanComp = new Composite(shell, SWT.NONE); Composite okCanComp = new Composite(shell, SWT.NONE);
gd = new GridData(); gd = new GridData();
gd.grabExcessHorizontalSpace = true; gd.grabExcessHorizontalSpace = true;

View file

@ -1,9 +1,9 @@
package gov.noaa.nws.ncep.viz.resources.colorBar; package gov.noaa.nws.ncep.viz.resources.colorBar;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
import gov.noaa.nws.ncep.viz.ui.display.IColorBar;
import gov.noaa.nws.ncep.gempak.parameters.colorbar.ColorBarAnchorLocation; import gov.noaa.nws.ncep.gempak.parameters.colorbar.ColorBarAnchorLocation;
import gov.noaa.nws.ncep.gempak.parameters.colorbar.ColorBarOrientation; import gov.noaa.nws.ncep.gempak.parameters.colorbar.ColorBarOrientation;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
import gov.noaa.nws.ncep.viz.ui.display.IColorBar;
import java.util.ArrayList; import java.util.ArrayList;
@ -40,7 +40,6 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Spinner; import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
/** /**
* This widget is used to edit ColorBars for non-imagery resources. * This widget is used to edit ColorBars for non-imagery resources.
* *
@ -59,6 +58,8 @@ import org.eclipse.swt.widgets.Text;
* Updated the modifyEvent() for both max/min interval spinners to * Updated the modifyEvent() for both max/min interval spinners to
* exit if the spinners are set to the MAX/MIN Integer values respectively. * exit if the spinners are set to the MAX/MIN Integer values respectively.
* *
* 07/01/14 TTR 1018 SRussell Altered constructor to make editable spinners an option
*
* *
* *
* </pre> * </pre>
@ -69,17 +70,23 @@ import org.eclipse.swt.widgets.Text;
public class ColorBarEditor extends Composite { public class ColorBarEditor extends Composite {
private final int CBAR_XOFF = 15; private final int CBAR_XOFF = 15;
// private final int CBAR_YOFF = 50; // private final int CBAR_YOFF = 50;
private ArrayList<Rectangle> colorBarRects = null; private ArrayList<Rectangle> colorBarRects = null;
// private ArrayList<Float> intrvlsToLabel = null; // private ArrayList<Float> intrvlsToLabel = null;
private int seldIntrvl = 0; private int seldIntrvl = 0;
private int dragXvalue = 0; private int dragXvalue = 0;
private final Canvas canvas; private final Canvas canvas;
private Font font; private Font font;
private Color canvasColor; private Color canvasColor;
private Color seldColor; private Color seldColor;
private Color labelColor; private Color labelColor;
private IColorBar colorBar; private IColorBar colorBar;
@ -90,8 +97,7 @@ public class ColorBarEditor extends Composite {
private Float pixPerUnit = 1.0f; private Float pixPerUnit = 1.0f;
private ColorBarAnchorLocation[] availAnchorLocs = new ColorBarAnchorLocation[] { private ColorBarAnchorLocation[] availAnchorLocs = new ColorBarAnchorLocation[] { ColorBarAnchorLocation.UpperLeft,
ColorBarAnchorLocation.UpperLeft,
// ColorBarAnchorLocation.UpperCenter, // ColorBarAnchorLocation.UpperCenter,
ColorBarAnchorLocation.UpperRight, ColorBarAnchorLocation.UpperRight,
// ColorBarAnchorLocation.CenterLeft, // ColorBarAnchorLocation.CenterLeft,
@ -99,37 +105,50 @@ public class ColorBarEditor extends Composite {
// ColorBarAnchorLocation.CenterRight, // ColorBarAnchorLocation.CenterRight,
ColorBarAnchorLocation.LowerLeft, ColorBarAnchorLocation.LowerLeft,
// ColorBarAnchorLocation.LowerCenter, // ColorBarAnchorLocation.LowerCenter,
ColorBarAnchorLocation.LowerRight ColorBarAnchorLocation.LowerRight };
};
final Combo orientationCombo; final Combo orientationCombo;
final Combo anchorCombo; final Combo anchorCombo;
final Combo unitsCombo; final Combo unitsCombo;
final Spinner lengthSpnr; final Spinner lengthSpnr;
final Spinner widthSpnr; final Spinner widthSpnr;
final Button showLabelsBtn; final Button showLabelsBtn;
final Button drawToScaleBtn; final Button drawToScaleBtn;
final Spinner intrvlMinSpnr; final Spinner intrvlMinSpnr;
final Spinner intrvlMaxSpnr; final Spinner intrvlMaxSpnr;
final Text pixelNumTxt; final Text pixelNumTxt;
final Button labelPixelBtn; final Button labelPixelBtn;
private Button negInfIntrvlBtn; private Button negInfIntrvlBtn;
private Button posInfIntrvlBtn; private Button posInfIntrvlBtn;
private Text negInfIntrvlTxt; private Text negInfIntrvlTxt;
private Text posInfIntrvlTxt; private Text posInfIntrvlTxt;
private Composite colorComp; private Composite colorComp;
private Composite labelColorComp; private Composite labelColorComp;
final ColorButtonSelector intrvlColorSelector; final ColorButtonSelector intrvlColorSelector;
final ColorButtonSelector labelColorSelector; // also used for the border color final ColorButtonSelector labelColorSelector; // also used for the border color
// widgets used for non-image colorbars // widgets used for non-image colorbars
// //
private Cursor pointerCursor; private Cursor pointerCursor;
private Cursor dragIntrvlCursor; private Cursor dragIntrvlCursor;
// If the colorbar applies to a color mappable image. // If the colorbar applies to a color mappable image.
@ -165,8 +184,7 @@ public class ColorBarEditor extends Composite {
// (can't drag the last interval) // (can't drag the last interval)
if (colorBar.getDrawToScale()) { if (colorBar.getDrawToScale()) {
if( intrvlIndx != colorBarRects.size()-1 && if (intrvlIndx != colorBarRects.size() - 1 && Math.abs(e.x - rect.x - rect.width) <= 1) {
Math.abs( e.x - rect.x-rect.width ) <= 1 ) {
dragXvalue = rect.x + rect.width; dragXvalue = rect.x + rect.width;
seldIntrvl = colorBarRects.indexOf(rect); seldIntrvl = colorBarRects.indexOf(rect);
@ -207,8 +225,7 @@ public class ColorBarEditor extends Composite {
} }
canvas.setCursor((crossingInterval ? dragIntrvlCursor : pointerCursor)); canvas.setCursor((crossingInterval ? dragIntrvlCursor : pointerCursor));
} } else {
else {
dragXvalue = e.x; dragXvalue = e.x;
// if the user drags the max value past the min value or past // if the user drags the max value past the min value or past
@ -217,8 +234,7 @@ public class ColorBarEditor extends Composite {
if (e.x <= colorBarRects.get(seldIntrvl).x) { if (e.x <= colorBarRects.get(seldIntrvl).x) {
colorBar.removeInterval(seldIntrvl); colorBar.removeInterval(seldIntrvl);
dragXvalue = 0; dragXvalue = 0;
} } else { // note that we can't drag the last interval
else { // note that we can't drag the last interval
Rectangle nextRect = colorBarRects.get(seldIntrvl + 1); Rectangle nextRect = colorBarRects.get(seldIntrvl + 1);
if (e.x >= nextRect.x + nextRect.width) { if (e.x >= nextRect.x + nextRect.width) {
@ -258,7 +274,7 @@ public class ColorBarEditor extends Composite {
} }
}; };
public ColorBarEditor( Composite parent, IColorBar cbar ) { public ColorBarEditor(Composite parent, IColorBar cbar, boolean editableSpinner) {
super(parent, SWT.NONE); super(parent, SWT.NONE);
colorBar = cbar; colorBar = cbar;
@ -289,7 +305,6 @@ public class ColorBarEditor extends Composite {
fd.top = new FormAttachment(orientationCombo, 3, SWT.TOP); fd.top = new FormAttachment(orientationCombo, 3, SWT.TOP);
orientationLbl.setLayoutData(fd); orientationLbl.setLayoutData(fd);
anchorCombo = new Combo(topForm, SWT.DROP_DOWN | SWT.READ_ONLY); anchorCombo = new Combo(topForm, SWT.DROP_DOWN | SWT.READ_ONLY);
fd = new FormData(); fd = new FormData();
fd.left = new FormAttachment(orientationCombo, 0, SWT.LEFT); fd.left = new FormAttachment(orientationCombo, 0, SWT.LEFT);
@ -303,8 +318,6 @@ public class ColorBarEditor extends Composite {
fd.top = new FormAttachment(anchorCombo, 3, SWT.TOP); fd.top = new FormAttachment(anchorCombo, 3, SWT.TOP);
anchorLbl.setLayoutData(fd); anchorLbl.setLayoutData(fd);
lengthSpnr = new Spinner(topForm, SWT.BORDER); lengthSpnr = new Spinner(topForm, SWT.BORDER);
lengthSpnr.setToolTipText("ColorBar Length as a percentage of the screen size"); lengthSpnr.setToolTipText("ColorBar Length as a percentage of the screen size");
fd = new FormData(); fd = new FormData();
@ -327,7 +340,6 @@ public class ColorBarEditor extends Composite {
fd.top = new FormAttachment(lengthSpnr, 2, SWT.TOP); fd.top = new FormAttachment(lengthSpnr, 2, SWT.TOP);
lenUnitsLbl.setLayoutData(fd); lenUnitsLbl.setLayoutData(fd);
widthSpnr = new Spinner(topForm, SWT.BORDER); widthSpnr = new Spinner(topForm, SWT.BORDER);
// widthSpnr.setToolTipText("ColorBar Width in pixels"); // widthSpnr.setToolTipText("ColorBar Width in pixels");
fd = new FormData(); fd = new FormData();
@ -356,7 +368,6 @@ public class ColorBarEditor extends Composite {
fd.top = new FormAttachment(lengthSpnr, 10, SWT.BOTTOM); fd.top = new FormAttachment(lengthSpnr, 10, SWT.BOTTOM);
drawToScaleBtn.setLayoutData(fd); drawToScaleBtn.setLayoutData(fd);
showLabelsBtn = new Button(topForm, SWT.CHECK); showLabelsBtn = new Button(topForm, SWT.CHECK);
showLabelsBtn.setText("Show Labels"); showLabelsBtn.setText("Show Labels");
fd = new FormData(); fd = new FormData();
@ -389,7 +400,6 @@ public class ColorBarEditor extends Composite {
// fd.bottom = new FormAttachment( labelColorComp, -2, SWT.TOP ); // fd.bottom = new FormAttachment( labelColorComp, -2, SWT.TOP );
lblColLbl.setLayoutData(fd); lblColLbl.setLayoutData(fd);
unitsCombo = new Combo(topForm, SWT.DROP_DOWN | SWT.READ_ONLY); unitsCombo = new Combo(topForm, SWT.DROP_DOWN | SWT.READ_ONLY);
fd = new FormData(); fd = new FormData();
fd.left = new FormAttachment(anchorCombo, 25, SWT.RIGHT); fd.left = new FormAttachment(anchorCombo, 25, SWT.RIGHT);
@ -406,7 +416,6 @@ public class ColorBarEditor extends Composite {
unitsLbl.setVisible(false); unitsLbl.setVisible(false);
unitsCombo.setVisible(false); unitsCombo.setVisible(false);
canvas = new Canvas(topForm, SWT.BORDER); canvas = new Canvas(topForm, SWT.BORDER);
fd = new FormData(); fd = new FormData();
@ -417,7 +426,6 @@ public class ColorBarEditor extends Composite {
canvas.setLayoutData(fd); canvas.setLayoutData(fd);
colorComp = new Composite(topForm, SWT.None); colorComp = new Composite(topForm, SWT.None);
fd = new FormData(); fd = new FormData();
fd.top = new FormAttachment(canvas, 25, SWT.BOTTOM); fd.top = new FormAttachment(canvas, 25, SWT.BOTTOM);
@ -428,7 +436,6 @@ public class ColorBarEditor extends Composite {
intrvlColorSelector = new ColorButtonSelector(colorComp, 50, 25); intrvlColorSelector = new ColorButtonSelector(colorComp, 50, 25);
// create rest of the widgets based on whether this is for Images // create rest of the widgets based on whether this is for Images
// (Some widgets need to be 'final' since they are access by listers // (Some widgets need to be 'final' since they are access by listers
// but java complains if they are not set in the constructor so I'm // but java complains if they are not set in the constructor so I'm
@ -451,16 +458,24 @@ public class ColorBarEditor extends Composite {
//labelColorComp.setVisible( false ); //labelColorComp.setVisible( false );
labelPixelBtn = null; labelPixelBtn = null;
pixelNumTxt = null; pixelNumTxt = null;
// TTR 1018
if (editableSpinner) {
intrvlMinSpnr = new Spinner(topForm, SWT.BORDER);
intrvlMaxSpnr = new Spinner(topForm, SWT.BORDER);
} else {
intrvlMinSpnr = new Spinner(topForm, SWT.BORDER | SWT.READ_ONLY); intrvlMinSpnr = new Spinner(topForm, SWT.BORDER | SWT.READ_ONLY);
intrvlMaxSpnr = new Spinner(topForm, SWT.BORDER | SWT.READ_ONLY); intrvlMaxSpnr = new Spinner(topForm, SWT.BORDER | SWT.READ_ONLY);
}
negInfIntrvlBtn = new Button(topForm, SWT.CHECK); negInfIntrvlBtn = new Button(topForm, SWT.CHECK);
posInfIntrvlBtn = new Button(topForm, SWT.CHECK); posInfIntrvlBtn = new Button(topForm, SWT.CHECK);
negInfIntrvlTxt = new Text(topForm, SWT.BORDER | SWT.READ_ONLY); negInfIntrvlTxt = new Text(topForm, SWT.BORDER | SWT.READ_ONLY);
posInfIntrvlTxt = new Text(topForm, SWT.BORDER | SWT.READ_ONLY); posInfIntrvlTxt = new Text(topForm, SWT.BORDER | SWT.READ_ONLY);
createNonImageCbarWidgets(); createNonImageCbarWidgets();
// } // }
initWidgets(); initWidgets();
computeColorBarRectangles(); computeColorBarRectangles();
@ -623,8 +638,7 @@ public class ColorBarEditor extends Composite {
if (seldIntrvl == 0) { // should be 0 if this is visible if (seldIntrvl == 0) { // should be 0 if this is visible
colorBar.addColorBarInterval(Float.NEGATIVE_INFINITY, colorBar.getIntervalMin(0), new RGB(100, 100, 100)); colorBar.addColorBarInterval(Float.NEGATIVE_INFINITY, colorBar.getIntervalMin(0), new RGB(100, 100, 100));
} }
} } else { //
else { //
if (seldIntrvl == 0) { if (seldIntrvl == 0) {
// This will remove the first interval but will keep the Inf minimum so // This will remove the first interval but will keep the Inf minimum so
// we will remove it an replace the min with the min of the next interval // we will remove it an replace the min with the min of the next interval
@ -639,7 +653,6 @@ public class ColorBarEditor extends Composite {
} }
}); });
fd = new FormData(); fd = new FormData();
fd.top = new FormAttachment(removeIntrvlBtn, 0, SWT.TOP); fd.top = new FormAttachment(removeIntrvlBtn, 0, SWT.TOP);
fd.left = new FormAttachment(removeIntrvlBtn, 20, SWT.RIGHT); fd.left = new FormAttachment(removeIntrvlBtn, 20, SWT.RIGHT);
@ -658,8 +671,7 @@ public class ColorBarEditor extends Composite {
colorBar.addColorBarInterval(colorBar.getIntervalMax(lastInt), Float.POSITIVE_INFINITY, new RGB(100, 100, 100)); colorBar.addColorBarInterval(colorBar.getIntervalMax(lastInt), Float.POSITIVE_INFINITY, new RGB(100, 100, 100));
seldIntrvl++; seldIntrvl++;
} }
} } else { // no infinite interval
else { // no infinite interval
if (seldIntrvl == lastInt) { if (seldIntrvl == lastInt) {
// This will remove the first interval but will keep the Inf minimum so // This will remove the first interval but will keep the Inf minimum so
// we will remove it an replace the min with the min of the next interval // we will remove it an replace the min with the min of the next interval
@ -803,8 +815,7 @@ public class ColorBarEditor extends Composite {
orientationCombo.addSelectionListener(new SelectionAdapter() { orientationCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
colorBar.setOrientation( (orientationCombo.getSelectionIndex() == 0 ? colorBar.setOrientation((orientationCombo.getSelectionIndex() == 0 ? ColorBarOrientation.Vertical : ColorBarOrientation.Horizontal));
ColorBarOrientation.Vertical : ColorBarOrientation.Horizontal ) );
} }
}); });
@ -820,8 +831,7 @@ public class ColorBarEditor extends Composite {
anchorCombo.addSelectionListener(new SelectionAdapter() { anchorCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
colorBar.setAnchorLoc( colorBar.setAnchorLoc(availAnchorLocs[anchorCombo.getSelectionIndex()]);
availAnchorLocs[ anchorCombo.getSelectionIndex() ] );
} }
}); });
@ -941,8 +951,7 @@ public class ColorBarEditor extends Composite {
private void computeColorBarRectangles() { private void computeColorBarRectangles() {
// if an interval has been removed or added then just start over with a new array // if an interval has been removed or added then just start over with a new array
if( colorBarRects == null || if (colorBarRects == null || colorBarRects.size() != colorBar.getNumIntervals()) {
colorBarRects.size() != colorBar.getNumIntervals() ) {
colorBarRects = new ArrayList<Rectangle>(); colorBarRects = new ArrayList<Rectangle>();
for (int c = 0; c < colorBar.getNumIntervals(); c++) { for (int c = 0; c < colorBar.getNumIntervals(); c++) {
@ -971,10 +980,8 @@ public class ColorBarEditor extends Composite {
// a scale value by dividing the width in pixels by the // a scale value by dividing the width in pixels by the
// range of actual values (not including infinite intervals) // range of actual values (not including infinite intervals)
Float rangeMin = ( colorBar.getIntervalMin(0) == Float.NEGATIVE_INFINITY ? Float rangeMin = (colorBar.getIntervalMin(0) == Float.NEGATIVE_INFINITY ? colorBar.getIntervalMax(0) : colorBar.getIntervalMin(0));
colorBar.getIntervalMax(0) : colorBar.getIntervalMin(0) ); Float rangeMax = (colorBar.getIntervalMax(intCnt - 1) == Float.POSITIVE_INFINITY ? colorBar.getIntervalMin(intCnt - 1) : colorBar.getIntervalMax(intCnt - 1));
Float rangeMax = ( colorBar.getIntervalMax(intCnt-1) == Float.POSITIVE_INFINITY ?
colorBar.getIntervalMin(intCnt-1) : colorBar.getIntervalMax(intCnt-1) );
if (colorBar.getIntervalMin(0) == Float.NEGATIVE_INFINITY) { if (colorBar.getIntervalMin(0) == Float.NEGATIVE_INFINITY) {
cbarPixWidth -= infIntSize; cbarPixWidth -= infIntSize;
@ -993,18 +1000,15 @@ public class ColorBarEditor extends Composite {
cbarRect.height = colorBar.getWidthInPixels(); cbarRect.height = colorBar.getWidthInPixels();
// determine the width of the interval in pixels. if inf then use the ave size of an interval // determine the width of the interval in pixels. if inf then use the ave size of an interval
if( (b==0 && colorBar.getIntervalMin(0) == Float.NEGATIVE_INFINITY ) || if ((b == 0 && colorBar.getIntervalMin(0) == Float.NEGATIVE_INFINITY) || (b == intCnt - 1 && colorBar.getIntervalMax(b) == Float.POSITIVE_INFINITY)) {
(b==intCnt-1 && colorBar.getIntervalMax(b) == Float.POSITIVE_INFINITY ) ) {
barIntWidth = infIntSize; barIntWidth = infIntSize;
} } else {
else {
barIntWidth = (int) (pixPerUnit * (colorBar.getIntervalMax(b) - colorBar.getIntervalMin(b))); barIntWidth = (int) (pixPerUnit * (colorBar.getIntervalMax(b) - colorBar.getIntervalMin(b)));
} }
barIntX += barIntWidth; barIntX += barIntWidth;
cbarRect.width = barIntWidth; cbarRect.width = barIntWidth;
} }
} } else {
else {
for (Rectangle cbarRect : colorBarRects) { for (Rectangle cbarRect : colorBarRects) {
cbarRect.x = barIntX; cbarRect.x = barIntX;
cbarRect.y = barIntY; cbarRect.y = barIntY;
@ -1056,10 +1060,8 @@ public class ColorBarEditor extends Composite {
String dragMaxLabel = getLabelString(interpolateNewIntervalMax()); String dragMaxLabel = getLabelString(interpolateNewIntervalMax());
gc.drawText( dragMaxLabel, dragXvalue-charWidth*dragMaxLabel.length()/2, gc.drawText(dragMaxLabel, dragXvalue - charWidth * dragMaxLabel.length() / 2, seldRect.y - textHeight * 2, true);
seldRect.y-textHeight*2, true ); } else {
}
else {
// if( applyToImage ) { // if( applyToImage ) {
// gc.drawRectangle(seldRect.x, seldRect.y-2, seldRect.width, seldRect.height+3 ); // gc.drawRectangle(seldRect.x, seldRect.y-2, seldRect.width, seldRect.height+3 );
// } // }
@ -1113,9 +1115,8 @@ public class ColorBarEditor extends Composite {
// if( !applyToImage ) { // if( !applyToImage ) {
String labelStr = colorBar.getLabelString(numIntrvs); String labelStr = colorBar.getLabelString(numIntrvs);
gc.drawText( labelStr, gc.drawText(labelStr, colorBarRects.get(numIntrvs - 1).x + colorBarRects.get(numIntrvs - 1).width - textWidth / 2, colorBarRects.get(numIntrvs - 1).y - textHeight,
colorBarRects.get(numIntrvs-1).x+colorBarRects.get(numIntrvs-1).width-textWidth/2, true);
colorBarRects.get(numIntrvs-1).y-textHeight, true );
// } // }
// } // }
} }
@ -1125,11 +1126,10 @@ public class ColorBarEditor extends Composite {
private String getLabelString(Float val) { private String getLabelString(Float val) {
if (val == Float.NEGATIVE_INFINITY) { if (val == Float.NEGATIVE_INFINITY) {
return "-Inf"; return "-Inf";
} } else if (val == Float.POSITIVE_INFINITY) {
else if( val == Float.POSITIVE_INFINITY ) {
return "Inf"; return "Inf";
} } else
else return Float.toString( val ); return Float.toString(val);
} }
// this is called when the user selects an interval and when the usr modifies either // this is called when the user selects an interval and when the usr modifies either
@ -1165,11 +1165,9 @@ public class ColorBarEditor extends Composite {
int minMaxVal, maxMaxVal; int minMaxVal, maxMaxVal;
// Set the min for the min to the min of the prev interval // Set the min for the min to the min of the prev interval
if( seldIntrvl == 0 || if (seldIntrvl == 0 || (seldIntrvl == 1 && colorBar.getIntervalMin(0) == Float.NEGATIVE_INFINITY)) {
(seldIntrvl == 1 && colorBar.getIntervalMin( 0 ) == Float.NEGATIVE_INFINITY) ) {
minMinVal = Integer.MIN_VALUE; //Math.round( minVal ) - 1; minMinVal = Integer.MIN_VALUE; //Math.round( minVal ) - 1;
} } else {
else {
Float tVal = colorBar.getIntervalMin(seldIntrvl - 1).floatValue() * (float) scaleMult; Float tVal = colorBar.getIntervalMin(seldIntrvl - 1).floatValue() * (float) scaleMult;
minMinVal = Math.round(tVal) + 1; minMinVal = Math.round(tVal) + 1;
} }
@ -1181,11 +1179,9 @@ public class ColorBarEditor extends Composite {
minMaxVal = Math.round(minVal) + 1; minMaxVal = Math.round(minVal) + 1;
// set the max for the max to the max of the next interval // set the max for the max to the max of the next interval
if( seldIntrvl == lastIntrvl || if (seldIntrvl == lastIntrvl || (seldIntrvl == lastIntrvl - 1 && colorBar.getIntervalMax(lastIntrvl) == Float.POSITIVE_INFINITY)) {
(seldIntrvl == lastIntrvl-1 && colorBar.getIntervalMax( lastIntrvl ) == Float.POSITIVE_INFINITY ) ) {
maxMaxVal = Integer.MAX_VALUE; // colorBar.getIntervalMax( seldIntrvl ).floatValue() * (float)scaleMult; maxMaxVal = Integer.MAX_VALUE; // colorBar.getIntervalMax( seldIntrvl ).floatValue() * (float)scaleMult;
} } else {
else {
Float tVal = colorBar.getIntervalMax(seldIntrvl + 1).floatValue() * (float) scaleMult; Float tVal = colorBar.getIntervalMax(seldIntrvl + 1).floatValue() * (float) scaleMult;
maxMaxVal = Math.round(tVal) - 1; maxMaxVal = Math.round(tVal) - 1;
} }
@ -1204,13 +1200,10 @@ public class ColorBarEditor extends Composite {
addModifyListenersForSpinners(); addModifyListenersForSpinners();
} }
private Float interpolateNewIntervalMax() { private Float interpolateNewIntervalMax() {
Rectangle seldRect = colorBarRects.get(seldIntrvl); Rectangle seldRect = colorBarRects.get(seldIntrvl);
Float newMax = colorBar.getIntervalMin(seldIntrvl) + Float newMax = colorBar.getIntervalMin(seldIntrvl) + (float) (dragXvalue - seldRect.x) / (float) seldRect.width
(float)(dragXvalue-seldRect.x)/(float)seldRect.width * * (colorBar.getIntervalMax(seldIntrvl) - colorBar.getIntervalMin(seldIntrvl));
(colorBar.getIntervalMax(seldIntrvl) -
colorBar.getIntervalMin(seldIntrvl) );
// DecimalFormat fmt = new DecimalFormat(); // DecimalFormat fmt = new DecimalFormat();
// fmt.setMaximumFractionDigits(1); // fmt.setMaximumFractionDigits(1);
// fmt.setMinimumFractionDigits(1); // fmt.setMinimumFractionDigits(1);
@ -1276,12 +1269,18 @@ public class ColorBarEditor extends Composite {
public void dispose() { public void dispose() {
super.dispose(); super.dispose();
if( font != null ) font.dispose(); if (font != null)
if( canvas != null ) canvas.dispose(); font.dispose();
if( seldColor != null ) seldColor.dispose(); if (canvas != null)
if( labelColor != null ) labelColor.dispose(); canvas.dispose();
if( pointerCursor != null ) pointerCursor.dispose(); if (seldColor != null)
if( dragIntrvlCursor != null ) dragIntrvlCursor.dispose(); seldColor.dispose();
if (labelColor != null)
labelColor.dispose();
if (pointerCursor != null)
pointerCursor.dispose();
if (dragIntrvlCursor != null)
dragIntrvlCursor.dispose();
} }
public ModifyListener minSpnrListener = new ModifyListener() { public ModifyListener minSpnrListener = new ModifyListener() {

View file

@ -56,6 +56,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
* 02/12/13 972 Greg Hull changed to work with INatlCntrsDescriptor * 02/12/13 972 Greg Hull changed to work with INatlCntrsDescriptor
* 04/24/13 689 Xiaochuan Loop length in slctFrames that is set based on default * 04/24/13 689 Xiaochuan Loop length in slctFrames that is set based on default
* or size of selectableDataTimes. * or size of selectableDataTimes.
* 07/11/14 TTR1032 J. Wu No timeline needed if no data times available.
* *
* </pre> * </pre>
* *
@ -267,8 +268,8 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
} }
public boolean isAutoUpdateable() { public boolean isAutoUpdateable() {
return (dominantRscData == null ? false : return (dominantRscData == null ? false : dominantRscData
dominantRscData.isAutoUpdateable()); .isAutoUpdateable());
} }
// set the dominant resource // set the dominant resource
@ -318,17 +319,15 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
TimelineGenMethod tLineGenMthd = dominantRscData.getTimelineGenMethod(); TimelineGenMethod tLineGenMthd = dominantRscData.getTimelineGenMethod();
// the frameInterval here is only used to generate the timeline. // the frameInterval here is only used to generate the timeline.
if( tLineGenMthd == TimelineGenMethod.USE_DATA_TIMES || if (tLineGenMthd == TimelineGenMethod.USE_DATA_TIMES
tLineGenMthd == TimelineGenMethod.USE_CYCLE_TIME_FCST_HOURS) { || tLineGenMthd == TimelineGenMethod.USE_CYCLE_TIME_FCST_HOURS) {
frameInterval = -1; frameInterval = -1;
} } else if (tLineGenMthd == TimelineGenMethod.USE_MANUAL_TIMELINE) {
else if( tLineGenMthd == TimelineGenMethod.USE_MANUAL_TIMELINE) {
if (frameInterval <= 0) { if (frameInterval <= 0) {
frameInterval = 60; // what to use here as a default frameInterval = 60; // what to use here as a default
} }
} } else if (tLineGenMthd == TimelineGenMethod.USE_FRAME_INTERVAL
else if( tLineGenMthd == TimelineGenMethod.USE_FRAME_INTERVAL || || tLineGenMthd == TimelineGenMethod.USE_FCST_FRAME_INTERVAL_FROM_REF_TIME) {
tLineGenMthd == TimelineGenMethod.USE_FCST_FRAME_INTERVAL_FROM_REF_TIME ) {
frameInterval = dominantRscData.getFrameSpan(); frameInterval = dominantRscData.getFrameSpan();
} else { // ??? } else { // ???
return; return;
@ -368,23 +367,43 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
.getRefTime().getTime()); .getRefTime().getTime());
} }
} } else if (isCurrentRefTime()) {
else if( isCurrentRefTime() ) {
refTimeMillisecs = Calendar.getInstance().getTimeInMillis(); refTimeMillisecs = Calendar.getInstance().getTimeInMillis();
} } else if (isLatestRefTime()) {
else if( isLatestRefTime() ) {
refTimeMillisecs = 0; refTimeMillisecs = 0;
} } else {
else {
refTimeMillisecs = refTime.getRefTime().getTime(); refTimeMillisecs = refTime.getRefTime().getTime();
} }
/*
* Always check all available times. If none of the available data times
* falls within the specified time range, then no time line should be
* created.
*
* J. Wu - To do? - When the time line ticks are built from frame time
* (frameInterval > 0) and the time line is "Current", and only some
* frame times are in "allAvailableTimes", how should we build the time
* line?
*/
allAvailDataTimes = dominantRscData.getAvailableDataTimes();
List<DataTime> availTimes = allAvailDataTimes;
if (availTimes == null || availTimes.isEmpty()) {
return false;
} else {
long latestTime = availTimes.get(availTimes.size() - 1)
.getRefTime().getTime();
if (latestTime < (refTimeMillisecs - timeRangeMillisecs)) {
return false;
}
}
// if refTime is Latest or // if refTime is Latest or
// if using the data to generate the timeline, or // if using the data to generate the timeline, or
// if we need to get the cycle time for a forecast resource, then // if we need to get the cycle time for a forecast resource, then
// we will need to query the times of the dominant resource. // we will need to query the times of the dominant resource.
if (refTimeMillisecs == 0 || frameInterval == -1) { if (refTimeMillisecs == 0 || frameInterval == -1) {
allAvailDataTimes = dominantRscData.getAvailableDataTimes(); // allAvailDataTimes = dominantRscData.getAvailableDataTimes();
if (allAvailDataTimes == null) { // no data if (allAvailDataTimes == null) { // no data
allAvailDataTimes = new ArrayList<DataTime>(); // allAvailDataTimes = new ArrayList<DataTime>(); //
@ -436,7 +455,8 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
long frameTimeMillisecs = refTimeMillisecs; long frameTimeMillisecs = refTimeMillisecs;
if (isForecast) { if (isForecast) {
while (frameTimeMillisecs <= refTimeMillisecs + timeRangeMillisecs) { while (frameTimeMillisecs <= refTimeMillisecs
+ timeRangeMillisecs) {
DataTime time = new DataTime(new Date(frameTimeMillisecs)); DataTime time = new DataTime(new Date(frameTimeMillisecs));
selectableDataTimes.add(time); selectableDataTimes.add(time);
@ -444,7 +464,8 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
} }
} else { } else {
while (frameTimeMillisecs >= refTimeMillisecs - timeRangeMillisecs) { while (frameTimeMillisecs >= refTimeMillisecs
- timeRangeMillisecs) {
DataTime normRefTime = getNormalizedTime(new DataTime( DataTime normRefTime = getNormalizedTime(new DataTime(
new Date(frameTimeMillisecs))); new Date(frameTimeMillisecs)));
@ -462,7 +483,8 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
// list of available times in the DB // list of available times in the DB
if (dfltFrameTimesStr != null) { if (dfltFrameTimesStr != null) {
try { try {
frmTimeMatcher = new SelectableFrameTimeMatcher( dfltFrameTimesStr ); frmTimeMatcher = new SelectableFrameTimeMatcher(
dfltFrameTimesStr);
for (DataTime dt : allAvailDataTimes) { for (DataTime dt : allAvailDataTimes) {
if (frmTimeMatcher.matchTime(dt)) { if (frmTimeMatcher.matchTime(dt)) {
@ -477,21 +499,19 @@ public class NCTimeMatcher extends AbstractTimeMatcher implements
return false; return false;
} }
} } else {
else {
int skipCount = 0; int skipCount = 0;
// set the initial frameTimes from the skip value and numFrames // set the initial frameTimes from the skip value and numFrames
for (skipCount = 0; skipCount < selectableDataTimes.size(); skipCount++) { for (skipCount = 0; skipCount < selectableDataTimes.size(); skipCount++) {
if (skipCount % (skipValue + 1) == 0) { if (skipCount % (skipValue + 1) == 0) {
DataTime selectableTime = ( isForecast ? DataTime selectableTime = (isForecast ? selectableDataTimes
selectableDataTimes.get( skipCount ) : .get(skipCount) : selectableDataTimes
selectableDataTimes.get( .get(selectableDataTimes.size() - skipCount - 1));
selectableDataTimes.size()-skipCount-1) );
if( frmTimeMatcher == null || if (frmTimeMatcher == null
frmTimeMatcher.matchTime( selectableTime ) ) { || frmTimeMatcher.matchTime(selectableTime)) {
if (isForecast) { if (isForecast) {
frameTimes.add(selectableTime); frameTimes.add(selectableTime);

View file

@ -603,12 +603,12 @@ implements INatlCntrsResource, IStationField {
DataTime startTime = new DataTime( svrlData.eventTime.getValidPeriod().getStart() ); DataTime startTime = new DataTime( svrlData.eventTime.getValidPeriod().getStart() );
DataTime endTime = new DataTime( svrlData.eventTime.getValidPeriod().getEnd() ); DataTime endTime = new DataTime( svrlData.eventTime.getValidPeriod().getEnd() );
String temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16) String temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16)
+ "-" + endTime.toString().substring(11, 13) + startTime.toString().substring(14,16); + "-" + endTime.toString().substring(11, 13) + endTime.toString().substring(14,16);
enabledText.add(temp); enabledText.add(temp);
} }
for (int j=enabledText.size(); j<2; j++) for (int j=enabledText.size(); j<2; j++){
enabledText.add(""); enabledText.add("");}
text = enabledText.toArray(text); text = enabledText.toArray(text);
@ -757,10 +757,11 @@ implements INatlCntrsResource, IStationField {
} }
} }
if(gw.size() == 0) if(gw.size() == 0) {
continue; continue;}
else else{
keyResultMap.put(sd.datauri, new Result(getEachWrdoShape(gw),null,null,null));//TODO: other key keyResultMap.put(sd.datauri, new Result(getEachWrdoShape(gw),null,null,null));//TODO: other key
}
} }
@ -798,10 +799,10 @@ String key = wData.datauri;//.getKey(); //TODO other key?
CountyResultJob.Result result = crjob.keyResultMap.get(key); CountyResultJob.Result result = crjob.keyResultMap.get(key);
if (result != null) if (result != null) {
outlineShape = result.outlineShape; outlineShape = result.outlineShape;}
else else {
return; return;}
if (outlineShape != null && outlineShape.isDrawable()){ if (outlineShape != null && outlineShape.isDrawable()){

View file

@ -381,7 +381,7 @@ public class WarnResource extends AbstractNatlCntrsResource< WarnResourceData, N
DataTime startTime = new DataTime( warnData.eventTime.getValidPeriod().getStart() ); DataTime startTime = new DataTime( warnData.eventTime.getValidPeriod().getStart() );
DataTime endTime = new DataTime( warnData.eventTime.getValidPeriod().getEnd() ); DataTime endTime = new DataTime( warnData.eventTime.getValidPeriod().getEnd() );
String temp = startTime.toString().substring(11, 13) +startTime.toString().substring(14, 16) String temp = startTime.toString().substring(11, 13) +startTime.toString().substring(14, 16)
+ "-" + endTime.toString().substring(11, 13) +startTime.toString().substring(14, 16); + "-" + endTime.toString().substring(11, 13) +endTime.toString().substring(14, 16);
enabledText.add(temp); enabledText.add(temp);
} }

View file

@ -571,7 +571,7 @@ implements INatlCntrsResource, IStationField {
DataTime startTime = new DataTime( wcnData.eventTime.getValidPeriod().getStart() ); DataTime startTime = new DataTime( wcnData.eventTime.getValidPeriod().getStart() );
DataTime endTime = new DataTime( wcnData.eventTime.getValidPeriod().getEnd() ); DataTime endTime = new DataTime( wcnData.eventTime.getValidPeriod().getEnd() );
String temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16) String temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16)
+ "-" + endTime.toString().substring(11, 13) + startTime.toString().substring(14,16); + "-" + endTime.toString().substring(11, 13) + endTime.toString().substring(14,16);
enabledText.add(temp); enabledText.add(temp);
} }
@ -728,7 +728,7 @@ implements INatlCntrsResource, IStationField {
DataTime startTime = new DataTime( wcnData.eventTime.getValidPeriod().getStart() ); DataTime startTime = new DataTime( wcnData.eventTime.getValidPeriod().getStart() );
DataTime endTime = new DataTime( wcnData.eventTime.getValidPeriod().getEnd() ); DataTime endTime = new DataTime( wcnData.eventTime.getValidPeriod().getEnd() );
String temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16) String temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16)
+ "-" + endTime.toString().substring(11, 13) + startTime.toString().substring(14,16); + "-" + endTime.toString().substring(11, 13) + endTime.toString().substring(14,16);
enabledText.add(temp); enabledText.add(temp);
} }

View file

@ -922,7 +922,7 @@ implements INatlCntrsResource, IStationField {
DataTime startTime = new DataTime( wData.eventTime.getValidPeriod().getStart() ); DataTime startTime = new DataTime( wData.eventTime.getValidPeriod().getStart() );
DataTime endTime = new DataTime( wData.eventTime.getValidPeriod().getEnd() ); DataTime endTime = new DataTime( wData.eventTime.getValidPeriod().getEnd() );
String temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16) String temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16)
+ "-" + endTime.toString().substring(11, 13) + startTime.toString().substring(14,16); + "-" + endTime.toString().substring(11, 13) + endTime.toString().substring(14,16);
enabledText.add(temp); enabledText.add(temp);
} }
@ -1007,7 +1007,7 @@ implements INatlCntrsResource, IStationField {
startTime = new DataTime( wData.eventTime.getValidPeriod().getStart() ); startTime = new DataTime( wData.eventTime.getValidPeriod().getStart() );
endTime = new DataTime( wData.eventTime.getValidPeriod().getEnd() ); endTime = new DataTime( wData.eventTime.getValidPeriod().getEnd() );
temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16) temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16)
+ "-" + endTime.toString().substring(11, 13) + startTime.toString().substring(14,16); + "-" + endTime.toString().substring(11, 13) + endTime.toString().substring(14,16);
if (time.equalsIgnoreCase("") || !time.equalsIgnoreCase(temp)) { if (time.equalsIgnoreCase("") || !time.equalsIgnoreCase(temp)) {
timeList.add(temp); timeList.add(temp);
@ -1132,7 +1132,7 @@ implements INatlCntrsResource, IStationField {
startTime = new DataTime( wData.eventTime.getValidPeriod().getStart() ); startTime = new DataTime( wData.eventTime.getValidPeriod().getStart() );
endTime = new DataTime( wData.eventTime.getValidPeriod().getEnd() ); endTime = new DataTime( wData.eventTime.getValidPeriod().getEnd() );
temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16) temp = startTime.toString().substring(11, 13) + startTime.toString().substring(14,16)
+ "-" + endTime.toString().substring(11, 13) + startTime.toString().substring(14,16); + "-" + endTime.toString().substring(11, 13) + endTime.toString().substring(14,16);
if (time.equalsIgnoreCase("") || !time.equalsIgnoreCase(temp)) { if (time.equalsIgnoreCase("") || !time.equalsIgnoreCase(temp)) {
timeList.add(temp); timeList.add(temp);

View file

@ -1,29 +1,22 @@
package gov.noaa.nws.ncep.viz.rsc.ffg.rsc; package gov.noaa.nws.ncep.viz.rsc.ffg.rsc;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.geotools.referencing.wkt.Symbols;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData; import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData;
import gov.noaa.nws.ncep.viz.resources.attributes.AbstractEditResourceAttrsDialog; import gov.noaa.nws.ncep.viz.resources.attributes.AbstractEditResourceAttrsDialog;
import gov.noaa.nws.ncep.viz.resources.attributes.ResourceAttrSet.RscAttrValue; import gov.noaa.nws.ncep.viz.resources.attributes.ResourceAttrSet.RscAttrValue;
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarEditor; import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarEditor;
import gov.noaa.nws.ncep.viz.ui.display.ColorBar; import gov.noaa.nws.ncep.viz.ui.display.ColorBar;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorMatrixSelector; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
/** /**
* An interface to edit FFG resource attributes. * An interface to edit FFG resource attributes.
@ -37,6 +30,7 @@ import gov.noaa.nws.ncep.viz.common.ui.color.ColorMatrixSelector;
* 30 Nov 2009 Greg Hull migrate to to11d6 * 30 Nov 2009 Greg Hull migrate to to11d6
* 21 Mar 2010 #259 Greg Hull add colorbar editor * 21 Mar 2010 #259 Greg Hull add colorbar editor
* 27 Apr 2010 #245 Greg Hull Added Apply Button * 27 Apr 2010 #245 Greg Hull Added Apply Button
* 01 Jul 2014 TTR 1018 Steve Russell Updated call to ColorBarEditor
* *
* </pre> * </pre>
* *
@ -52,9 +46,11 @@ public class EditFFGAttrsDialog extends AbstractEditResourceAttrsDialog {
} }
private RscAttrValue dispValsAttr = null; private RscAttrValue dispValsAttr = null;
private RscAttrValue colorBarAttr = null; private RscAttrValue colorBarAttr = null;
private Label symbolLbl = null; private Label symbolLbl = null;
private Combo symbolCombo = null; private Combo symbolCombo = null;
private ColorBarEditor colorBarEditor = null; private ColorBarEditor colorBarEditor = null;
@ -126,7 +122,6 @@ public class EditFFGAttrsDialog extends AbstractEditResourceAttrsDialog {
symbolLbl.setEnabled(false); symbolLbl.setEnabled(false);
Group colorBarGrp = new Group(topComp, SWT.NONE); Group colorBarGrp = new Group(topComp, SWT.NONE);
colorBarGrp.setText("Edit Color Bar"); colorBarGrp.setText("Edit Color Bar");
fd = new FormData();//400,300); fd = new FormData();//400,300);
@ -142,7 +137,7 @@ public class EditFFGAttrsDialog extends AbstractEditResourceAttrsDialog {
editedColorBar = (ColorBar) colorBarAttr.getAttrValue(); editedColorBar = (ColorBar) colorBarAttr.getAttrValue();
colorBarEditor = new ColorBarEditor( colorBarGrp, editedColorBar ); colorBarEditor = new ColorBarEditor(colorBarGrp, editedColorBar, true);
return topComp; return topComp;
} }
@ -159,4 +154,3 @@ public class EditFFGAttrsDialog extends AbstractEditResourceAttrsDialog {
colorBarEditor.dispose(); colorBarEditor.dispose();
} }
} }

View file

@ -22,11 +22,10 @@ import java.util.List;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.IGraphicsTarget; import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.drawables.IFont; import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.PaintProperties; import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.IMapDescriptor; import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Coordinate;
/** /**
@ -41,13 +40,15 @@ import com.vividsolutions.jts.geom.Coordinate;
* 04 Oct 2011 466 B. Hebbard Initial creation. * 04 Oct 2011 466 B. Hebbard Initial creation.
* 05/23/12 785 Q. Zhou Added getName for legend. * 05/23/12 785 Q. Zhou Added getName for legend.
* 17 Aug 2012 655 B. Hebbard Added paintProps as parameter to IDisplayable draw * 17 Aug 2012 655 B. Hebbard Added paintProps as parameter to IDisplayable draw
* 07/14 ? B. Yin Fixed several TCM issues (12 feet sea, 24-hour records).
* </pre> * </pre>
* *
* @author bhebbard * @author bhebbard
* @version 1.0 * @version 1.0
*/ */
public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NCMapDescriptor> public class HrcnResource extends
implements INatlCntrsResource { AbstractNatlCntrsResource<HrcnResourceData, NCMapDescriptor> implements
INatlCntrsResource {
private HrcnResourceData hrcnResourceData; private HrcnResourceData hrcnResourceData;
@ -60,24 +61,22 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
return tcmNameToDrawableElementMap; return tcmNameToDrawableElementMap;
} }
protected void setTcmNameToDrawableElementMap(
HashMap<String, Tcm> tcmNameToDrawableElementMap) {
this.tcmNameToDrawableElementMap = tcmNameToDrawableElementMap;
}
private HashMap<String, Tcm> tcmNameToDrawableElementMap; private HashMap<String, Tcm> tcmNameToDrawableElementMap;
private HashMap<String, List<TcmRecord>> datamap = new HashMap<String, List<TcmRecord>>();;
public FrameData(DataTime frameTime, int timeInt) { public FrameData(DataTime frameTime, int timeInt) {
super(frameTime, timeInt); super(frameTime, timeInt);
tcmNameToDrawableElementMap = new HashMap<String, Tcm>(); tcmNameToDrawableElementMap = new HashMap<String, Tcm>();
} }
public boolean updateFrameData(IRscDataObject rscDataObj) { public boolean updateFrameData(IRscDataObject rscDataObj) {
// Sanity I // Sanity I
if (!(rscDataObj instanceof DfltRecordRscDataObj)) { if (!(rscDataObj instanceof DfltRecordRscDataObj)) {
System.out.println("Hrcn.updateFrameData expecting DfltRecordRscDataObj " System.out
+ " instead of: " + rscDataObj.getClass().getName() ); .println("Hrcn.updateFrameData expecting DfltRecordRscDataObj "
+ " instead of: "
+ rscDataObj.getClass().getName());
return false; return false;
} }
@ -99,12 +98,67 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
} }
TcmRecord tr = (TcmRecord) pdo; TcmRecord tr = (TcmRecord) pdo;
Tcm tcm = buildTcmDrawableElement(tr);
tcmNameToDrawableElementMap.put(tr.getStormName(), tcm); if (datamap.keySet().contains(tr.getBasin() + tr.getStormNumber())) {
datamap.get(tr.getBasin() + tr.getStormNumber()).add(tr);
} else {
ArrayList<TcmRecord> tcmList = new ArrayList<TcmRecord>();
tcmList.add(tr);
datamap.put(tr.getBasin() + tr.getStormNumber(), tcmList);
}
return true; return true;
} }
private void createTcmMap() {
for (List<TcmRecord> listTcms : datamap.values()) {
// Sort the list by time
Collections.sort(listTcms, new Comparator<TcmRecord>() {
public int compare(TcmRecord tr1, TcmRecord tr2) {
return (tr1.getDataTime().getRefTimeAsCalendar()
.compareTo(tr2.getDataTime()
.getRefTimeAsCalendar()));
}
});
// build tcm
for (TcmRecord tr : listTcms) {
if (tr == listTcms.get(listTcms.size() - 1)) {
tcmNameToDrawableElementMap.put(tr.getStormName()
+ tr.getDataTime().getRefTimeAsCalendar()
.getTimeInMillis(),
buildTcmDrawableElement(tr, false));
} else {
tcmNameToDrawableElementMap.put(tr.getStormName()
+ tr.getDataTime().getRefTimeAsCalendar()
.getTimeInMillis(),
buildObsTcmDrawableElement(tr));
}
}
}
}
// return -1 if the data doesn't match. if the return value is 0 or
// positive
// then this is the number of seconds from the perfect match.
@Override
public long timeMatch(DataTime dataTime) {
long diff = frameTime.getValidTime().getTimeInMillis()
- dataTime.getValidTime().getTimeInMillis();
// get HRCN data in previous 24 hours
if (diff > 0 && diff <= 24 * 60 * 60 * 1000) {
return diff;
} else {
return -1;
}
}
} }
private IFont font = null; private IFont font = null;
@ -130,13 +184,15 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
queryRecords(); queryRecords();
} }
public void paintFrame(AbstractFrameData frameData, IGraphicsTarget target,
public void paintFrame(AbstractFrameData frameData, IGraphicsTarget target, PaintProperties paintProps) throws VizException { PaintProperties paintProps) throws VizException {
FrameData currFrameData = (FrameData) frameData; FrameData currFrameData = (FrameData) frameData;
// Allocate font and calculate vertical offset parameter for lines of text // Allocate font and calculate vertical offset parameter for lines of
font = target.initializeFont("Monospace", 14, new IFont.Style[] { IFont.Style.BOLD }); // text
font = target.initializeFont("Monospace", 14,
new IFont.Style[] { IFont.Style.BOLD });
double screenToWorldRatio = paintProps.getCanvasBounds().width double screenToWorldRatio = paintProps.getCanvasBounds().width
/ paintProps.getView().getExtent().getWidth(); / paintProps.getView().getExtent().getWidth();
Rectangle2D charSize = target.getStringBounds(font, "N"); Rectangle2D charSize = target.getStringBounds(font, "N");
@ -151,209 +207,196 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
// For each storm that has a TCM issued as of the frame time... // For each storm that has a TCM issued as of the frame time...
for (Tcm tcm : currFrameData.getTcmNameToDrawableElementMap().values()) { for (Tcm tcm : currFrameData.getTcmNameToDrawableElementMap()
.values()) {
// ...display TCM PGEN object for all forecast hours. // ...display TCM PGEN object for all forecast hours.
DisplayElementFactory df = new DisplayElementFactory(target, getNcMapDescriptor()); DisplayElementFactory df = new DisplayElementFactory(target,
ArrayList<IDisplayable> displayEls = df.createDisplayElements(tcm, paintProps); getNcMapDescriptor());
ArrayList<IDisplayable> displayEls = df.createDisplayElements(
tcm, paintProps);
for (IDisplayable each : displayEls) { for (IDisplayable each : displayEls) {
each.draw(target, paintProps); each.draw(target, paintProps);
each.dispose(); each.dispose();
} }
} }
/* /*
// Put per-hour options into arrays for easy lookup * // Put per-hour options into arrays for easy lookup final
final Boolean[] enables = {hrcnResourceData.hour0Enable, * Boolean[] enables = {hrcnResourceData.hour0Enable,
hrcnResourceData.hour1Enable, * hrcnResourceData.hour1Enable, hrcnResourceData.hour2Enable};
hrcnResourceData.hour2Enable}; * final RGB[] colors = {hrcnResourceData.hour0Color,
final RGB[] colors = {hrcnResourceData.hour0Color, * hrcnResourceData.hour1Color, hrcnResourceData.hour2Color}; final
hrcnResourceData.hour1Color, * int[] lineWidths = {hrcnResourceData.hour0LineWidth,
hrcnResourceData.hour2Color}; * hrcnResourceData.hour1LineWidth,
final int[] lineWidths = {hrcnResourceData.hour0LineWidth, * hrcnResourceData.hour2LineWidth}; final Boolean[]
hrcnResourceData.hour1LineWidth, * sequenceIdEnables = {hrcnResourceData.hour0sequenceIdEnable,
hrcnResourceData.hour2LineWidth}; * hrcnResourceData.hour1sequenceIdEnable,
final Boolean[] sequenceIdEnables = {hrcnResourceData.hour0sequenceIdEnable, * hrcnResourceData.hour2sequenceIdEnable};
hrcnResourceData.hour1sequenceIdEnable, *
hrcnResourceData.hour2sequenceIdEnable}; *
*
*
* // Loop through the (preprocessed) convective SIGMET data records
* // (This should be fast.) Collection<HrcnRscDataObj>
// Loop through the (preprocessed) convective SIGMET data records * hrcnDataValues = currFrameData.hrcnDataMap.values();
// (This should be fast.) *
Collection<HrcnRscDataObj> hrcnDataValues = currFrameData.hrcnDataMap.values(); * for (HrcnRscDataObj hrcnData : hrcnDataValues) {
*
for (HrcnRscDataObj hrcnData : hrcnDataValues) { * // Check for invalid time range // TODO: See if this is still
* needed/valid... // if
// Check for invalid time range * (activeFrameTime.compareTo(hrcnData.startTime) < 0 || //
// TODO: See if this is still needed/valid... * activeFrameTime.compareTo(hrcnData.endTime) >= 0) continue;
// if (activeFrameTime.compareTo(hrcnData.startTime) < 0 || *
// activeFrameTime.compareTo(hrcnData.endTime) >= 0) continue; * // Just some 'safety' defaults boolean enable = false; RGB color
* = new RGB (155, 155, 155); int lineWidth = 2; boolean
// Just some 'safety' defaults * sequenceIdEnable = true;
boolean enable = false; *
RGB color = new RGB (155, 155, 155); * // Are we moving? (Decoder uses negative numbers to say no.)
int lineWidth = 2; * boolean inMotion = (hrcnData.direction >= 0) && (hrcnData.speed >
boolean sequenceIdEnable = true; * 0);
*
// Are we moving? (Decoder uses negative numbers to say no.) * for (int hour = 0; hour <= 2; hour++) { switch
boolean inMotion = (hrcnData.direction >= 0) && (hrcnData.speed > 0); * (hrcnData.classType) { case AREA: case LINE: case ISOL: // these
* (may) have motion; set hourly parameters enable = enables[hour]
for (int hour = 0; hour <= 2; hour++) { * && (hour == 0 || inMotion); color = colors[hour]; lineWidth =
switch (hrcnData.classType) { * lineWidths[hour]; sequenceIdEnable = sequenceIdEnables[hour];
case AREA: * break; case OUTLOOK: // no motion; draw only zero hour (if
case LINE: * enabled) enable = (hour == 0) &&
case ISOL: // these (may) have motion; set hourly parameters * hrcnResourceData.getOutlookEnable(); color =
enable = enables[hour] && (hour == 0 || inMotion); * hrcnResourceData.getOutlookColor(); lineWidth =
color = colors[hour]; * hrcnResourceData.getOutlookLineWidth(); sequenceIdEnable = true;
lineWidth = lineWidths[hour]; * // cannot disable sequence ID for outlooks unless outlooks
sequenceIdEnable = sequenceIdEnables[hour]; * disabled altogether break; case CS: // nil convective SIGMET
break; * enable = false; break; case UNKNOWN: //TODO: Sanity check error!
case OUTLOOK: // no motion; draw only zero hour (if enabled) * Unrecognized class type. enable = false; break; default: } if
enable = (hour == 0) && hrcnResourceData.getOutlookEnable(); * (enable) { PixelCoordinate prevLoc = null; PixelCoordinate
color = hrcnResourceData.getOutlookColor(); * topLocation = null; // text placed above (screen, not necessarily
lineWidth = hrcnResourceData.getOutlookLineWidth(); * north) this won't interfere with the geometry double
sequenceIdEnable = true; // cannot disable sequence ID for outlooks unless outlooks disabled altogether * longitudeAtTopLocation = 0.0; for (int i=0; i<hrcnData.numPoints;
break; * i++) { LatLonPoint currentPoint = hrcnData.points[i]; if
case CS: // nil convective SIGMET * (currentPoint == null) continue; // gracefully skip over omitted
enable = false; * points (say, location lookup failure) if (hour > 0) { //
break; * extrapolate position in future double headingRadians =
case UNKNOWN: //TODO: Sanity check error! Unrecognized class type. * Math.toRadians((double) (360 - (hrcnData.direction + 180) %
enable = false; * 360)); // TO instead of FROM; CCW instead of CW); double
break; * distanceRadians = hour * hrcnData.speed * ONE_NM_RADIANS;
default: * currentPoint = currentPoint.positionOf(headingRadians,
} * distanceRadians); } double[] latLon = {
if (enable) { * currentPoint.getLongitude(LatLonPoint.INDEGREES),
PixelCoordinate prevLoc = null; * currentPoint.getLatitude(LatLonPoint.INDEGREES) };
PixelCoordinate topLocation = null; // text placed above (screen, not necessarily north) this won't interfere with the geometry * PixelCoordinate currLoc = new
double longitudeAtTopLocation = 0.0; * PixelCoordinate(descriptor.worldToPixel(latLon)); if (prevLoc !=
for (int i=0; i<hrcnData.numPoints; i++) { * null) { // skip first location // draw line/polygon segment
LatLonPoint currentPoint = hrcnData.points[i]; * target.drawLine(prevLoc.getX(), prevLoc.getY(), prevLoc.getZ(),
if (currentPoint == null) continue; // gracefully skip over omitted points (say, location lookup failure) * currLoc.getX(), currLoc.getY(), currLoc.getZ(), color,
if (hour > 0) { * lineWidth); } else if (hrcnData.numPoints == 1) { //TODO: Check
// extrapolate position in future * for classType ISOL instead or in addition? // single point; draw
double headingRadians = Math.toRadians((double) (360 - (hrcnData.direction + 180) % 360)); // TO instead of FROM; CCW instead of CW); * marker and circle double delta = offsetY * 0.3; // tune to match
double distanceRadians = hour * hrcnData.speed * ONE_NM_RADIANS; * NMAP target.drawLine(currLoc.getX()-delta, currLoc.getY(),
currentPoint = currentPoint.positionOf(headingRadians, distanceRadians); * currLoc.getZ(), currLoc.getX()+delta, currLoc.getY(),
} * currLoc.getZ(), color, lineWidth);
double[] latLon = { currentPoint.getLongitude(LatLonPoint.INDEGREES), * target.drawLine(currLoc.getX(), currLoc.getY()-delta,
currentPoint.getLatitude(LatLonPoint.INDEGREES) }; * currLoc.getZ(), currLoc.getX(), currLoc.getY()+delta,
PixelCoordinate currLoc = new PixelCoordinate(descriptor.worldToPixel(latLon)); * currLoc.getZ(), color, lineWidth); double radius =
if (prevLoc != null) { // skip first location * hrcnData.distance / 2.0; target.drawCircle(currLoc.getX(),
// draw line/polygon segment * currLoc.getY(), currLoc.getZ(), radius, color, lineWidth);
target.drawLine(prevLoc.getX(), prevLoc.getY(), prevLoc.getZ(), * topLocation = new PixelCoordinate(currLoc.getX(),
currLoc.getX(), currLoc.getY(), currLoc.getZ(), color, lineWidth); * currLoc.getY()-radius); // circle top } if (topLocation == null
} * || topLocation.getY() > currLoc.getY()) { topLocation = currLoc;
else if (hrcnData.numPoints == 1) { //TODO: Check for classType ISOL instead or in addition? * longitudeAtTopLocation = latLon[0]; } prevLoc = currLoc; }
// single point; draw marker and circle *
double delta = offsetY * 0.3; // tune to match NMAP * // Draw labels
target.drawLine(currLoc.getX()-delta, currLoc.getY(), currLoc.getZ(), *
currLoc.getX()+delta, currLoc.getY(), currLoc.getZ(), color, lineWidth); * if (topLocation != null) {
target.drawLine(currLoc.getX(), currLoc.getY()-delta, currLoc.getZ(), *
currLoc.getX(), currLoc.getY()+delta, currLoc.getZ(), color, lineWidth); * // Use an ArrayList since we don't know in advance how big it'll
double radius = hrcnData.distance / 2.0; * be and would like List<String> labelList = new
target.drawCircle(currLoc.getX(), currLoc.getY(), currLoc.getZ(), radius, color, lineWidth); * ArrayList<String>();
topLocation = new PixelCoordinate(currLoc.getX(), currLoc.getY()-radius); // circle top *
} * HorizontalAlignment horizontalAlignment =
if (topLocation == null || topLocation.getY() > currLoc.getY()) { * HorizontalAlignment.LEFT;
topLocation = currLoc; *
longitudeAtTopLocation = latLon[0]; * if (sequenceIdEnable) { if (hrcnData.classType ==
} * ClassType.OUTLOOK) { // Prevent label overlap when West & Central
prevLoc = currLoc; * OR Central & East outlook // polygons have coincident top points,
} * by flipping some text to left String outlookLabel =
* hrcnData.sequenceID + " OUTLOOK"; if
// Draw labels * (hrcnData.sequenceID.endsWith("C") && longitudeAtTopLocation >
* -095.0 || //TODO: Tune longitude boundary?
if (topLocation != null) { * hrcnData.sequenceID.endsWith("W") && longitudeAtTopLocation >
* -112.0 ) { //TODO: Tune longitude boundary? horizontalAlignment =
// Use an ArrayList since we don't know in advance how big it'll be and would like * HorizontalAlignment.RIGHT; outlookLabel += " "; }
List<String> labelList = new ArrayList<String>(); * labelList.add(outlookLabel); } else {
* labelList.add(hrcnData.sequenceID); } }
HorizontalAlignment horizontalAlignment = HorizontalAlignment.LEFT; *
* if (hour == 0 && hrcnData.classType != ClassType.OUTLOOK) { if
if (sequenceIdEnable) { * (hrcnResourceData.timeEnable) { String endTimeS =
if (hrcnData.classType == ClassType.OUTLOOK) { * hrcnData.endTime.toString(); labelList.add(endTimeS.substring(8,
// Prevent label overlap when West & Central OR Central & East outlook * 10) + "/" // date + endTimeS.substring(11, 13) // hour +
// polygons have coincident top points, by flipping some text to left * endTimeS.substring(14, 16)); // minute }
String outlookLabel = hrcnData.sequenceID + " OUTLOOK"; *
if (hrcnData.sequenceID.endsWith("C") && longitudeAtTopLocation > -095.0 || //TODO: Tune longitude boundary? * if (hrcnResourceData.flightLevelEnable) { labelList.add("FL" +
hrcnData.sequenceID.endsWith("W") && longitudeAtTopLocation > -112.0 ) { //TODO: Tune longitude boundary? * hrcnData.flightLevel); }
horizontalAlignment = HorizontalAlignment.RIGHT; *
outlookLabel += " "; * if (hrcnResourceData.motionEnable && inMotion) {
} * labelList.add(String.format("%03d", // leading zeroes for
labelList.add(outlookLabel); * direction hrcnData.direction) + " " + hrcnData.speed + "kt"); }
} *
else { * if (hrcnResourceData.intensityEnable && hrcnData.intensity !=
labelList.add(hrcnData.sequenceID); * null && !hrcnData.intensity.isEmpty()) {
} * labelList.add(hrcnData.intensity); } }
} *
* if (!labelList.isEmpty()) { target.drawStrings(font,
if (hour == 0 && hrcnData.classType != ClassType.OUTLOOK) { * labelList.toArray(new String[0]), topLocation.getX(),
if (hrcnResourceData.timeEnable) { * topLocation.getY() - offsetY * (labelList.size()+0.5), 0.0,
String endTimeS = hrcnData.endTime.toString(); * TextStyle.NORMAL, new RGB[] {color, color, color, color, color,
labelList.add(endTimeS.substring(8, 10) + "/" // date * color}, //TODO: Dorky!! horizontalAlignment,
+ endTimeS.substring(11, 13) // hour * VerticalAlignment.TOP); } } } } }
+ endTimeS.substring(14, 16)); // minute
}
if (hrcnResourceData.flightLevelEnable) {
labelList.add("FL" + hrcnData.flightLevel);
}
if (hrcnResourceData.motionEnable && inMotion) {
labelList.add(String.format("%03d", // leading zeroes for direction
hrcnData.direction) + " " +
hrcnData.speed + "kt");
}
if (hrcnResourceData.intensityEnable && hrcnData.intensity != null &&
!hrcnData.intensity.isEmpty()) {
labelList.add(hrcnData.intensity);
}
}
if (!labelList.isEmpty()) {
target.drawStrings(font, labelList.toArray(new String[0]),
topLocation.getX(),
topLocation.getY() - offsetY * (labelList.size()+0.5),
0.0,
TextStyle.NORMAL,
new RGB[] {color, color, color, color, color, color}, //TODO: Dorky!!
horizontalAlignment,
VerticalAlignment.TOP);
}
}
}
}
}
*/ */
} }
font.dispose(); font.dispose();
font = null; font = null;
} }
private Tcm buildTcmDrawableElement(TcmRecord tr) { private Tcm buildTcmDrawableElement(TcmRecord tr, boolean obsOnly) {
// Generate a Tcm (DrawableElement) to represent all // Generate a Tcm (DrawableElement) to represent all
// forecast hours covered by the TcmRecord (PDO). // forecast hours covered by the TcmRecord (PDO).
Tcm t = new Tcm( Tcm t = new Tcm(tr.getStormType(), toInt(tr.getStormNumber()),
tr.getStormType(),
toInt(tr.getStormNumber()),
toInt(tr.getAdvisoryNumber()), toInt(tr.getAdvisoryNumber()),
tr.getStormName(), tr.getStormName(),
tr.getBasin(), tr.getBasin(),
tr.getEyeSize() == null ? 0 : tr.getEyeSize(), //TODO: check this out!! tr.getEyeSize() == null ? 0 : tr.getEyeSize(), // TODO: check
tr.getPositionAccuracy() == null ? 0 : tr.getPositionAccuracy(), //TODO: check this out!! // this out!!
tr.getCorr(), tr.getPositionAccuracy() == null ? 0 : tr.getPositionAccuracy(), // TODO:
tr.getObsTime(), // check
tr.getCentralPressure()); // this
// out!!
tr.getCorr(), tr.getObsTime(), tr.getCentralPressure());
List<TcmFcst> ltf = new ArrayList<TcmFcst>(); List<TcmFcst> ltf = new ArrayList<TcmFcst>();
for (TcmPositionWinds tpw : tr.getTcmPosWinds()) { for (TcmPositionWinds tpw : tr.getTcmPosWinds()) {
// skip F00 like NMAP
if (tpw.getFcstHour().equalsIgnoreCase("F00"))
continue;
TcmFcst tf = buildTcmFcstDrawableElement(tpw); TcmFcst tf = buildTcmFcstDrawableElement(tpw);
ltf.add(tf); ltf.add(tf);
// add 12 feet wave
if (tpw.getFcstHour().equalsIgnoreCase("OBS")) {
TcmWindQuarters wave = new TcmWindQuarters(new Coordinate(
tpw.getClon(), tpw.getClat()), 0,
toDouble(tr.getNe12ft()), toDouble(tr.getSe12ft()),
toDouble(tr.getSw12ft()), toDouble(tr.getNw12ft()));
t.setWaveQuatro(wave);
} }
}
Collections.sort(ltf, new Comparator<TcmFcst>() { Collections.sort(ltf, new Comparator<TcmFcst>() {
public int compare(TcmFcst tf1, TcmFcst tf2) { public int compare(TcmFcst tf1, TcmFcst tf2) {
return tf1.getFcstHr() - tf2.getFcstHr(); return tf1.getFcstHr() - tf2.getFcstHr();
@ -361,7 +404,61 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
}); });
t.setTcmFcst(ltf); t.setTcmFcst(ltf);
TcmWindQuarters twq = new TcmWindQuarters(new Coordinate(0.0, 0.0), 0, 1.0, 1.0, 1.0, 1.0); // TcmWindQuarters twq = new TcmWindQuarters(new Coordinate(0.0, 0.0),
// 0, 1.0, 1.0, 1.0, 1.0);
// t.setWaveQuatro(twq);
return t;
}
private Tcm buildObsTcmDrawableElement(TcmRecord tr) {
// Generate a Tcm (DrawableElement) to represent all
// forecast hours covered by the TcmRecord (PDO).
Tcm t = new Tcm(tr.getStormType(), toInt(tr.getStormNumber()),
toInt(tr.getAdvisoryNumber()),
tr.getStormName(),
tr.getBasin(),
tr.getEyeSize() == null ? 0 : tr.getEyeSize(), // TODO: check
// this out!!
tr.getPositionAccuracy() == null ? 0 : tr.getPositionAccuracy(), // TODO:
// check
// this
// out!!
tr.getCorr(), tr.getObsTime(), tr.getCentralPressure());
List<TcmFcst> ltf = new ArrayList<TcmFcst>();
for (TcmPositionWinds tpw : tr.getTcmPosWinds()) {
// skip F00 like NMAP
if (tpw.getFcstHour().equalsIgnoreCase("OBS")) {
final double[][] quatros = { { 0, 0, 0 }, { 0, 0, 0 },
{ 0, 0, 0 }, { 0, 0, 0 }, };
TcmFcst tf = new TcmFcst(new Coordinate(tpw.getClon(),
tpw.getClat()), toInt(tpw.getFcstHour()
.replace("F", "")), // TODO: Check
// replace/replaceAll/replaceFirst,
// etc...
quatros);
tf.setGust(tpw.getGust());
tf.setWindMax(tpw.getWindMax());
tf.setDirection(tpw.getStormDrct());
tf.setSpeed(tpw.getStormSped());
tf.setEndtime(tpw.getValidTime());
ltf.add(tf);
break;
}
}
t.setTcmFcst(ltf);
TcmWindQuarters twq = new TcmWindQuarters(new Coordinate(0.0, 0.0), 0,
1.0, 1.0, 1.0, 1.0);
t.setWaveQuatro(twq); t.setWaveQuatro(twq);
return t; return t;
@ -372,15 +469,17 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
// Generate a single TcmFcst (DrawableElement) to represent a given // Generate a single TcmFcst (DrawableElement) to represent a given
// TcmPositionWinds -- both correspond to one forecast hour. // TcmPositionWinds -- both correspond to one forecast hour.
TcmFcst tf = new TcmFcst ( TcmFcst tf = new TcmFcst(new Coordinate(tpw.getClon(), tpw.getClat()),
new Coordinate(tpw.getClon(), tpw.getClat()), toInt(tpw.getFcstHour().replace("F", "")), // TODO: Check
toInt(tpw.getFcstHour().replace("F","")), //TODO: Check replace/replaceAll/replaceFirst, etc... // replace/replaceAll/replaceFirst,
// etc...
buildQuatros(tpw)); buildQuatros(tpw));
tf.setGust(tpw.getGust()); tf.setGust(tpw.getGust());
tf.setWindMax(tpw.getWindMax()); tf.setWindMax(tpw.getWindMax());
tf.setDirection(tpw.getStormDrct()); tf.setDirection(tpw.getStormDrct());
tf.setSpeed(tpw.getStormSped()); tf.setSpeed(tpw.getStormSped());
tf.setEndtime(tpw.getValidTime());
return tf; return tf;
} }
@ -391,11 +490,14 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
// (the only way to get them in there!) // (the only way to get them in there!)
final double[][] quatros = { final double[][] quatros = {
{ toDouble(tpw.getNe34k()), toDouble(tpw.getNe50k()), toDouble(tpw.getNe64k()) }, { toDouble(tpw.getNe34k()), toDouble(tpw.getNe50k()),
{ toDouble(tpw.getSe34k()), toDouble(tpw.getSe50k()), toDouble(tpw.getSe64k()) }, toDouble(tpw.getNe64k()) },
{ toDouble(tpw.getSw34k()), toDouble(tpw.getSw50k()), toDouble(tpw.getSw64k()) }, { toDouble(tpw.getSe34k()), toDouble(tpw.getSe50k()),
{ toDouble(tpw.getNw34k()), toDouble(tpw.getNw50k()), toDouble(tpw.getNw64k()) } toDouble(tpw.getSe64k()) },
}; { toDouble(tpw.getSw34k()), toDouble(tpw.getSw50k()),
toDouble(tpw.getSw64k()) },
{ toDouble(tpw.getNw34k()), toDouble(tpw.getNw50k()),
toDouble(tpw.getNw64k()) } };
return quatros; return quatros;
} }
@ -403,18 +505,17 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
// A couple of utility conversion routines, needed because there are cases // A couple of utility conversion routines, needed because there are cases
// where we need numbers where the decoder hands us strings. // where we need numbers where the decoder hands us strings.
// TODO: Consider doing this in decoder. // TODO: Consider doing this in decoder.
// TODO: Are there public utilities to do this with graceful exception handling? // TODO: Are there public utilities to do this with graceful exception
// handling?
double toDouble(String s) { double toDouble(String s) {
Double d; Double d;
try { try {
d = Double.parseDouble(s); d = Double.parseDouble(s);
} } catch (NullPointerException e) {
catch (NullPointerException e) {
// TODO: Handle this more gracefully // TODO: Handle this more gracefully
d = 0.0; d = 0.0;
} } catch (NumberFormatException e) {
catch (NumberFormatException e) {
// TODO: Log as bogus decoder output // TODO: Log as bogus decoder output
d = 0.0; d = 0.0;
} }
@ -425,20 +526,16 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
int i; int i;
try { try {
i = Integer.parseInt(s); i = Integer.parseInt(s);
} } catch (NullPointerException e) {
catch (NullPointerException e) {
// TODO: Handle this more gracefully // TODO: Handle this more gracefully
i = 0; i = 0;
} } catch (NumberFormatException e) {
catch (NumberFormatException e) {
// TODO: Log as bogus decoder output // TODO: Log as bogus decoder output
i = 0; i = 0;
} }
return i; return i;
} }
@Override @Override
public void disposeInternal() { public void disposeInternal() {
super.disposeInternal(); super.disposeInternal();
@ -455,9 +552,26 @@ public class HrcnResource extends AbstractNatlCntrsResource<HrcnResourceData, NC
public String getName() { public String getName() {
String legendString = super.getName(); String legendString = super.getName();
FrameData fd = (FrameData) getCurrentFrame(); FrameData fd = (FrameData) getCurrentFrame();
if (fd == null || fd.getFrameTime() == null || fd.tcmNameToDrawableElementMap.size() == 0) { if (fd == null || fd.getFrameTime() == null
|| fd.tcmNameToDrawableElementMap.size() == 0) {
return legendString + "-No Data"; return legendString + "-No Data";
} }
return legendString + " "+ NmapCommon.getTimeStringFromDataTime( fd.getFrameTime(), "/"); return legendString + " "
+ NmapCommon.getTimeStringFromDataTime(fd.getFrameTime(), "/");
}
@Override
protected synchronized boolean processNewRscDataList() {
super.processNewRscDataList();
for (AbstractFrameData frameData : frameDataMap.values()) {
if (frameData != null
&& frameData instanceof HrcnResource.FrameData) {
((HrcnResource.FrameData) frameData).createTcmMap();
} }
} }
return true;
}
}

View file

@ -1,24 +1,19 @@
package gov.noaa.nws.ncep.viz.rsc.lightning.rsc; package gov.noaa.nws.ncep.viz.rsc.lightning.rsc;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorMatrixSelector;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData; import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData;
import gov.noaa.nws.ncep.viz.resources.attributes.AbstractEditResourceAttrsDialog; import gov.noaa.nws.ncep.viz.resources.attributes.AbstractEditResourceAttrsDialog;
import gov.noaa.nws.ncep.viz.resources.attributes.ResourceAttrSet.RscAttrValue; import gov.noaa.nws.ncep.viz.resources.attributes.ResourceAttrSet.RscAttrValue;
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarEditor; import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarEditor;
import gov.noaa.nws.ncep.viz.resources.misc.IMiscResourceData.EditElement;
import gov.noaa.nws.ncep.viz.ui.display.ColorBar; import gov.noaa.nws.ncep.viz.ui.display.ColorBar;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
@ -37,6 +32,7 @@ import org.eclipse.swt.widgets.Text;
* 04/10/2010 #257 Greg Hull Initial Creation. * 04/10/2010 #257 Greg Hull Initial Creation.
* 04/11/2010 #259 Greg Hull Added ColorBar * 04/11/2010 #259 Greg Hull Added ColorBar
* 04/27/2010 #245 Greg Hull Added Apply Button * 04/27/2010 #245 Greg Hull Added Apply Button
* 07/01/2014 TTR 1018 Steve Russell Updated call to ColorBarEditor
* *
* </pre> * </pre>
* *
@ -52,28 +48,37 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
} }
private Button enablePosStrikesBtn = null; private Button enablePosStrikesBtn = null;
private Button enableNegStrikesBtn = null; private Button enableNegStrikesBtn = null;
private RscAttrValue colorByIntensityAttr = null; private RscAttrValue colorByIntensityAttr = null;
private RscAttrValue enablePosStrikesAttr = null; private RscAttrValue enablePosStrikesAttr = null;
private RscAttrValue enableNegStrikesAttr = null; private RscAttrValue enableNegStrikesAttr = null;
private RscAttrValue posSymbolSizeAttr = null; private RscAttrValue posSymbolSizeAttr = null;
private RscAttrValue negSymbolSizeAttr = null; private RscAttrValue negSymbolSizeAttr = null;
private RscAttrValue colorBarAttr = null; private RscAttrValue colorBarAttr = null;
private ColorBar editedColorBar = null; private ColorBar editedColorBar = null;
private Group posStrikesGrp = null; private Group posStrikesGrp = null;
private Group negStrikesGrp = null; private Group negStrikesGrp = null;
private Composite lineWidComp1 = null; private Composite lineWidComp1 = null;
private Composite lineWidComp2 = null; private Composite lineWidComp2 = null;
private Label lwLbl1 = null; private Label lwLbl1 = null;
private Label lwLbl2 = null; private Label lwLbl2 = null;
private ColorBarEditor colorBarEditor = null; private ColorBarEditor colorBarEditor = null;
//
@Override @Override
public Composite createDialog(Composite topComp) { public Composite createDialog(Composite topComp) {
@ -84,28 +89,22 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
negSymbolSizeAttr = editedRscAttrSet.getRscAttr("negativeSymbolSize"); negSymbolSizeAttr = editedRscAttrSet.getRscAttr("negativeSymbolSize");
colorBarAttr = editedRscAttrSet.getRscAttr("colorBar"); colorBarAttr = editedRscAttrSet.getRscAttr("colorBar");
if( colorByIntensityAttr == null || if (colorByIntensityAttr == null || colorByIntensityAttr.getAttrClass() != Boolean.class) {
colorByIntensityAttr.getAttrClass() != Boolean.class ) {
System.out.println("colorByIntensity is null or not of expected class Boolean?"); System.out.println("colorByIntensity is null or not of expected class Boolean?");
} }
if( enablePosStrikesAttr == null || if (enablePosStrikesAttr == null || enablePosStrikesAttr.getAttrClass() != Boolean.class) {
enablePosStrikesAttr.getAttrClass() != Boolean.class ) {
System.out.println("enablePositiveStrikes is null or not of expected class Boolean?"); System.out.println("enablePositiveStrikes is null or not of expected class Boolean?");
} }
if( enableNegStrikesAttr == null || if (enableNegStrikesAttr == null || enableNegStrikesAttr.getAttrClass() != Boolean.class) {
enableNegStrikesAttr.getAttrClass() != Boolean.class ) {
System.out.println("enableNegativeStrikes is null or not of expected class Boolean?"); System.out.println("enableNegativeStrikes is null or not of expected class Boolean?");
} }
if( posSymbolSizeAttr == null || if (posSymbolSizeAttr == null || posSymbolSizeAttr.getAttrClass() != Integer.class) {
posSymbolSizeAttr.getAttrClass() != Integer.class ) {
System.out.println("posSymbolSize is null or not of expected class Integer?"); System.out.println("posSymbolSize is null or not of expected class Integer?");
} }
if( negSymbolSizeAttr == null || if (negSymbolSizeAttr == null || negSymbolSizeAttr.getAttrClass() != Integer.class) {
negSymbolSizeAttr.getAttrClass() != Integer.class ) {
System.out.println("negSymbolSize is null or not of expected class Integer?"); System.out.println("negSymbolSize is null or not of expected class Integer?");
} }
if( colorBarAttr == null || if (colorBarAttr == null || colorBarAttr.getAttrClass() != ColorBar.class) {
colorBarAttr.getAttrClass() != ColorBar.class ) {
System.out.println("colorBar is null or not of expected class colorBar?"); System.out.println("colorBar is null or not of expected class colorBar?");
} }
@ -114,7 +113,6 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
FormLayout layout0 = new FormLayout(); FormLayout layout0 = new FormLayout();
topComp.setLayout(layout0); topComp.setLayout(layout0);
posStrikesGrp = new Group(topComp, SWT.SHADOW_NONE); posStrikesGrp = new Group(topComp, SWT.SHADOW_NONE);
posStrikesGrp.setText("Positive Strikes"); posStrikesGrp.setText("Positive Strikes");
FormData fd = new FormData(); FormData fd = new FormData();
@ -141,8 +139,6 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
} }
}); });
negStrikesGrp = new Group(topComp, SWT.SHADOW_NONE); negStrikesGrp = new Group(topComp, SWT.SHADOW_NONE);
negStrikesGrp.setText("Negative Strikes"); negStrikesGrp.setText("Negative Strikes");
fd = new FormData(); fd = new FormData();
@ -170,7 +166,6 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
} }
}); });
lineWidComp1 = new Composite(posStrikesGrp, SWT.NONE); lineWidComp1 = new Composite(posStrikesGrp, SWT.NONE);
lineWidComp1.setLayout(new FormLayout()); lineWidComp1.setLayout(new FormLayout());
@ -179,7 +174,6 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
// fd.left = new FormAttachment( enableNegStrikesBtn, 0, SWT.LEFT ); // fd.left = new FormAttachment( enableNegStrikesBtn, 0, SWT.LEFT );
// lineWidComp1.setLayoutData( fd ); // lineWidComp1.setLayoutData( fd );
lwLbl1 = new Label(lineWidComp1, SWT.NONE); lwLbl1 = new Label(lineWidComp1, SWT.NONE);
lwLbl1.setText("Symbol Size"); lwLbl1.setText("Symbol Size");
fd = new FormData(); fd = new FormData();
@ -214,8 +208,7 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
int ival; int ival;
try { try {
ival = Integer.parseInt(widthText1.getText()); ival = Integer.parseInt(widthText1.getText());
} } catch (NumberFormatException exc) {
catch( NumberFormatException exc ) {
ival = ((Integer) posSymbolSizeAttr.getAttrValue()).intValue(); ival = ((Integer) posSymbolSizeAttr.getAttrValue()).intValue();
widthText1.setText(Integer.toString(ival)); widthText1.setText(Integer.toString(ival));
} }
@ -223,8 +216,7 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
if (ival < widthSlider1.getMinimum()) { if (ival < widthSlider1.getMinimum()) {
ival = widthSlider1.getMinimum(); ival = widthSlider1.getMinimum();
widthText1.setText(Integer.toString(ival)); widthText1.setText(Integer.toString(ival));
} } else if (ival > widthSlider1.getMaximum()) {
else if( ival > widthSlider1.getMaximum() ) {
ival = widthSlider1.getMaximum(); ival = widthSlider1.getMaximum();
widthText1.setText(Integer.toString(ival)); widthText1.setText(Integer.toString(ival));
} }
@ -240,7 +232,6 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
} }
}); });
lineWidComp2 = new Composite(negStrikesGrp, SWT.NONE); lineWidComp2 = new Composite(negStrikesGrp, SWT.NONE);
lineWidComp2.setLayout(new FormLayout()); lineWidComp2.setLayout(new FormLayout());
@ -249,7 +240,6 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
// fd.left = new FormAttachment( lineWidComp1, 0, SWT.LEFT ); // fd.left = new FormAttachment( lineWidComp1, 0, SWT.LEFT );
// lineWidComp2.setLayoutData( fd ); // lineWidComp2.setLayoutData( fd );
lwLbl2 = new Label(lineWidComp2, SWT.NONE); lwLbl2 = new Label(lineWidComp2, SWT.NONE);
lwLbl2.setText("Symbol Size"); lwLbl2.setText("Symbol Size");
fd = new FormData(); fd = new FormData();
@ -284,8 +274,7 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
int ival; int ival;
try { try {
ival = Integer.parseInt(widthText2.getText()); ival = Integer.parseInt(widthText2.getText());
} } catch (NumberFormatException exc) {
catch( NumberFormatException exc ) {
ival = ((Integer) negSymbolSizeAttr.getAttrValue()).intValue(); ival = ((Integer) negSymbolSizeAttr.getAttrValue()).intValue();
widthText2.setText(Integer.toString(ival)); widthText2.setText(Integer.toString(ival));
} }
@ -293,8 +282,7 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
if (ival < widthSlider2.getMinimum()) { if (ival < widthSlider2.getMinimum()) {
ival = widthSlider2.getMinimum(); ival = widthSlider2.getMinimum();
widthText2.setText(Integer.toString(ival)); widthText2.setText(Integer.toString(ival));
} } else if (ival > widthSlider2.getMaximum()) {
else if( ival > widthSlider2.getMaximum() ) {
ival = widthSlider2.getMaximum(); ival = widthSlider2.getMaximum();
widthText2.setText(Integer.toString(ival)); widthText2.setText(Integer.toString(ival));
} }
@ -313,8 +301,6 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
lineWidComp1.setEnabled(enablePosStrikesBtn.getSelection()); lineWidComp1.setEnabled(enablePosStrikesBtn.getSelection());
lineWidComp2.setEnabled(enableNegStrikesBtn.getSelection()); lineWidComp2.setEnabled(enableNegStrikesBtn.getSelection());
Group colorBarGrp = new Group(topComp, SWT.NONE); Group colorBarGrp = new Group(topComp, SWT.NONE);
colorBarGrp.setText("Edit Color Bar"); colorBarGrp.setText("Edit Color Bar");
fd = new FormData();//400,300); fd = new FormData();//400,300);
@ -326,7 +312,6 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
colorBarGrp.setLayout(new FormLayout()); colorBarGrp.setLayout(new FormLayout());
// final Combo colorByCombo = new Combo( colorBarGrp, SWT.DROP_DOWN | SWT.READ_ONLY ); // final Combo colorByCombo = new Combo( colorBarGrp, SWT.DROP_DOWN | SWT.READ_ONLY );
// fd = new FormData(); // fd = new FormData();
// fd.left = new FormAttachment( 0, 15 ); // fd.left = new FormAttachment( 0, 15 );
@ -352,8 +337,7 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
// fd.bottom = new FormAttachment( colorByCombo, -3, SWT.TOP ); // fd.bottom = new FormAttachment( colorByCombo, -3, SWT.TOP );
// colbarLbl.setLayoutData( fd ); // colbarLbl.setLayoutData( fd );
colorBarEditor = new ColorBarEditor(colorBarGrp, editedColorBar, true);
colorBarEditor = new ColorBarEditor( colorBarGrp, editedColorBar );
return topComp; return topComp;
} }
@ -370,4 +354,3 @@ public class EditLightningAttrsDialog extends AbstractEditResourceAttrsDialog {
colorBarEditor.dispose(); colorBarEditor.dispose();
} }
} }

View file

@ -606,22 +606,31 @@ public class ContourSupport {
return env; return env;
} }
private static void createContourLabel(IExtent extent, private void createContourLabel(IExtent extent, ContourGroup contourGroup,
ContourGroup contourGroup, float contourValue, double[][] valsArr, float contourValue, Coordinate[] llcoords, IMapDescriptor descriptor) {
IMapDescriptor descriptor) {
double minx = extent.getMinX(); double minx = extent.getMinX();
double miny = extent.getMinY(); double miny = extent.getMinY();
double maxx = extent.getMaxX(); double maxx = extent.getMaxX();
double maxy = extent.getMaxY(); double maxy = extent.getMaxY();
double[][] visiblePts = new double[valsArr.length][valsArr[0].length]; double[][] visiblePts = new double[llcoords.length][2];
int actualLength = 0; int actualLength = 0;
for (double[] dl : valsArr) { double[] in = new double[2];
if (dl[0] > minx && dl[0] < maxx && dl[1] > miny && dl[1] < maxy) { double[] out = new double[2];
visiblePts[actualLength][0] = dl[0]; for (Coordinate coord : llcoords) {
visiblePts[actualLength][1] = dl[1]; in[0] = coord.x;
in[1] = coord.y;
try {
rastPosLatLonToWorldGrid.transform(in, 0, out, 0, 1);
} catch (TransformException e) {
continue;
}
if (out[0] > minx && out[0] < maxx && out[1] > miny
&& out[1] < maxy) {
visiblePts[actualLength][0] = out[0];
visiblePts[actualLength][1] = out[1];
actualLength++; actualLength++;
} }
} }
@ -1052,9 +1061,6 @@ public class ContourSupport {
int n = 0; int n = 0;
double[][] screen = null;
double[][] screenx = null;
for (Double cval : contourGroup.cvalues) { for (Double cval : contourGroup.cvalues) {
float fval = (float) (cval * 1.0f); float fval = (float) (cval * 1.0f);
boolean toLabel = false; boolean toLabel = false;
@ -1083,22 +1089,13 @@ public class ContourSupport {
for (int i = 0; i < correctedGeom.getNumGeometries(); i++) { for (int i = 0; i < correctedGeom.getNumGeometries(); i++) {
Geometry gn = correctedGeom.getGeometryN(i); Geometry gn = correctedGeom.getGeometryN(i);
// System.out.println("GEOMETRY " + i + ":");
// System.out.println(gn.toString());
contourGroup.negValueShape.addLineSegment(gn contourGroup.negValueShape.addLineSegment(gn
.getCoordinates()); .getCoordinates());
if (toLabel) { if (toLabel) {
long tl0 = System.currentTimeMillis(); long tl0 = System.currentTimeMillis();
// prepareLabel(contourGroup, zoom, fval,
// labelPoints, screen);
if (screen != null)
createContourLabel(extent, contourGroup, fval, createContourLabel(extent, contourGroup, fval,
screen, descriptor); gn.getCoordinates(), descriptor);
if (screenx != null) {
createContourLabel(extent, contourGroup, fval,
screenx, descriptor);
}
long tl1 = System.currentTimeMillis(); long tl1 = System.currentTimeMillis();
total_labeling_time += (tl1 - tl0); total_labeling_time += (tl1 - tl0);
} }
@ -1622,6 +1619,11 @@ public class ContourSupport {
try { try {
xform.transform(tmp, 0, out, 0, 1); xform.transform(tmp, 0, out, 0, 1);
if (out[0] < -180 || out[0] > 180.) {
out[0] = ((out[0] + 180) % 360) - 180;
}
if (out[0] == 0.0)
out[0] = 0.001;
clist.add(new Coordinate(out[0], out[1]), true); clist.add(new Coordinate(out[0], out[1]), true);
} catch (TransformException e) { } catch (TransformException e) {
} }

View file

@ -131,6 +131,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
* 04/11/2014 #981 D.Sushon Added fault tolerance for when some data is bad to display the good data rather than fall-through entire frame * 04/11/2014 #981 D.Sushon Added fault tolerance for when some data is bad to display the good data rather than fall-through entire frame
* 04/14/2014 S.Gilbert Cleaned up old unused methods * 04/14/2014 S.Gilbert Cleaned up old unused methods
* 04/22/2014 #1129 B. Hebbard Feed HILO point count limits to GridRelativeHiLoDisplay constructor instead of HILORelativeMinAndMaxLocator, so can apply dynamically based on current extent * 04/22/2014 #1129 B. Hebbard Feed HILO point count limits to GridRelativeHiLoDisplay constructor instead of HILORelativeMinAndMaxLocator, so can apply dynamically based on current extent
* 06/27/2014 ? B. Yin Handle grid analysis (cycle time is null).
* </pre> * </pre>
* *
* @author mli * @author mli
@ -1735,7 +1736,7 @@ public class NcgridResource extends
DataTime cycleTime = rscName.getCycleTime(); DataTime cycleTime = rscName.getCycleTime();
if (cycleTime == null || rscName.isLatestCycleTime()) { // latest should if (rscName.isLatestCycleTime()) { // latest should
// already be // already be
// resolved // resolved
// here. // here.
@ -1743,7 +1744,8 @@ public class NcgridResource extends
} }
List<DataTime> availableTimes = new ArrayList<DataTime>(); List<DataTime> availableTimes = new ArrayList<DataTime>();
if (gridRscData.getPluginName().equalsIgnoreCase(
if ( cycleTime != null && gridRscData.getPluginName().equalsIgnoreCase(
GempakGrid.gempakPluginName)) { GempakGrid.gempakPluginName)) {
try { try {
String dataLocation = null; String dataLocation = null;
@ -1848,17 +1850,23 @@ public class NcgridResource extends
DataTime availTime = new DataTime(dt.getRefTime(), dt.getFcstTime()); DataTime availTime = new DataTime(dt.getRefTime(), dt.getFcstTime());
DataTime refTime = new DataTime(dt.getRefTime()); DataTime refTime = new DataTime(dt.getRefTime());
if (cycleTime != null) {
if (cycleTime.equals(refTime)) { if (cycleTime.equals(refTime)) {
if (!dataTimes.contains(availTime)) { if (!dataTimes.contains(availTime)) {
dataTimes.add(availTime); dataTimes.add(availTime);
// reuse the same gribRec this is a bit of a hack but hey. // reuse the same gribRec this is a bit of a hack but
// hey.
// gribRec.setDataTime(availTime); // gribRec.setDataTime(availTime);
// for( IRscDataObject dataObject : processRecord( availTime // for( IRscDataObject dataObject : processRecord(
// availTime
// ) ) { // gribRec ) ) { // ) ) { // gribRec ) ) {
// newRscDataObjsQueue.add(dataObject); // newRscDataObjsQueue.add(dataObject);
// } // }
} }
} }
} else { // for grid analysis
dataTimes.add(availTime);
}
} }
setDataTimesForDgdriv(dataTimes); setDataTimesForDgdriv(dataTimes);
setAllFramesAsPopulated(); setAllFramesAsPopulated();

View file

@ -3,6 +3,14 @@ package gov.noaa.nws.ncep.viz.rsc.ncgrid.rsc;
import gov.noaa.nws.ncep.viz.gempak.util.GempakGrid; import gov.noaa.nws.ncep.viz.gempak.util.GempakGrid;
import gov.noaa.nws.ncep.viz.resources.AbstractNatlCntrsRequestableResourceData; import gov.noaa.nws.ncep.viz.resources.AbstractNatlCntrsRequestableResourceData;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData; import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData;
import gov.noaa.nws.ncep.viz.resources.manager.ResourceDefinition;
import gov.noaa.nws.ncep.viz.resources.manager.ResourceDefnsMngr;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAccessorType;
@ -37,6 +45,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
* 03/28/2012 X. Guo Don't need to convert gdfile toUppercase * 03/28/2012 X. Guo Don't need to convert gdfile toUppercase
* 08/29/2012 #743 Archana Added CLRBAR * 08/29/2012 #743 Archana Added CLRBAR
* 09/14/2013 #1036 S. Gurung Added TEXT * 09/14/2013 #1036 S. Gurung Added TEXT
* 07/02/2014 ? B. Yin Handle grid analysis.
* *
* </pre> * </pre>
* *
@ -45,8 +54,9 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
*/ */
@XmlAccessorType(XmlAccessType.NONE) @XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "NC-NcgridResourceData") @XmlType(name = "NC-NcgridResourceData")
public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData public class NcgridResourceData extends
implements INatlCntrsResourceData { AbstractNatlCntrsRequestableResourceData implements
INatlCntrsResourceData {
@XmlElement @XmlElement
protected String type; protected String type;
@ -146,8 +156,7 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
return false; return false;
} else if (this.type == null && other.type != null) { } else if (this.type == null && other.type != null) {
return false; return false;
} else if (this.type != null } else if (this.type != null && this.type.equals(other.type) == false) {
&& this.type.equals(other.type) == false) {
return false; return false;
} }
@ -155,8 +164,7 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
return false; return false;
} else if (this.cint == null && other.cint != null) { } else if (this.cint == null && other.cint != null) {
return false; return false;
} else if (this.cint != null } else if (this.cint != null && this.cint.equals(other.cint) == false) {
&& this.cint.equals(other.cint) == false) {
return false; return false;
} }
@ -200,8 +208,7 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
return false; return false;
} else if (this.skip == null && other.skip != null) { } else if (this.skip == null && other.skip != null) {
return false; return false;
} else if (this.skip != null } else if (this.skip != null && this.skip.equals(other.skip) == false) {
&& this.skip.equals(other.skip) == false) {
return false; return false;
} }
@ -267,8 +274,7 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
return false; return false;
} else if (this.fint == null && other.fint != null) { } else if (this.fint == null && other.fint != null) {
return false; return false;
} else if (this.fint != null } else if (this.fint != null && this.fint.equals(other.fint) == false) {
&& this.fint.equals(other.fint) == false) {
return false; return false;
} }
@ -285,8 +291,7 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
return false; return false;
} else if (this.hilo == null && other.hilo != null) { } else if (this.hilo == null && other.hilo != null) {
return false; return false;
} else if (this.hilo != null } else if (this.hilo != null && this.hilo.equals(other.hilo) == false) {
&& this.hilo.equals(other.hilo) == false) {
return false; return false;
} }
@ -312,15 +317,13 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
return false; return false;
} else if (this.text == null && other.text != null) { } else if (this.text == null && other.text != null) {
return false; return false;
} else if (this.text != null } else if (this.text != null && this.text.equals(other.text) == false) {
&& this.text.equals(other.text) == false) {
return false; return false;
} }
return true; return true;
} }
public String getCint() { public String getCint() {
return cint; return cint;
} }
@ -353,7 +356,6 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
this.glevel = glevel; this.glevel = glevel;
} }
public String getGdpfun() { public String getGdpfun() {
return gdpfun; return gdpfun;
} }
@ -394,7 +396,6 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
this.title = title; this.title = title;
} }
public String getType() { public String getType() {
return type; return type;
} }
@ -404,17 +405,12 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
} }
/* /*
public DisplayType getVectorType() { * public DisplayType getVectorType() { if
if (this.type.toUpperCase().contains("B")) { * (this.type.toUpperCase().contains("B")) { return DisplayType.BARB; } else
return DisplayType.BARB; * if (this.type.toUpperCase().contains("A") ||
} else if (this.type.toUpperCase().contains("A") || this.type.toUpperCase().contains("D")) { * this.type.toUpperCase().contains("D")) { return DisplayType.ARROW; } else
return DisplayType.ARROW; * if (this.type.toUpperCase().contains("S")) { return
} else if (this.type.toUpperCase().contains("S")) { * DisplayType.STREAMLINE; } else { return null; } }
return DisplayType.STREAMLINE;
} else {
return null;
}
}
*/ */
public String getLineAttributes() { public String getLineAttributes() {
@ -473,7 +469,6 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
this.wind = wind; this.wind = wind;
} }
public String getHilo() { public String getHilo() {
return hilo; return hilo;
} }
@ -498,7 +493,8 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
} }
/** /**
* @param clrbar the clrbar to set * @param clrbar
* the clrbar to set
*/ */
public void setClrbar(String clrbar) { public void setClrbar(String clrbar) {
this.clrbar = clrbar; this.clrbar = clrbar;
@ -514,22 +510,22 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
public String getEventName() { public String getEventName() {
if (getMetadataMap().containsKey("info.secondaryId")) { if (getMetadataMap().containsKey("info.secondaryId")) {
String eventName = getMetadataMap().get("info.secondaryId").getConstraintValue(); String eventName = getMetadataMap().get("info.secondaryId")
.getConstraintValue();
return (eventName.equals("%") ? null : eventName); return (eventName.equals("%") ? null : eventName);
} } else {
else {
return null; return null;
} }
} }
public String getEnsembelMember() { public String getEnsembelMember() {
if (getMetadataMap().containsKey("info.ensembleId")) { if (getMetadataMap().containsKey("info.ensembleId")) {
String ensembleMember = getMetadataMap().get("info.ensembleId").getConstraintValue(); String ensembleMember = getMetadataMap().get("info.ensembleId")
.getConstraintValue();
return (ensembleMember.equals("%") ? null : ensembleMember); return (ensembleMember.equals("%") ? null : ensembleMember);
} } else {
else {
return null; return null;
} }
} }
@ -551,7 +547,8 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
if (getPluginName().equalsIgnoreCase(GempakGrid.gempakPluginName)) { if (getPluginName().equalsIgnoreCase(GempakGrid.gempakPluginName)) {
try { try {
String currentCycle = getResourceName().getCycleTime().toString(); String currentCycle = getResourceName().getCycleTime()
.toString();
String dataLoc = null; String dataLoc = null;
try { try {
dataLoc = GempakGrid.getGempakGridPath(getGdfile()); dataLoc = GempakGrid.getGempakGridPath(getGdfile());
@ -559,8 +556,8 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
} catch (VizException e) { } catch (VizException e) {
throw new VizException(e); throw new VizException(e);
} }
String [] gridAvailableTimes = GempakGrid String[] gridAvailableTimes = GempakGrid.getAvailableGridTimes(
.getAvailableGridTimes(dataLoc, currentCycle,getGdfile().toLowerCase()); dataLoc, currentCycle, getGdfile().toLowerCase());
DataTime[] availableTimes = new DataTime[gridAvailableTimes.length]; DataTime[] availableTimes = new DataTime[gridAvailableTimes.length];
for (int ii = 0; ii < gridAvailableTimes.length; ii++) { for (int ii = 0; ii < gridAvailableTimes.length; ii++) {
@ -571,10 +568,168 @@ public class NcgridResourceData extends AbstractNatlCntrsRequestableResourceData
// TODO Auto-generated catch block // TODO Auto-generated catch block
throw new VizException(); throw new VizException();
} }
} } else {
else {
DataTime[] availableTimes = super.getAvailableTimes(); DataTime[] availableTimes = super.getAvailableTimes();
return availableTimes; return availableTimes;
} }
} }
@Override
public List<DataTime> getAvailableDataTimes() {
if (getResourceName().getCycleTime() != null) {
return super.getAvailableDataTimes();
} else {
// For grid analysis
List<DataTime> availTimesList = null;
try {
ResourceDefinition rscDefn = ResourceDefnsMngr.getInstance()
.getResourceDefinition(getResourceName());
if (rscDefn.getInventoryEnabled()
&& rscDefn.isInventoryInitialized()) {
availTimesList = rscDefn.getDataTimes(getResourceName());
} else {
try {
DataTime[] availTimes = null;
availTimes = getAvailableTimes();
if (availTimes == null) {
return new ArrayList<DataTime>();
}
availTimesList = Arrays.asList(availTimes);
} catch (VizException e) {
System.out.println("Error getting Available Times: "
+ e.getMessage());
return null;
}
}
} catch (VizException e1) {
return availTimesList;
}
// Sort the time by ref-time then by forecast hours.
Collections.sort(availTimesList);
Iterator<DataTime> it = availTimesList.iterator();
// test dfltFrameTimes ="firstf00-lastf06" All f00 plus last f06;
// test dfltFrameTimes ="firstf00 - lastf06";
// test dfltFrameTimes ="allf00";
// test dfltFrameTimes = null;
// test dfltFrameTimes = "";
// dfltFrameTimes ="allf000";
List<DataTime> availAnlsList = new ArrayList<DataTime>();
if (dfltFrameTimes == null || dfltFrameTimes.isEmpty()) { // Default
// is
// "AllF00"
while (it.hasNext()) {
DataTime dt = (DataTime) it.next();
if (dt.getFcstTime() == 0) {
availAnlsList.add(dt);
}
}
} else {
String dft = dfltFrameTimes.toUpperCase();
if (dft.contains("ALLF")) { // For GDATTIM = "allfxx". Default
// is "ALLF00"
int fxx = 0;
try {
int idx1 = dft.indexOf("ALLF");
fxx = Integer.parseInt(dft.substring(idx1 + 4));
} catch (NumberFormatException e) {
fxx = 0;
}
fxx *= 3600;
while (it.hasNext()) {
DataTime dt = (DataTime) it.next();
if (dt.getFcstTime() == fxx) {
availAnlsList.add(dt);
}
}
} else if (dft.contains("FIRSTF") && dft.contains("LASTF")) { // For
// GDATTIM
// =
// "firstfxx - lastfyy".
int fxx = 0;
int fyy = 0;
int idx1 = dft.indexOf("FIRSTF");
if (idx1 >= 0) {
int idx2 = dft.indexOf('-');
if (idx2 > 0 && idx2 > idx1 + 6) {
try {
fxx = Integer.parseInt(dft.substring(idx1 + 6,
idx2));
} catch (NumberFormatException e) {
fxx = 0;
}
}
}
idx1 = dft.indexOf("LASTF");
if (idx1 >= 0) {
try {
fyy = Integer.parseInt(dft.substring(idx1 + 5));
} catch (NumberFormatException e) {
fyy = 0;
}
}
DataTime lastItem = null;
// find the last item
for (int ii = availTimesList.size() - 1; ii >= 0; ii--) {
DataTime dt = availTimesList.get(ii);
if (dt.getFcstTime() == fyy * 3600) {
lastItem = dt;
break;
}
}
for (int ii = availTimesList.size() - 1; ii >= 0; ii--) {
DataTime dt = availTimesList.get(ii);
System.out.println("Time: " + dt.getRefTime()
+ "FCST: " + dt.getFcstTime() / 3600);
}
while (it.hasNext()) {
DataTime dt = (DataTime) it.next();
if (dt == lastItem) {
availAnlsList.add(dt);
break;
} else if (dt.getFcstTime() == fxx) {
availAnlsList.add(dt);
}
}
} else { // for anything else in GDATTIM
while (it.hasNext()) {
DataTime dt = (DataTime) it.next();
if (dt.getFcstTime() == 0) {
availAnlsList.add(dt);
}
}
}
}
return availAnlsList;
}
}
/**
* Checks if the GDATTIM is in format "ALLFXX" or "FIRSTFxx-LASTFxx"
*
* @return
*/
public boolean isGdattimForGridAnalysis() {
if (dfltFrameTimes != null && !dfltFrameTimes.isEmpty()) {
return (dfltFrameTimes.toUpperCase().contains("ALLF") || (dfltFrameTimes
.toUpperCase().contains("FIRSTF") && dfltFrameTimes
.toUpperCase().contains("LASTF")));
} else {
return false;
}
}
} }

View file

@ -1,17 +1,24 @@
package gov.noaa.nws.ncep.viz.rsc.ncscat.rsc; package gov.noaa.nws.ncep.viz.rsc.ncscat.rsc;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData;
import gov.noaa.nws.ncep.viz.resources.attributes.AbstractEditResourceAttrsDialog;
import gov.noaa.nws.ncep.viz.resources.attributes.ResourceAttrSet.RscAttrValue;
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarEditor;
import gov.noaa.nws.ncep.viz.rsc.ncscat.rsc.NcscatResourceData.ArrowStyle;
import gov.noaa.nws.ncep.viz.ui.display.ColorBar;
import java.util.EnumSet; import java.util.EnumSet;
import javax.xml.bind.annotation.XmlElement; import org.eclipse.jface.util.IPropertyChangeListener;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Combo;
@ -20,19 +27,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Spinner; import org.eclipse.swt.widgets.Spinner;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.geotools.referencing.wkt.Symbols;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData;
import gov.noaa.nws.ncep.viz.resources.attributes.AbstractEditResourceAttrsDialog;
import gov.noaa.nws.ncep.viz.resources.attributes.RGBColorAdapter;
import gov.noaa.nws.ncep.viz.resources.attributes.ResourceAttrSet.RscAttrValue;
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarEditor;
import gov.noaa.nws.ncep.viz.rsc.ncscat.rsc.NcscatResourceData.ArrowStyle;
import gov.noaa.nws.ncep.viz.ui.display.ColorBar;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorMatrixSelector;
/** /**
* An interface to edit NCSCAT resource attributes. * An interface to edit NCSCAT resource attributes.
@ -45,6 +39,7 @@ import gov.noaa.nws.ncep.viz.common.ui.color.ColorMatrixSelector;
* 14 Jul 2010 #235C B. Hebbard Initial Creation. * 14 Jul 2010 #235C B. Hebbard Initial Creation.
* 11 Aug 2010 #273 G. Hull Call getNcscatMode() instead of using getNatlCntrsResourceName. * 11 Aug 2010 #273 G. Hull Call getNcscatMode() instead of using getNatlCntrsResourceName.
* 08 Oct 2010 B. Hebbard Fix tool tips. * 08 Oct 2010 B. Hebbard Fix tool tips.
* 01 Jul 2014 TTR 1018 S. Russell Updated call to ColorBarEditor
* *
* </pre> * </pre>
* *
@ -62,62 +57,117 @@ public class EditNcscatAttrsDialog extends AbstractEditResourceAttrsDialog {
private NcscatMode ncscatMode = null; private NcscatMode ncscatMode = null;
private RscAttrValue skipEnableAttr = null; private RscAttrValue skipEnableAttr = null;
private RscAttrValue skipValueAttr = null; private RscAttrValue skipValueAttr = null;
private RscAttrValue densityValueAttr = null; private RscAttrValue densityValueAttr = null;
private RscAttrValue timeStampEnableAttr = null; private RscAttrValue timeStampEnableAttr = null;
private RscAttrValue timeStampColorAttr = null; private RscAttrValue timeStampColorAttr = null;
private RscAttrValue timeStampIntervalAttr = null; private RscAttrValue timeStampIntervalAttr = null;
private RscAttrValue timeStampLineWidthAttr = null; private RscAttrValue timeStampLineWidthAttr = null;
private RscAttrValue arrowStyleAttr = null; private RscAttrValue arrowStyleAttr = null;
private RscAttrValue arrowWidthAttr = null; private RscAttrValue arrowWidthAttr = null;
private RscAttrValue arrowSizeAttr = null; private RscAttrValue arrowSizeAttr = null;
private RscAttrValue headSizeAttr = null; private RscAttrValue headSizeAttr = null;
private RscAttrValue colorBarAttr01 = null; private RscAttrValue colorBarAttr01 = null;
private RscAttrValue colorBarAttr02 = null; private RscAttrValue colorBarAttr02 = null;
private RscAttrValue highWindSpeedEnableAttr = null; private RscAttrValue highWindSpeedEnableAttr = null;
private RscAttrValue lowWindSpeedEnableAttr = null; private RscAttrValue lowWindSpeedEnableAttr = null;
private RscAttrValue rainFlagEnableAttr = null; private RscAttrValue rainFlagEnableAttr = null;
private RscAttrValue availabilityFlagEnableAttr = null; private RscAttrValue availabilityFlagEnableAttr = null;
private RscAttrValue use2ndColorForRainEnableAttr = null; private RscAttrValue use2ndColorForRainEnableAttr = null;
private RscAttrValue plotCirclesForRainEnableAttr = null; private RscAttrValue plotCirclesForRainEnableAttr = null;
Button skipButton = null; Button skipButton = null;
Button densityButton = null; Button densityButton = null;
Button timeStampButton = null; Button timeStampButton = null;
Button highWindSpeedButton = null; Button highWindSpeedButton = null;
Button lowWindSpeedButton = null; Button lowWindSpeedButton = null;
Button rainQcFlagButton = null; Button rainQcFlagButton = null;
Button availRedunFlagButton = null; Button availRedunFlagButton = null;
Button use2ndColorForRainQcButton = null; Button use2ndColorForRainQcButton = null;
Button edit2ndColorButton = null; Button edit2ndColorButton = null;
Button plotCirclesForRainQcButton = null; Button plotCirclesForRainQcButton = null;
ColorBar editedColorBar1 = null; ColorBar editedColorBar1 = null;
ColorBar editedColorBar2 = null; ColorBar editedColorBar2 = null;
ColorBarEditor colorBarEditor1 = null; ColorBarEditor colorBarEditor1 = null;
ColorBarEditor colorBarEditor2 = null; ColorBarEditor colorBarEditor2 = null;
ColorButtonSelector timeStampColorSelector = null; ColorButtonSelector timeStampColorSelector = null;
Combo arrowBarbStyleCombo = null; Combo arrowBarbStyleCombo = null;
Composite timeStampColorComp = null; Composite timeStampColorComp = null;
Group colorBarGrp1 = null; Group colorBarGrp1 = null;
Group colorBarGrp2 = null; Group colorBarGrp2 = null;
Label skipLabel1 = null; Label skipLabel1 = null;
Label densityLabel1 = null; Label densityLabel1 = null;
Label timeStampLabel1 = null; Label timeStampLabel1 = null;
Label timeStampLabel2 = null; Label timeStampLabel2 = null;
Label timeStampLabel3 = null; Label timeStampLabel3 = null;
Label timeStampLabel4 = null; Label timeStampLabel4 = null;
Label arrowLabel1 = null; Label arrowLabel1 = null;
Label arrowLabel2 = null; Label arrowLabel2 = null;
Label arrowLabel3 = null; Label arrowLabel3 = null;
Label arrowLabel4 = null; Label arrowLabel4 = null;
Label flagInclusionLabel = null; Label flagInclusionLabel = null;
Label edit2ndColorLabel = null; Label edit2ndColorLabel = null;
Spinner skipSpinner = null; Spinner skipSpinner = null;
Spinner densitySpinner = null; Spinner densitySpinner = null;
Spinner timeStampIntervalSpinner = null; Spinner timeStampIntervalSpinner = null;
Spinner timeStampLineWidthSpinner = null; Spinner timeStampLineWidthSpinner = null;
Spinner arrowWidthSpinner = null; Spinner arrowWidthSpinner = null;
Spinner arrowSizeSpinner = null; Spinner arrowSizeSpinner = null;
Spinner arrowHeadSizeSpinner = null; Spinner arrowHeadSizeSpinner = null;
// //
@ -224,7 +274,6 @@ public class EditNcscatAttrsDialog extends AbstractEditResourceAttrsDialog {
FormLayout layout0 = new FormLayout(); FormLayout layout0 = new FormLayout();
topComp.setLayout(layout0); topComp.setLayout(layout0);
// Arrow Type and Attributes // Arrow Type and Attributes
arrowBarbStyleCombo = new Combo(topComp, SWT.DROP_DOWN | SWT.READ_ONLY); arrowBarbStyleCombo = new Combo(topComp, SWT.DROP_DOWN | SWT.READ_ONLY);
@ -332,7 +381,6 @@ public class EditNcscatAttrsDialog extends AbstractEditResourceAttrsDialog {
arrowLabel4.setLayoutData(fd); arrowLabel4.setLayoutData(fd);
arrowLabel4.setText("Head"); arrowLabel4.setText("Head");
// Skip // Skip
skipButton = new Button(topComp, SWT.RADIO); skipButton = new Button(topComp, SWT.RADIO);
@ -381,7 +429,6 @@ public class EditNcscatAttrsDialog extends AbstractEditResourceAttrsDialog {
skipLabel1.setText("points/rows between displayed ones"); skipLabel1.setText("points/rows between displayed ones");
skipLabel1.setEnabled(skipButton.getSelection()); skipLabel1.setEnabled(skipButton.getSelection());
// Density // Density
densityButton = new Button(topComp, SWT.RADIO); densityButton = new Button(topComp, SWT.RADIO);
@ -506,7 +553,6 @@ public class EditNcscatAttrsDialog extends AbstractEditResourceAttrsDialog {
}); });
timeStampColorComp.setEnabled(timeStampButton.getSelection()); timeStampColorComp.setEnabled(timeStampButton.getSelection());
timeStampLabel3 = new Label(topComp, SWT.None); timeStampLabel3 = new Label(topComp, SWT.None);
fd = new FormData(); fd = new FormData();
fd.left = new FormAttachment(timeStampColorComp, 0, SWT.CENTER); fd.left = new FormAttachment(timeStampColorComp, 0, SWT.CENTER);
@ -556,7 +602,7 @@ public class EditNcscatAttrsDialog extends AbstractEditResourceAttrsDialog {
editedColorBar1 = (ColorBar) colorBarAttr01.getAttrValue(); editedColorBar1 = (ColorBar) colorBarAttr01.getAttrValue();
colorBarEditor1 = new ColorBarEditor( colorBarGrp1, editedColorBar1 ); colorBarEditor1 = new ColorBarEditor(colorBarGrp1, editedColorBar1, true);
// Color Bar - Alternate // Color Bar - Alternate
@ -574,7 +620,7 @@ public class EditNcscatAttrsDialog extends AbstractEditResourceAttrsDialog {
editedColorBar2 = (ColorBar) colorBarAttr02.getAttrValue(); editedColorBar2 = (ColorBar) colorBarAttr02.getAttrValue();
colorBarEditor2 = new ColorBarEditor( colorBarGrp2, editedColorBar2 ); colorBarEditor2 = new ColorBarEditor(colorBarGrp2, editedColorBar2, false);
colorBarGrp2.setVisible(false); colorBarGrp2.setVisible(false);
@ -752,4 +798,3 @@ public class EditNcscatAttrsDialog extends AbstractEditResourceAttrsDialog {
} }
} }

View file

@ -78,6 +78,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* 06/17/2014 923 S. Russell added method getLastCharInPosition() * 06/17/2014 923 S. Russell added method getLastCharInPosition()
* 06/17/2014 923 S. Russell altered method setUpSymbolMappingTables() * 06/17/2014 923 S. Russell altered method setUpSymbolMappingTables()
* 06/17/2014 923 S. Russell altered method createRenderableData() * 06/17/2014 923 S. Russell altered method createRenderableData()
* 07/08/2014 TTR1027 B. Hebbard Force createRenderableData to recreate wind vectors each time.
*/ */
public class NcPlotImageCreator { public class NcPlotImageCreator {
@ -1978,7 +1979,14 @@ public class NcPlotImageCreator {
// System.out.print(s.info.stationId + ","); // System.out.print(s.info.stationId + ",");
// } // }
// System.out.println("stnColl = " + stnColl); // System.out.println("stnColl = " + stnColl);
if (drawVectorsFirstTime) {
// Following changed (= true) to force recreation of wind
// vectors each time, and so bypass (at negligible cost)
// problems in the "else" block below. (That block attempts
// to create/remove vectors selectively based on changes
// from previous set, but doesn't quite get it right --
// dropping vectors after panning in at least some cases.
if (drawVectorsFirstTime = true) { // NOT == ! See above.
sm.acquireUninterruptibly(); sm.acquireUninterruptibly();
@ -1992,6 +2000,9 @@ public class NcPlotImageCreator {
} else { } else {
// Note: Now dead code (see note above). Left in for
// future analysis and possible reuse in refactoring.
if (hasStationDensityChanged) { if (hasStationDensityChanged) {
/* /*
* If the station density is different from the * If the station density is different from the
@ -2101,7 +2112,7 @@ public class NcPlotImageCreator {
} }
sm.release(); sm.release();
} }
// End of newly-dead code. See note above.
} }
} }

View file

@ -131,6 +131,12 @@ import com.vividsolutions.jts.geom.Coordinate;
* 11/07/2013 sgurung Added fix for "no data for every other frame" issue (earlier fix was added to 13.5.2 on 10/24/2013) * 11/07/2013 sgurung Added fix for "no data for every other frame" issue (earlier fix was added to 13.5.2 on 10/24/2013)
* 03/18/2013 1064 B. Hebbard Added handling of matrixType request constraint, for PAFM * 03/18/2013 1064 B. Hebbard Added handling of matrixType request constraint, for PAFM
* 06/24/2014 1009 kbugenhagen Reload framedata if no stations found * 06/24/2014 1009 kbugenhagen Reload framedata if no stations found
* 07/08/2014 TTR1028 B. Hebbard Modified paintFrame() to return right away if prog disc in progress, instead of
* allowing multiple PD/HDF5/image trains to run concurrently for the same frame
* in case of pan/zoom continuing after PD launched. Improves performance and
* reduces 'trickling in' of stations after pan/zoom. Also changed resourceAttrsModified()
* to remove all stations' met parameter data if requeryDataAndReCreateAllStnImages true,
* to force re-query (now that we're bypassing stations that already have data).
* </pre> * </pre>
* *
* @author brockwoo * @author brockwoo
@ -995,6 +1001,13 @@ public class NcPlotResource2 extends
return; return;
FrameData frameData = (FrameData) fd; FrameData frameData = (FrameData) fd;
if (frameData.progressiveDisclosureInProgress) {
Tracer.print("Progressive disclosure in progress...aborting paintFrame for "
+ frameData.getShortFrameTime());
return;
}
Semaphore sem = new Semaphore(1); Semaphore sem = new Semaphore(1);
if (progressiveDisclosure == null) { if (progressiveDisclosure == null) {
progressiveDisclosure = new ProgressiveDisclosure(this, spi);// assumes progressiveDisclosure = new ProgressiveDisclosure(this, spi);// assumes
@ -1420,6 +1433,19 @@ public class NcPlotResource2 extends
dataRequestor.imageCreator dataRequestor.imageCreator
.setUpPlotPositionToPlotModelElementMapping(editedPlotModel); .setUpPlotPositionToPlotModelElementMapping(editedPlotModel);
// Remove all met param data from all stations in all frames.
// (Since we need to requery all of it anyway, this will force
// that to occur.
// TODO: factor this out to something like clearImages() ?)
for (AbstractFrameData afd : frameDataMap.values()) {
// TODO sanity check type?
FrameData fd = (FrameData) afd;
for (Station station : fd.stationMap.values()) {
station.listOfParamsToPlot.clear();
}
}
/* To remove the obsolete strings from the diff maps */ /* To remove the obsolete strings from the diff maps */
synchronized (newPMEList) { synchronized (newPMEList) {
for (PlotModelElement newPME : newPMEList) { for (PlotModelElement newPME : newPMEList) {

View file

@ -29,6 +29,7 @@ package gov.noaa.nws.ncep.viz.rsc.plotdata.rsc;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Dec 16, 2013 bhebbard Initial creation * Dec 16, 2013 bhebbard Initial creation
* Jul 07, 2014 bhebbard Assorted updates
* *
* </pre> * </pre>
* *
@ -45,14 +46,17 @@ import java.lang.reflect.Method;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.HashSet;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
public class Tracer { public class Tracer {
// ACTIVATE HERE ------------------v
private static boolean enabled = false; private static boolean enabled = false;
// save it static to have it available on every call // save it static to have it available on every call
@ -65,7 +69,7 @@ public class Tracer {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
String logFileName = "/export/cdbsrv/bhebbard/pointdatadisplay/" String logFileName = "" // optional custom directory
+ dateFormat.format(cal.getTime()); + dateFormat.format(cal.getTime());
private static PrintWriter writer = null; private static PrintWriter writer = null;
@ -145,34 +149,35 @@ public class Tracer {
// NcPlotResource2.FrameData.getShortFrameTime(), somehow // NcPlotResource2.FrameData.getShortFrameTime(), somehow
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
Date frameDate = dt.getRefTime(); Date frameDate = dt.getRefTime();
int date = frameDate.getDate();
int hours = frameDate.getHours();
hours += 4; // TODO use actual current local time offset from UTC
if (hours > 23) {
date += 1; // TODO: eom condition
hours -= 24;
}
int minutes = frameDate.getMinutes();
DecimalFormat df = new DecimalFormat("00"); DecimalFormat df = new DecimalFormat("00");
String returnString = Integer.toString(frameDate.getDate()) + "/" String returnString = Integer.toString(date) + "/" + df.format(hours)
+ df.format(frameDate.getHours() + 4) // TODOhorror!! + df.format(minutes);
+ df.format(frameDate.getMinutes());
if (dt.getFcstTime() != 0) { if (dt.getFcstTime() != 0) {
returnString += "(" + dt.getFcstTime() + ")"; returnString += "(" + dt.getFcstTime() + ")";
} }
return returnString; return returnString;
} }
public static boolean sanityCheckStationSet( public static String printableStationList(Collection<Station> stations) {
Collection<Station> stationsWithData) { String returnString = "";
for (Station s : stationsWithData) { for (Station s : stations) {
if (s.info.stationId.equals("KJFK")) { if (s != null && s.info != null) {
String timeString = Tracer.shortTimeString(s.info.dataTime); returnString += s.info.stationId + " ";
if (s.listOfParamsToPlot == null)
print("KJFK in frame " + timeString
+ " has NULL listOfParamsToPlot");
else if (s.listOfParamsToPlot.isEmpty()) {
print("KJFK in frame " + timeString
+ " has EMPTY listOf ParamsToPlot !!!");
return false;
} else {
print("KJFK in frame " + timeString
+ " has FULL listOf ParamsToPlot!");
} }
} }
return returnString;
} }
return true;
public static String printableStationList(Station[] stations) {
return printableStationList(new HashSet<Station>(
Arrays.asList(stations)));
} }
} }

View file

@ -1,31 +1,27 @@
package gov.noaa.nws.ncep.viz.rsc.wavesat.rsc; package gov.noaa.nws.ncep.viz.rsc.wavesat.rsc;
import org.eclipse.swt.SWT; import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.geotools.referencing.wkt.Symbols;
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData; import gov.noaa.nws.ncep.viz.resources.INatlCntrsResourceData;
import gov.noaa.nws.ncep.viz.resources.attributes.AbstractEditResourceAttrsDialog; import gov.noaa.nws.ncep.viz.resources.attributes.AbstractEditResourceAttrsDialog;
import gov.noaa.nws.ncep.viz.resources.attributes.ResourceAttrSet.RscAttrValue; import gov.noaa.nws.ncep.viz.resources.attributes.ResourceAttrSet.RscAttrValue;
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarEditor; import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarEditor;
import gov.noaa.nws.ncep.viz.ui.display.ColorBar; import gov.noaa.nws.ncep.viz.ui.display.ColorBar;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorButtonSelector;
import gov.noaa.nws.ncep.viz.common.ui.color.ColorMatrixSelector; import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
/** /**
* A Dialog to edit SGWH resource attributes. * A Dialog to edit SGWH resource attributes.
@ -36,6 +32,7 @@ import gov.noaa.nws.ncep.viz.common.ui.color.ColorMatrixSelector;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 09/25/11 #248 Greg Hull Initial Creation. * 09/25/11 #248 Greg Hull Initial Creation.
* 07/01/14 TTR 1018 Steve Russell Updated call to ColorBarEditor
* *
* </pre> * </pre>
* *
@ -50,18 +47,22 @@ public class EditWaveSatAttrsDialog extends AbstractEditResourceAttrsDialog {
} }
private RscAttrValue colorBarAttr = null; private RscAttrValue colorBarAttr = null;
private RscAttrValue fontNameAttr = null; private RscAttrValue fontNameAttr = null;
private RscAttrValue fontSizeAttr = null; private RscAttrValue fontSizeAttr = null;
private RscAttrValue timeDisplayIntervalAttr = null; private RscAttrValue timeDisplayIntervalAttr = null;
private RscAttrValue timeDisplayColorAttr = null; private RscAttrValue timeDisplayColorAttr = null;
private String[] availFonts = { "Times", "Serif", "Sans", "Utopia", "Roman", "Courier" }; private String[] availFonts = { "Times", "Serif", "Sans", "Utopia", "Roman", "Courier" };
private String[] availFontsSizes = { "6", "10", "12", "14", "16", "18", "20", "24", "28" }; private String[] availFontsSizes = { "6", "10", "12", "14", "16", "18", "20", "24", "28" };
private String[] availTimeIntStrs = { "10 Mins", "20 Mins", "30 Mins", "45 Mins",
"1 Hour", "1 1/2 Hours", "2 Hours", private String[] availTimeIntStrs = { "10 Mins", "20 Mins", "30 Mins", "45 Mins", "1 Hour", "1 1/2 Hours", "2 Hours", "3 Hours", "6 Hours", "12 Hours", "24 Hours" };
"3 Hours", "6 Hours", "12 Hours", "24 Hours" };
private Integer[] availTimeIntMins = { 10, 20, 30, 45, 60, 90, private Integer[] availTimeIntMins = { 10, 20, 30, 45, 60, 90, 120, 180, 360, 720, 1440 };
120, 180, 360, 720, 1440 };
private ColorBarEditor colorBarEditor = null; private ColorBarEditor colorBarEditor = null;
@ -157,8 +158,7 @@ public class EditWaveSatAttrsDialog extends AbstractEditResourceAttrsDialog {
fontSizeCombo.select(0); fontSizeCombo.select(0);
for (int i = 0; i < availFontsSizes.length; i++) { for (int i = 0; i < availFontsSizes.length; i++) {
if( Integer.parseInt( availFontsSizes[i] ) == if (Integer.parseInt(availFontsSizes[i]) == (Integer) fontSizeAttr.getAttrValue()) {
(Integer)fontSizeAttr.getAttrValue() ) {
fontSizeCombo.select(i); fontSizeCombo.select(i);
break; break;
} }
@ -180,7 +180,6 @@ public class EditWaveSatAttrsDialog extends AbstractEditResourceAttrsDialog {
} }
}); });
Group selTimeStampGrp = new Group(topComp, SWT.BORDER); Group selTimeStampGrp = new Group(topComp, SWT.BORDER);
fd = new FormData(); fd = new FormData();
selTimeStampGrp.setText("Time Stamp"); selTimeStampGrp.setText("Time Stamp");
@ -204,8 +203,7 @@ public class EditWaveSatAttrsDialog extends AbstractEditResourceAttrsDialog {
timeStampIntCombo.setItems(availTimeIntStrs); timeStampIntCombo.setItems(availTimeIntStrs);
for (int t = 0; t < availTimeIntMins.length; t++) { for (int t = 0; t < availTimeIntMins.length; t++) {
if( availTimeIntMins[t].equals( if (availTimeIntMins[t].equals((Integer) timeDisplayIntervalAttr.getAttrValue())) {
(Integer)timeDisplayIntervalAttr.getAttrValue()) ) {
timeStampIntCombo.select(t); timeStampIntCombo.select(t);
break; break;
} }
@ -235,8 +233,7 @@ public class EditWaveSatAttrsDialog extends AbstractEditResourceAttrsDialog {
selColComp.setLayoutData(fd); selColComp.setLayoutData(fd);
selColComp.setLayout(new GridLayout()); selColComp.setLayout(new GridLayout());
final ColorButtonSelector colBtnSel = new ColorButtonSelector( final ColorButtonSelector colBtnSel = new ColorButtonSelector(selColComp, 60, 30);
selColComp, 60,30 );
colBtnSel.setColorValue((RGB) timeDisplayColorAttr.getAttrValue()); colBtnSel.setColorValue((RGB) timeDisplayColorAttr.getAttrValue());
colBtnSel.addListener(new IPropertyChangeListener() { colBtnSel.addListener(new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) { public void propertyChange(PropertyChangeEvent event) {
@ -259,7 +256,7 @@ public class EditWaveSatAttrsDialog extends AbstractEditResourceAttrsDialog {
editedColorBar = (ColorBar) colorBarAttr.getAttrValue(); editedColorBar = (ColorBar) colorBarAttr.getAttrValue();
colorBarEditor = new ColorBarEditor( colorBarGrp, editedColorBar ); colorBarEditor = new ColorBarEditor(colorBarGrp, editedColorBar, true);
return topComp; return topComp;
} }
@ -275,4 +272,3 @@ public class EditWaveSatAttrsDialog extends AbstractEditResourceAttrsDialog {
colorBarEditor.dispose(); colorBarEditor.dispose();
} }
} }