Merge branch 'asm_16.1.1' of ssh://10.201.30.8:29418/AWIPS2_baseline into master_16.1.1

Former-commit-id: 19aefb32d4243a30511b9d5de557c51adf689d2d
This commit is contained in:
Shawn.Hooper 2015-10-13 16:21:51 -04:00
commit becd5935a5
14 changed files with 979 additions and 176 deletions

View file

@ -120,7 +120,7 @@ public class ElevationInfo {
private ArrayList<VCPInfo> vcpInfo = new ArrayList<VCPInfo>();
private HashMap<Sel, int[]> staticInfo = new HashMap<Sel, int[]>();
public ElevationInfo() {
/*package*/ ElevationInfo() {
Scanner fs;
InputStream s;

View file

@ -95,7 +95,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Aug 25, 2014 3467 mapeters Removed changing of editability from swapPanes().
* Mar 02, 2015 4204 njensen Support for swapping part names
* Apr 02, 2015 4204 njensen Fix 4-panel swap of renamed parts
* Sep 18, 2015 DR 17996 D. Friedman Clear editor pane's renderable display before swap
* Sep 18, 2015 DR 17996 D. Friedman Clear editor pane's IRenderableDisplay before swap
*
* </pre>
*
@ -389,6 +389,11 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
int viewPaneCount = viewPanes.length;
try {
boolean isCompatibleEditor = theEditor
.getSite()
.getId()
.equals(DescriptorMap.getEditorId(myRenderables[0]
.getDescriptor().getClass().getName()));
// I have my renderables saved off, load editor renderables
// to me first
if (viewPaneCount > editorPaneCount) {
@ -399,7 +404,15 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
for (int i = 0; i < editorPaneCount; ++i) {
IRenderableDisplay display = editorPanes[i]
.getRenderableDisplay();
editorPanes[i].setRenderableDisplay(null);
/*
* TODO: This condition is currently needed because the
* NSHARP input handlers incorrectly retain references
* to VizDisplayPane instances. Should do this
* unconditionally when that is fixed.
*/
if (isCompatibleEditor) {
editorPanes[i].setRenderableDisplay(null);
}
viewPanes[i].setRenderableDisplay(display);
if (editorHiddenDisplays.contains(editorPanes[i]
.getRenderableDisplay()) == false
@ -412,7 +425,10 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
IRenderableDisplay display = editorPanes[i]
.getRenderableDisplay();
boolean hide = editorHiddenDisplays.contains(display);
editorPanes[i].setRenderableDisplay(null);
// TODO: See note above for the isCompatibleEditor condition.
if (isCompatibleEditor) {
editorPanes[i].setRenderableDisplay(null);
}
if (i < viewPaneCount) {
viewPanes[i].setRenderableDisplay(display);
if (hide) {
@ -429,11 +445,7 @@ public class SideView extends ViewPart implements IMultiPaneEditor,
}
}
if (theEditor
.getSite()
.getId()
.equals(DescriptorMap.getEditorId(myRenderables[0]
.getDescriptor().getClass().getName()))) {
if (isCompatibleEditor) {
// swap loop properties
LoopProperties editorLoopProperties = theEditor

View file

@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.viz.cwat;bundle-version="1.11.17",
com.raytheon.uf.common.dataplugin.cwat;bundle-version="1.11.17",
com.raytheon.uf.common.dataplugin.scan;bundle-version="1.12.1112",
com.raytheon.rcm.lib;bundle-version="1.12.1174"
com.raytheon.rcm.lib;bundle-version="1.12.1174",
com.raytheon.uf.viz.radarapps.core;bundle-version="1.15.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.viz.monitor.scan,

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
import com.raytheon.uf.common.monitor.scan.xml.SCANAttributesXML;
import com.raytheon.uf.viz.monitor.scan.TrendGraphData;
import com.raytheon.uf.viz.monitor.scan.config.SCANConfig;
import com.raytheon.uf.viz.radarapps.core.RadarApps;
/**
*
@ -398,7 +399,7 @@ public class TrendGraphCanvas {
scanTable, "rng", ident);
LinkedHashMap<Date, Double> rngDateMap = tgd.getGraphData();
ElevationInfo eleInfo = new ElevationInfo();
ElevationInfo eleInfo = RadarApps.getElevationInfo();
int[] elevationAngles = eleInfo.getScanElevations(null, vcp);
if (elevationAngles == null)
return;

View file

@ -33,6 +33,7 @@ import com.raytheon.rcm.config.RadarType;
import com.raytheon.rcm.config.RcmUtil;
import com.raytheon.rcm.mqsrvr.ReplyObj.ConfigReply;
import com.raytheon.rcm.mqsrvr.ReqObj;
import com.raytheon.rcm.products.ElevationInfo;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
import com.raytheon.uf.viz.core.exception.VizException;
@ -134,4 +135,12 @@ public class RadarApps {
return null;
}
/** Obtains an ElevationInfo instance.
* <p>
* Using this method ensures RcmResourceProvider has been set up correctly.
*/
public static ElevationInfo getElevationInfo() {
return ElevationInfo.getInstance();
}
}

View file

@ -73,6 +73,7 @@ import com.raytheon.viz.gfe.smarttool.script.SmartToolController;
* 02/20/2013 #1597 randerso Added logging to support GFE Performance metrics
* 04/10/2013 16028 ryu Check for null seTime in execute()
* 07/07/2015 14739 ryu Modified execute() to return with updated varDict.
* 10/08/2015 18125 bhunder Modified CANCEL_MSG_START to work with Jep updates
*
* </pre>
*
@ -87,7 +88,7 @@ public class Tool {
private final IPerformanceStatusHandler perfLog = PerformanceStatus
.getHandler("GFE:");
private static final String CANCEL_MSG_START = "jep.JepException: <type 'exceptions.RuntimeError'>: Cancel: Cancel >>>";
private static final String CANCEL_MSG_START = "jep.JepException: <type 'exceptions.RuntimeError'>: Cancel: Cancel";
private final IParmManager parmMgr;

View file

@ -80,7 +80,9 @@ import com.raytheon.viz.hydrocommon.util.HydroDialogStatus;
* Jan 27, 2011 #5274 bkowal Using the swt job class to request data
* asynchronously and display a progress
* indicator on the main interface.
* Feb 11, 2014 #15829 lbousaidi check for Missing before processing River Threat.
* Feb 11, 2014 #15829 lbousaidi check for Missing before processing River Threat.
* Oct 05, 2015 #17978 lbousaidi updated addStationEntry() to use StationEntryDetails.getPeDTsE()
*
* </pre>
*
* @author mpduff
@ -1079,7 +1081,7 @@ public class PointDataControlManager extends Job {
* the StationEntryDetails object to add
*/
public void addStationEntry(StationEntryDetails sed) {
stationEntryMap.put(sed.getLid(), sed);
stationEntryMap.put(sed.getPeDTsE(), sed);
}
/**

View file

@ -31,6 +31,7 @@ import java.util.Calendar;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 4, 2009 mpduff Initial creation
* Oct 05, 015 17978 lbousaidi added getPeDTsE()
*
* </pre>
*
@ -422,5 +423,18 @@ public class StationEntryDetails {
return sb.toString();
}
/**
* Get the ingest filter table primary key value for this data object.
*
* @return The primary key object
*/
public String getPeDTsE() {
StringBuilder sb = new StringBuilder();
sb.append(this.lid);
sb.append(this.pe);
sb.append(this.ts);
return sb.toString();
}
}

View file

@ -28,6 +28,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TimeZone;
import javax.measure.unit.NonSI;
@ -89,6 +90,7 @@ import com.raytheon.viz.hydrocommon.HydroDisplayManager;
import com.raytheon.viz.hydrocommon.colorscalemgr.HydroColorManager;
import com.raytheon.viz.hydrocommon.data.GageData;
import com.raytheon.viz.hydrocommon.data.GageData.ThreatIndex;
import com.raytheon.viz.hydrocommon.data.GageDataTimeStep;
import com.raytheon.viz.hydrocommon.data.RiverStat;
import com.raytheon.viz.hydrocommon.pdc.PDCOptionData;
import com.raytheon.viz.hydrocommon.whfslib.colorthreshold.ColorThreshold;
@ -133,6 +135,7 @@ import com.vividsolutions.jts.index.strtree.STRtree;
* Apr 09, 2015 4215 mpduff Check strTree before removing items.
* Jun 26, 2015 17386 xwei Fixed : HydroView crashes in when Refresh Data after loading saved display files
* Jul 06, 2015 4215 mpduff Correct the fact that user's cannot click and view time series.
* Oct 05, 2015 17978 lbousaidi Enable TimeStep GUI to display multiple values and Parameter Codes for a given lid
*
* </pre>
*
@ -218,7 +221,11 @@ public class MultiPointResource extends
private final Map<String, GageData> dataMap = new HashMap<String, GageData>();
private final Map<String, GageDataTimeStep> dataMapTimeStep = new HashMap<String, GageDataTimeStep>();
private STRtree strTree = new STRtree();
private STRtree strTreeTimeStep = new STRtree();
private IFont font;
@ -332,18 +339,45 @@ public class MultiPointResource extends
for (GageData gage : data) {
/* Get the point color for this location */
if ((gage.getLid() != null) && gage.isUse()) {
addPoint(gage);
if ( pcOptions.getQueryMode() == 1 ){
addPointTimeStep(gage);
}else{
addPoint(gage);
}
}
}
}
}
/**
* Add a point to this resource.
* Add a point to this resource in TimeStep Mode.
*
* @param gage
* GageData object
*/
*/
private synchronized void addPointTimeStep(GageData gage) {
String lid = gage.getLid();
if ( !dataMapTimeStep.containsKey(lid) ) {
Coordinate xy = new Coordinate(gage.getLon(), gage.getLat());
gage.setCoordinate(xy);
/* Create a small envelope around the point */
PixelExtent pe = getPixelExtent( gage, getShiftWidth(gage), getShiftHeight(gage) );
Envelope newEnv = descriptor.pixelToWorld( pe );
GageDataTimeStep newGageTS = new GageDataTimeStep( gage );
strTree.insert(newEnv, newGageTS);
dataMapTimeStep.put(lid, newGageTS);
} else{
dataMapTimeStep.get(lid).Update(gage);
}
}
private synchronized void addPoint(GageData gage) {
String lid = gage.getLid();
GageData existing = dataMap.get(lid);
@ -422,6 +456,216 @@ public class MultiPointResource extends
return new PixelExtent(coors);
}
/**
* Draws the plot information for TimeStep
*
* @param data
* the gage data obj
* @param shiftWidth
* the shift width coordinate
* @param shiftHeight
* the shift height coordinate
* @param paintProps
* the paint properties
* @param target
* the graphics target
* @throws VizException
*/
private Collection<DrawableString> drawPlotInfoTimeStep(GageDataTimeStep gageTimeStep,
double shiftWidth, double shiftHeight, PaintProperties paintProps,
IGraphicsTarget target) throws VizException {
List<DrawableString> strings = new ArrayList<DrawableString>();
Coordinate c = gageTimeStep.getCoordinate();
/* Logic for determining how the data values are displayed. */
boolean showValue1 = pdcManager.isValue();
double[] centerpixels = descriptor
.worldToPixel(new double[] { c.x, c.y });
if (showValue1) {
String [] valueStrings;
if ( pcOptions.getElementType() == 1 ){
valueStrings = gageTimeStep.getRainValue( pcOptions.getPrecipPeFilter() ).split("\n");
}else{
valueStrings = gageTimeStep.getOtherValue().split("\n");
}
int strSize = valueStrings.length;
RGB[] strColor = new RGB[strSize];
if ( strSize > 0){
for (int i=0; i<strSize; i++){
if (valueStrings[i]!=""){
if ( valueStrings[i].equalsIgnoreCase("M") ){
strColor[i] = RGBColors.getRGBColor("White");
}else{
strColor[i] = getValueLabelColorTimeStep( gageTimeStep.getLid(), Double.parseDouble( valueStrings[i] ) );
}
}
}
}
Coordinate valueCoor = new Coordinate(
(centerpixels[0] + shiftWidth) - getScaleWidth(),
(centerpixels[1] + shiftHeight) - getScaleHeight() / 2);
/*
* If in timestep mode and icon drawing off, draw a circle
* matching the color of the text
*/
if (pcOptions.getIcon() == 0) {
Coordinate cd = gageTimeStep.getCoordinate();
centerpixels = descriptor.worldToPixel(new double[] { cd.x,
cd.y });
Coordinate[] coors = new Coordinate[4];
coors[0] = new Coordinate((centerpixels[0] + shiftWidth)
- getScaleWidth(), (centerpixels[1] + shiftHeight)
- getScaleHeight());
coors[1] = new Coordinate((centerpixels[0] + shiftWidth)
+ getScaleWidth(), (centerpixels[1] + shiftHeight)
- getScaleHeight());
coors[2] = new Coordinate((centerpixels[0] + shiftWidth)
+ getScaleWidth(), (centerpixels[1] + shiftHeight)
+ getScaleHeight());
coors[3] = new Coordinate((centerpixels[0] + shiftWidth)
- getScaleWidth(), (centerpixels[1] + shiftHeight)
+ getScaleHeight());
PixelExtent pe = new PixelExtent(coors);
pe.scale(.07);
target.drawShadedRect(pe, RGBColors.getRGBColor("White"), 1, null);
}
DrawableString string = new DrawableString(valueStrings, strColor);
string.font = font;
string.horizontalAlignment = HorizontalAlignment.RIGHT;
string.setCoordinates(valueCoor.x, valueCoor.y);
strings.add(string);
}
if (pdcManager.isTime()) {
Coordinate dateCoor1 = new Coordinate(
(centerpixels[0] + shiftWidth) + getScaleWidth(),
(centerpixels[1] + shiftHeight) - getScaleHeight() / 0.9);
Coordinate dateCoor2 = new Coordinate(
(centerpixels[0] + shiftWidth) + getScaleWidth(),
centerpixels[1] + shiftHeight + getScaleHeight() / -2);
// draw the date and time
DrawableString string = new DrawableString(sdf1.format(gageTimeStep
.getValidtime().getTime()), LABEL_COLOR);
string.font = font;
string.setCoordinates(dateCoor1.x, dateCoor1.y);
strings.add(string);
string = new DrawableString(sdf2.format(gageTimeStep.getValidtime()
.getTime()), LABEL_COLOR);
string.font = font;
string.setCoordinates(dateCoor2.x, dateCoor2.y);
strings.add(string);
}
// draw the ID
if (pdcManager.isID()) {
Coordinate idCoor = new Coordinate(centerpixels[0] + shiftWidth
- getScaleWidth(), centerpixels[1] + shiftHeight
+ getScaleHeight());
DrawableString string = new DrawableString(gageTimeStep.getLid(),
LABEL_COLOR);
string.font = font;
string.horizontalAlignment = HorizontalAlignment.RIGHT;
string.setCoordinates(idCoor.x, idCoor.y);
strings.add(string);
}
if (pdcManager.isName()) {
// draw the Name
Coordinate nameCoor = new Coordinate(centerpixels[0] + shiftWidth
+ getScaleWidth(), centerpixels[1] + shiftHeight
+ getScaleHeight());
DrawableString string = new DrawableString(gageTimeStep.getName(),
LABEL_COLOR);
string.font = font;
string.setCoordinates(nameCoor.x, nameCoor.y);
strings.add(string);
}
if (pdcManager.isPE()) {
String pe = "";
if ( pcOptions.getElementType() == 1 ){
pe = gageTimeStep.getRainParam(pcOptions.getPrecipPeFilter());
}else{
pe = gageTimeStep.getOtherParam();
}
Coordinate peCoor = new Coordinate(centerpixels[0] + shiftWidth
+ getScaleWidth(), centerpixels[1] + shiftHeight
- getScaleHeight() / 2);
DrawableString string = new DrawableString(pe, LABEL_COLOR);
string.font = font;
string.setCoordinates(peCoor.x, peCoor.y);
strings.add(string);
}
if (pdcManager.isElevation()) {
// draw the elevation
Coordinate elCoor = new Coordinate(centerpixels[0] + shiftWidth
+ getScaleWidth(), centerpixels[1] + shiftHeight
- getScaleHeight() / 2);
DrawableString string = new DrawableString(df.format(gageTimeStep.getElevation()), LABEL_COLOR);
string.font = font;
string.setCoordinates(elCoor.x, elCoor.y);
strings.add(string);
}
return strings;
}
/**
* Gets the color for value label in TimeStep mode
*
* @param plid lid string
*
* @param pValue value
*
* @throws VizException
*/
private RGB getValueLabelColorTimeStep( String pLid, double pValue ){
RGB textColor = RGBColors.getRGBColor("White");
if ((pcOptions.getTsDataElement() == HydroConstants.TimeStepDataElement.STAGE_POOL_TSDE
.getElementType())
|| (pcOptions.getTsDataElement() == HydroConstants.TimeStepDataElement.FLOW_STORAGE_TSDE
.getElementType())) {
textColor = getRiverValueColorForTimeStepMode( pLid, pValue );
} else {
// textColor = new RGB(255, 255, 255);
textColor = determineValueColor( pValue );
}
return textColor;
}
/**
* Draws the plot information
*
@ -446,19 +690,11 @@ public class MultiPointResource extends
int floodLevel = pcOptions.getFloodLevel();
int deriveStageFlow = pcOptions.getDeriveStageFlow();
boolean isTimeStepMode = false;
String valueLabel = null;
String formatStr = null;
int queryMode = pcOptions.getQueryMode();
if (queryMode == 1) {
// TimeStep Mode
isTimeStepMode = true;
}
formatStr = getDataFormat(gage.getPe());
formatStr = GageData.getDataFormat(gage.getPe());
/* Logic for determining how the data values are displayed. */
boolean showValue1 = pdcManager.isValue();
@ -470,11 +706,7 @@ public class MultiPointResource extends
&& (pcOptions.getElementType() == HydroConstants.AdHocDataElementType.RIVER_AD_HOC_TYPE
.getAdHocDataElementType())) {
showValue2 = true;
if (pcOptions.getQueryMode() == PDCConstants.QueryMode.TIME_STEP_MODE
.getQueryMode()) {
// never show value2 in TimeStep Mode
showValue2 = false;
}
}
}
@ -493,49 +725,8 @@ public class MultiPointResource extends
(centerpixels[0] + shiftWidth) - getScaleWidth(),
(centerpixels[1] + shiftHeight) - getScaleHeight() / 2);
// Color text based on value and thresholds
if (isTimeStepMode) {
if ((pcOptions.getTsDataElement() == HydroConstants.TimeStepDataElement.STAGE_POOL_TSDE
.getElementType())
|| (pcOptions.getTsDataElement() == HydroConstants.TimeStepDataElement.FLOW_STORAGE_TSDE
.getElementType())) {
textColor = getRiverValueColorForTimeStepMode(gage);
} else {
// textColor = new RGB(255, 255, 255);
textColor = determineValueColor(gage.getValue());
}
/*
* If in timestep mode and icon drawing off, draw a circle
* matching the color of the text
*/
if (pcOptions.getIcon() == 0) {
Coordinate cd = gage.getCoordinate();
centerpixels = descriptor.worldToPixel(new double[] { cd.x,
cd.y });
Coordinate[] coors = new Coordinate[4];
coors[0] = new Coordinate((centerpixels[0] + shiftWidth)
- getScaleWidth(), (centerpixels[1] + shiftHeight)
- getScaleHeight());
coors[1] = new Coordinate((centerpixels[0] + shiftWidth)
+ getScaleWidth(), (centerpixels[1] + shiftHeight)
- getScaleHeight());
coors[2] = new Coordinate((centerpixels[0] + shiftWidth)
+ getScaleWidth(), (centerpixels[1] + shiftHeight)
+ getScaleHeight());
coors[3] = new Coordinate((centerpixels[0] + shiftWidth)
- getScaleWidth(), (centerpixels[1] + shiftHeight)
+ getScaleHeight());
PixelExtent pe = new PixelExtent(coors);
pe.scale(.4);
target.drawShadedRect(pe, textColor, 1, null);
}
} else { // in AD_HOC_MODE, color the text labelColor
textColor = RGBColors.getRGBColor("white");
}
textColor = RGBColors.getRGBColor("white");
DrawableString string = new DrawableString(valueLabel, textColor);
string.font = font;
string.horizontalAlignment = HorizontalAlignment.RIGHT;
@ -789,53 +980,16 @@ public class MultiPointResource extends
pdcManager.setColorUseName(colorUseName);
pdcManager.setMultiPointResource(this);
setScaleValues(paintProps);
IExtent extent = paintProps.getView().getExtent();
List<GageData> data = pdcManager.getObsReportList();
resetDataMap();
if (data != null) {
List<PointImage> images = new ArrayList<PointImage>(data.size());
List<DrawableString> strings = new ArrayList<DrawableString>(
data.size() * 3);
for (GageData gage : data) {
/* Get the point color for this location */
if ((gage.getLid() != null) && gage.isUse()) {
addPoint(gage);
Coordinate c = gage.getCoordinate();
double[] pixel = descriptor.worldToPixel(new double[] {
c.x, c.y });
if (pixel != null && extent.contains(pixel)) {
double shiftHeightValue = getShiftHeight(gage);
double shiftWidthValue = getShiftWidth(gage);
/* Draw the icons */
if (pcOptions.getIcon() == 1) {
RGB color = null;
if (pcOptions.getRiverStatus() == 1) {
color = gage.getColor();
} else {
color = RGBColors.getRGBColor(colorSet.get(0)
.getColorname().getColorName());
}
PointImage image = new PointImage(getIcon(target,
gage, color), pixel[0], pixel[1]);
image.setSiteId(gage.getLid());
images.add(image);
}
strings.addAll(drawPlotInfo(gage, shiftWidthValue,
shiftHeightValue, paintProps, target));
}
}
}
if (images.size() > 0) {
target.getExtension(IPointImageExtension.class)
.drawPointImages(paintProps, images);
}
if (strings.size() > 0) {
target.drawStrings(strings);
}
}
if ( pcOptions.getQueryMode() == 1 ){
paintInternalHelperTimeStep( target, paintProps );
}else{
paintInternalHelper( target, paintProps );
}
GageData currentData = manager.getCurrentData();
if (currentData != null) {
List<GageData> siteList = pdcManager.getObsReportList();
@ -850,7 +1004,141 @@ public class MultiPointResource extends
}
}
/**
* Paint method called to display this resource in TimeStep mode.
*
* @param target
* The IGraphicsTarget
* @param paintProps
* The Paint Properties
* @throws VizException
*/
private void paintInternalHelperTimeStep(IGraphicsTarget target, PaintProperties paintProps) throws VizException {
List<GageData> data = pdcManager.getObsReportList();
if (data == null) {
return;
}
for (GageData gage : data) {
/* Get the point color for this location */
if ((gage.getLid() != null) && gage.isUse()) {
addPointTimeStep(gage);
}
}
IExtent extent = paintProps.getView().getExtent();
List<PointImage> images = new ArrayList<PointImage>( dataMapTimeStep.size() );
List<DrawableString> strings = new ArrayList<DrawableString>( dataMapTimeStep.size() * 3 );
Iterator<Entry<String, GageDataTimeStep>> it = dataMapTimeStep.entrySet().iterator();
Map.Entry<String, GageDataTimeStep> gageTS = null;
while ( it.hasNext() ) {
gageTS = it.next();
Coordinate c = gageTS.getValue().getCoordinate();
double[] pixel = descriptor.worldToPixel(new double[] { c.x, c.y });
if (pixel != null && extent.contains(pixel)) {
double shiftHeightValue = getShiftHeight(gageTS.getValue());
double shiftWidthValue = getShiftWidth(gageTS.getValue());
/* Draw the icons */
if (pcOptions.getIcon() == 1) {
RGB color = null;
if (pcOptions.getRiverStatus() == 1) {
color = gageTS.getValue().getColor();
} else {
color = RGBColors.getRGBColor(colorSet.get(0)
.getColorname().getColorName());
}
PointImage image = new PointImage(
getIcon(target, gageTS.getValue(), color), pixel[0], pixel[1]
);
image.setSiteId(gageTS.getValue().getLid());
images.add(image);
}
strings.addAll( drawPlotInfoTimeStep( gageTS.getValue(), shiftWidthValue, shiftHeightValue, paintProps, target ) );
}
}
if (images.size() > 0) {
target.getExtension(IPointImageExtension.class)
.drawPointImages(paintProps, images);
}
if (strings.size() > 0) {
target.drawStrings(strings);
}
}
/**
* Paint method called to display this resource.
*
* @param target
* The IGraphicsTarget
* @param paintProps
* The Paint Properties
* @throws VizException
*/
private void paintInternalHelper(IGraphicsTarget target, PaintProperties paintProps) throws VizException {
List<GageData> data = pdcManager.getObsReportList();
if (data == null) {
return;
}
IExtent extent = paintProps.getView().getExtent();
List<PointImage> images = new ArrayList<PointImage>( data.size() );
List<DrawableString> strings = new ArrayList<DrawableString>( data.size() * 3 );
for (GageData gage : data) {
/* Get the point color for this location */
if ((gage.getLid() != null) && gage.isUse()) {
addPoint(gage);
Coordinate c = gage.getCoordinate();
double[] pixel = descriptor.worldToPixel(new double[] { c.x, c.y });
if (pixel != null && extent.contains(pixel)) {
double shiftHeightValue = getShiftHeight(gage);
double shiftWidthValue = getShiftWidth(gage);
/* Draw the icons */
if (pcOptions.getIcon() == 1) {
RGB color = null;
if (pcOptions.getRiverStatus() == 1) {
color = gage.getColor();
} else {
color = RGBColors.getRGBColor(colorSet.get(0)
.getColorname().getColorName());
}
PointImage image = new PointImage(getIcon(target,
gage, color), pixel[0], pixel[1]);
image.setSiteId(gage.getLid());
images.add(image);
}
strings.addAll( drawPlotInfo(gage, shiftWidthValue, shiftHeightValue, paintProps, target) );
}
}
}
if (images.size() > 0) {
target.getExtension(IPointImageExtension.class)
.drawPointImages(paintProps, images);
}
if (strings.size() > 0) {
target.drawStrings(strings);
}
}
/**
* Set the selected coordinate
*
@ -941,49 +1229,9 @@ public class MultiPointResource extends
}
return null;
}
private String getDataFormat(String pe) {
String format = "6.2f";
if (pe.toUpperCase().startsWith("H")) {
/* Height data */
format = "%6.2f";
} else if (pe.toUpperCase().startsWith("P")) {
/* Precip/Pressure data */
format = "%6.2f";
} else if (pe.toUpperCase().startsWith("T")) {
/* Temperature data */
format = "%6.0f";
} else if (pe.toUpperCase().startsWith("S")) {
/* Snow data */
if (pe.equalsIgnoreCase("SL")) {
format = "%6.2f";
} else {
format = "%6.1f";
}
} else if (pe.toUpperCase().startsWith("U")) {
/* Wind data */
if (pe.equalsIgnoreCase("UQ")) {
format = "%8.4f";
} else {
format = "%6.0f";
}
} else if (pe.toUpperCase().startsWith("X")) {
/* Weather data */
format = "%5.0f";
} else if (pe.toUpperCase().startsWith("Q")) {
/* Flow/Runoff data */
if (!pe.equalsIgnoreCase("QB")) {
format = "%6.0f";
} else {
format = "%6.2f";
}
}
return format;
}
private RGB getRiverValueColorForTimeStepMode(GageData gage) {
private RGB getRiverValueColorForTimeStepMode( String pLid, double pValue ) {
RGB color = null;
String threatIndex = ThreatIndex.THREAT_MISSING_DATA.getThreatIndex();
@ -991,7 +1239,7 @@ public class MultiPointResource extends
double floodLevel = PDCConstants.MISSING_VALUE;
/* Get the river status object for this lid */
RiverStat riverStat = dataManager.getRiverStatus(gage.getLid());
RiverStat riverStat = dataManager.getRiverStatus(pLid);
int selectedTimeStepElement = pcOptions.getTsDataElement();
@ -1012,12 +1260,12 @@ public class MultiPointResource extends
}
// determine the threat level
if ((gage.getValue()) != PDCConstants.MISSING_VALUE) {
if (( pValue ) != PDCConstants.MISSING_VALUE) {
threatIndex = ThreatIndex.THREAT_MISSING_STAGE.getThreatIndex();
if ((actionLevel != PDCConstants.MISSING_VALUE)
&& (actionLevel != 0)) {
if (gage.getValue() >= actionLevel) {
if ( pValue >= actionLevel) {
threatIndex = ThreatIndex.THREAT_ACTION.getThreatIndex();
} else {
threatIndex = ThreatIndex.THREAT_NONE.getThreatIndex();
@ -1025,7 +1273,7 @@ public class MultiPointResource extends
}
if ((floodLevel != PDCConstants.MISSING_VALUE) && (floodLevel != 0)) {
if (gage.getValue() >= floodLevel) {
if ( pValue >= floodLevel) {
threatIndex = ThreatIndex.THREAT_FLOOD.getThreatIndex();
} else if (actionLevel == PDCConstants.MISSING_VALUE) {
threatIndex = ThreatIndex.THREAT_NONE.getThreatIndex();
@ -1244,10 +1492,19 @@ public class MultiPointResource extends
/**
* Clear the data map.
*/
*/
public void resetDataMap() {
dataMap.clear();
strTree = new STRtree();
if (pcOptions.getQueryMode() == 1){
dataMapTimeStep.clear();
strTreeTimeStep = new STRtree();
}else{
dataMap.clear();
strTree = new STRtree();
}
}
private class TimeSeriesLaunchAction extends AbstractRightClickAction {

View file

@ -42,7 +42,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- --------------------------
* 05Nov2008 --- dhladky Initial Creation
* 14Mar2012 1790 rferrel Fix Comparable to remove eclipse warnings.
*
* 05Oct2015 17978 lbousaidi Added getParamCode(), getShefDurCode(), convertDur(),
* getDataFormat().
* </pre>
*
* @author dhladky
@ -909,7 +910,7 @@ public class GageData implements Comparable<GageData> {
return retVal;
}
/*
/**
* (non-Javadoc)
*
* @see java.lang.Object#toString()
@ -918,4 +919,169 @@ public class GageData implements Comparable<GageData> {
public String toString() {
return this.getLid();
}
/**
* Get Parameter Code
*
* @return String Parameter Code
*
*/
public String getParamCode(){
return getPe() + getShefDurCode()+ getTs() + getExtremum();
}
/**
* Get Shef Duration Code
*
* @return String Shef Duration Code
*
*/
public String getShefDurCode(){
String shefDurCode;
if ( getPe().equalsIgnoreCase("PC") ) {
// PC is always "I", but sometimes the duration might have been
// screwed up
shefDurCode = "I";
} else {
shefDurCode = convertDur((int) getDur());
if (shefDurCode == null) {
shefDurCode = "?";
}
}
return shefDurCode;
}
/**
* Convert duration int to String character.
*
* @param dur
* The duration value
* @return The single character duration value
*/
public static String convertDur(int dur) {
String value = null;
switch (dur) {
case 0:
value = "I";
break;
case 1:
value = "U";
break;
case 5:
value = "E";
break;
case 10:
value = "G";
break;
case 15:
value = "C";
break;
case 30:
value = "J";
break;
case 1001:
value = "H";
break;
case 1002:
value = "B";
break;
case 1003:
value = "T";
break;
case 1004:
value = "F";
break;
case 1006:
value = "Q";
break;
case 1008:
value = "A";
break;
case 1012:
value = "K";
break;
case 1018:
value = "L";
break;
case 2001:
value = "D";
break;
case 2007:
value = "W";
break;
case 3001:
value = "M";
break;
case 4001:
value = "Y";
break;
case 5004:
value = "P";
break;
case 5001:
value = "S";
break;
case 5002:
value = "R";
break;
case 5005:
value = "X";
break;
}
return value;
}
/**
* Get data format
*
* @param pe - element type
*
* @return String - format string
*/
public static String getDataFormat(String pe) {
String format = "6.2f";
if (pe.toUpperCase().startsWith("H")) {
/* Height data */
format = "%6.2f";
} else if (pe.toUpperCase().startsWith("P")) {
/* Precip/Pressure data */
format = "%6.2f";
} else if (pe.toUpperCase().startsWith("T")) {
/* Temperature data */
format = "%6.0f";
} else if (pe.toUpperCase().startsWith("S")) {
/* Snow data */
if (pe.equalsIgnoreCase("SL")) {
format = "%6.2f";
} else {
format = "%6.1f";
}
} else if (pe.toUpperCase().startsWith("U")) {
/* Wind data */
if (pe.equalsIgnoreCase("UQ")) {
format = "%8.4f";
} else {
format = "%6.0f";
}
} else if (pe.toUpperCase().startsWith("X")) {
/* Weather data */
format = "%5.0f";
} else if (pe.toUpperCase().startsWith("Q")) {
/* Flow/Runoff data */
if (!pe.equalsIgnoreCase("QB")) {
format = "%6.0f";
} else {
format = "%6.2f";
}
}
return format;
}
}

View file

@ -0,0 +1,340 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.hydrocommon.data;
/**
* Class for packaging the gage data in TimeStep mode.
*
* <pre>
* SOFTWARE HISTOR
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 14, 2015 17978 lbousaidi Initial Creation
* </pre>
*
* @author lbousaidi
* @version 1.0
*/
public class GageDataTimeStep extends GageData {
private String PP_p = "";
private String PC_p = "";
private String Other_p = "";
private String PP_v = "";
private String PC_v = "";
private String Other_v = "";
/**
* public constructor
*/
public GageDataTimeStep(){
super();
}
/**
* public constructor
*
* @param gage
*/
public GageDataTimeStep( GageData gage ){
setLid(gage.getLid());
setName(gage.getName());
setElevation(gage.getElevation());
setValidtime(gage.getValidtime());
setCoordinate(gage.getCoordinate());
setDispClass(gage.getDispClass());
setValue( gage.getValue() );
setThreatIndex( gage.getThreatIndex() );
setP( gage );
setV( gage );
return;
}
/**
* Update by a gage
*
* @param gage
*/
public void Update( GageData gage ){
if (getValue() < gage.getValue()){
setValue( gage.getValue() );
setThreatIndex(gage.getThreatIndex());
}
addParam( gage );
addValue( gage );
return;
}
/**
* Get both PP and PC Parameter codes
*/
public String getPpAndPcParam() {
return combineString( PP_p, PC_p );
}
/**
* Get both PP and PC Values
*/
public String getPpAndPcValue() {
return combineString( PP_v, PC_v );
}
/**
* Get PP Parameter codes
*/
public String getPpParam( ) {
return PP_p;
}
/**
* Get both PP values
*/
public String getPpValue() {
return PP_v;
}
/**
* Get PC Parameter codes
*/
public String getPcParam( ) {
return PC_p;
}
/**
* Get both PC values
*/
public String getPcValue() {
return PC_v;
}
/**
* Get Parameter codes for rain
*/
public String getRainParam(int a){
if (a == 0){
return getPpAndPcParam();
}
if (a == 1){
return getPcParam();
}
if (a == 2){
return getPpParam();
}
return "";
}
/**
* Get Parameter values for rain
*/
public String getRainValue(int a){
if (a == 0){
return getPpAndPcValue();
}
if (a == 1){
return getPcValue();
}
if (a == 2){
return getPpValue();
}
return "";
}
/**
* Get both Parameter codes for other
*/
public String getOtherParam() {
return Other_p;
}
/**
* Get both values for other
*/
public String getOtherValue() {
return Other_v;
}
/**
* Set Parameter codes
*
* @param gage
*
*/
private void setP( GageData gage ) {
if (gage.getPe().equalsIgnoreCase("PP")){
PP_p = gage.getParamCode();
return;
}
if (gage.getPe().equalsIgnoreCase("PC")){
PC_p = gage.getParamCode();
return;
}
Other_p = gage.getParamCode();
}
/**
* Set values
*
* @param gage
*
*/
private void setV( GageData gage ) {
if (gage.getPe().equalsIgnoreCase("PP")){
PP_v = formatValue(gage);
return;
}
if (gage.getPe().equalsIgnoreCase("PC")){
PC_v = formatValue(gage);
return;
}
Other_v = formatValue(gage);
}
/**
* Add Parameter codes
*
* @param gage
*
*/
private void addParam( GageData gage ) {
if (gage.getPe().equalsIgnoreCase("PP")){
PP_p = combineString(PP_p, gage.getParamCode());
}
if (gage.getPe().equalsIgnoreCase("PC")){
PC_p = combineString(PC_p, gage.getParamCode());
}
Other_p = combineString (Other_p, gage.getParamCode());
}
/**
* Add values
*
* @param gage
*
*/
private void addValue( GageData gage ) {
if (gage.getPe().equalsIgnoreCase("PP")){
PP_v = combineString( PP_v, formatValue(gage) );
}
if (gage.getPe().equalsIgnoreCase("PC")){
PC_v = combineString( PC_v, formatValue(gage) );
}
Other_v = combineString ( Other_v, formatValue(gage) );
}
/**
* Combine two strings
*
* @param strOne first string
*
* @param strTwo second string
*/
private String combineString( String strOne, String strTwo ) {
String combinedStr = "";
if (strOne.equalsIgnoreCase("")){
combinedStr = strTwo;
}else {
if ( !strTwo.equalsIgnoreCase("") ){
combinedStr = strOne + "\n" + strTwo;
}else{
combinedStr = strOne;
}
}
return combinedStr;
}
public static String formatValue( GageData pGage ){
String valueLabel;
String formatStr = null;
formatStr = getDataFormat( pGage.getPe() );
if ( pGage.getValue() == -9999 ) {
valueLabel = "M";
} else {
valueLabel = String.format( formatStr, pGage.getValue() );
}
return valueLabel;
}
}

View file

@ -68,7 +68,7 @@
<vbSource key="HPE" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="MPE-Local" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="MSAS" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="NamDNG" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="NamDNG5" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="ETA212" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="NAHwave15" category="SfcGrid" views="PLANVIEW TIMESERIES" />
<vbSource key="NAHwave10" category="SfcGrid" views="PLANVIEW TIMESERIES" />

View file

@ -133,7 +133,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarning.vm)!
<bullet bulletText="**** CALL TO ACTIONS (CHOOSE 1 OR MORE) ****" bulletType="title"/>
<!-- end all call to action bullets with "CTA" ex: "obviousNameCTA" -->
<bullet bulletName="ffwEmergencyCTA" bulletText="**FLASH FLOOD EMERGENCY CTA**" bulletGroup="cta1" parseString="FLASH FLOOD EMERGENCY"/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." bulletDefault="true" bulletGroup="cta1" parseString="HIGHER GROUND NOW. ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." bulletDefault="true" bulletGroup="cta1" parseString="HIGHER GROUND NOW! ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="childSafetyCTA" bulletText="Child Safety..." parseString="KEEP CHILDREN AWAY FROM STORM DRAINS"/>
<bullet bulletName="nighttimeCTA" bulletText="Nighttime flooding..." parseString="BE ESPECIALLY CAUTIOUS AT NIGHT WHEN"/>
<bullet bulletName="safetyCTA" bulletText="Safety...by foot or motorist" parseString="DO NOT ENTER OR CROSS FLOWING WATER"/>
@ -183,7 +183,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarning.vm)!
<bullet bulletName="drainages" bulletText="Automated list of drainages" parseString="THIS INCLUDES THE FOLLOWING STREAMS AND DRAINAGES" loadMap="River Drainage Basins"/>
<bullet bulletText="**** CALL TO ACTIONS (CHOOSE 1 OR MORE) ****" bulletType="title"/>
<bullet bulletName="ffwEmergencyCTA" bulletText="**FLASH FLOOD EMERGENCY CTA**" parseString="FLASH FLOOD EMERGENCY"/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." parseString="HIGHER GROUND NOW. ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." parseString="HIGHER GROUND NOW! ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="childSafetyCTA" bulletText="Child Safety..." parseString="KEEP CHILDREN AWAY FROM STORM DRAINS"/>
<bullet bulletName="nighttimeCTA" bulletText="Nighttime flooding..." parseString="BE ESPECIALLY CAUTIOUS AT NIGHT WHEN"/>
<bullet bulletName="safetyCTA" bulletText="Safety...by foot or motorist" parseString="DO NOT ENTER OR CROSS FLOWING WATER"/>
@ -234,7 +234,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarning.vm)!
<bullet bulletText="**** CALL TO ACTIONS (CHOOSE 1 OR MORE) ****" bulletType="title"/>
<!-- end all call to action bullets with "CTA" ex: "obviousNameCTA" -->
<bullet bulletName="ffwEmergencyCTA" bulletText="**FLASH FLOOD EMERGENCY CTA**" parseString="FLASH FLOOD EMERGENCY"/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." parseString="HIGHER GROUND NOW. ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." parseString="HIGHER GROUND NOW! ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="childSafetyCTA" bulletText="Child Safety..." parseString="KEEP CHILDREN AWAY FROM STORM DRAINS"/>
<bullet bulletName="nighttimeCTA" bulletText="Nighttime flooding..." parseString="BE ESPECIALLY CAUTIOUS AT NIGHT WHEN"/>
<bullet bulletName="safetyCTA" bulletText="Safety...by foot or motorist" parseString="DO NOT ENTER OR CROSS FLOWING WATER"/>

View file

@ -134,7 +134,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarningFollo
<bullet bulletText="**** CALL TO ACTIONS (CHOOSE 1 OR MORE) ****" bulletType="title"/>
<!-- end all call to action bullets with "CTA" ex: "obviousNameCTA" -->
<bullet bulletName="ffwEmergencyCTA" bulletText="**FLASH FLOOD EMERGENCY CTA**" parseString="FLASH FLOOD EMERGENCY"/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." parseString="HIGHER GROUND NOW. ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." parseString="HIGHER GROUND NOW! ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="childSafetyCTA" bulletText="Child Safety..." parseString="KEEP CHILDREN AWAY FROM STORM DRAINS"/>
<bullet bulletName="nighttimeCTA" bulletText="Nighttime flooding..." parseString="BE ESPECIALLY CAUTIOUS AT NIGHT WHEN"/>
<bullet bulletName="safetyCTA" bulletText="Safety...by foot or motorist" parseString="DO NOT ENTER OR CROSS FLOWING WATER"/>
@ -186,7 +186,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarningFollo
<bullet bulletText="**** CALL TO ACTIONS (CHOOSE 1 OR MORE) ****" bulletType="title"/>
<!-- end all call to action bullets with "CTA" ex: "obviousNameCTA" -->
<bullet bulletName="ffwEmergencyCTA" bulletText="**FLASH FLOOD EMERGENCY CTA**" parseString="FLASH FLOOD EMERGENCY"/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." parseString="HIGHER GROUND NOW. ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="actQuicklyCTA" bulletText="Act Quickly..." parseString="HIGHER GROUND NOW! ACT QUICKLY TO PROTECT YOUR LIFE."/>
<bullet bulletName="childSafetyCTA" bulletText="Child Safety..." parseString="KEEP CHILDREN AWAY FROM STORM DRAINS"/>
<bullet bulletName="nighttimeCTA" bulletText="Nighttime flooding..." parseString="BE ESPECIALLY CAUTIOUS AT NIGHT WHEN"/>
<bullet bulletName="safetyCTA" bulletText="Safety...by foot or motorist" parseString="DO NOT ENTER OR CROSS FLOWING WATER"/>