diff --git a/RadarServer/com.raytheon.rcm.lib/src/com/raytheon/rcm/products/ElevationInfo.java b/RadarServer/com.raytheon.rcm.lib/src/com/raytheon/rcm/products/ElevationInfo.java index ff95ecce19..7e9381609e 100644 --- a/RadarServer/com.raytheon.rcm.lib/src/com/raytheon/rcm/products/ElevationInfo.java +++ b/RadarServer/com.raytheon.rcm.lib/src/com/raytheon/rcm/products/ElevationInfo.java @@ -120,7 +120,7 @@ public class ElevationInfo { private ArrayList vcpInfo = new ArrayList(); private HashMap staticInfo = new HashMap(); - public ElevationInfo() { + /*package*/ ElevationInfo() { Scanner fs; InputStream s; diff --git a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java index d2b9f39b07..6e43a2510a 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java +++ b/cave/com.raytheon.uf.viz.d2d.ui/src/com/raytheon/uf/viz/d2d/ui/map/SideView.java @@ -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 * * * @@ -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 diff --git a/cave/com.raytheon.uf.viz.monitor.scan/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.monitor.scan/META-INF/MANIFEST.MF index 819df9de5d..31285370e9 100644 --- a/cave/com.raytheon.uf.viz.monitor.scan/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.monitor.scan/META-INF/MANIFEST.MF @@ -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, diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/TrendGraphCanvas.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/TrendGraphCanvas.java index b60d8b4b6e..9e1d0bf52f 100644 --- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/TrendGraphCanvas.java +++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/commondialogs/TrendGraphCanvas.java @@ -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 rngDateMap = tgd.getGraphData(); - ElevationInfo eleInfo = new ElevationInfo(); + ElevationInfo eleInfo = RadarApps.getElevationInfo(); int[] elevationAngles = eleInfo.getScanElevations(null, vcp); if (elevationAngles == null) return; diff --git a/cave/com.raytheon.uf.viz.radarapps.core/src/com/raytheon/uf/viz/radarapps/core/RadarApps.java b/cave/com.raytheon.uf.viz.radarapps.core/src/com/raytheon/uf/viz/radarapps/core/RadarApps.java index d842da8007..523274da25 100644 --- a/cave/com.raytheon.uf.viz.radarapps.core/src/com/raytheon/uf/viz/radarapps/core/RadarApps.java +++ b/cave/com.raytheon.uf.viz.radarapps.core/src/com/raytheon/uf/viz/radarapps/core/RadarApps.java @@ -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. + *

+ * Using this method ensures RcmResourceProvider has been set up correctly. + */ + public static ElevationInfo getElevationInfo() { + return ElevationInfo.getInstance(); + } + } diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/Tool.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/Tool.java index 1067fa404d..e4d4250ce9 100644 --- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/Tool.java +++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/smarttool/Tool.java @@ -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 * * * @@ -87,7 +88,7 @@ public class Tool { private final IPerformanceStatusHandler perfLog = PerformanceStatus .getHandler("GFE:"); - private static final String CANCEL_MSG_START = "jep.JepException: : Cancel: Cancel >>>"; + private static final String CANCEL_MSG_START = "jep.JepException: : Cancel: Cancel"; private final IParmManager parmMgr; diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/pointdatacontrol/PointDataControlManager.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/pointdatacontrol/PointDataControlManager.java index 3b16653e05..3e39c9b05c 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/pointdatacontrol/PointDataControlManager.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/pointdatacontrol/PointDataControlManager.java @@ -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() + * * * * @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); } /** diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/pointdatacontrol/data/StationEntryDetails.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/pointdatacontrol/data/StationEntryDetails.java index aaaa183e75..8c0fd5b1ea 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/pointdatacontrol/data/StationEntryDetails.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/pointdatacontrol/data/StationEntryDetails.java @@ -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() * * * @@ -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(); + } } diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/resource/MultiPointResource.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/resource/MultiPointResource.java index c1fcd5de6f..067f613a69 100644 --- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/resource/MultiPointResource.java +++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/resource/MultiPointResource.java @@ -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 * * * @@ -218,7 +221,11 @@ public class MultiPointResource extends private final Map dataMap = new HashMap(); + private final Map dataMapTimeStep = new HashMap(); + 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 drawPlotInfoTimeStep(GageDataTimeStep gageTimeStep, + double shiftWidth, double shiftHeight, PaintProperties paintProps, + IGraphicsTarget target) throws VizException { + List strings = new ArrayList(); + 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 data = pdcManager.getObsReportList(); resetDataMap(); - if (data != null) { - List images = new ArrayList(data.size()); - List strings = new ArrayList( - 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 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 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 images = new ArrayList( dataMapTimeStep.size() ); + List strings = new ArrayList( dataMapTimeStep.size() * 3 ); + + Iterator> it = dataMapTimeStep.entrySet().iterator(); + Map.Entry 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 data = pdcManager.getObsReportList(); + + if (data == null) { + return; + } + + IExtent extent = paintProps.getView().getExtent(); + + List images = new ArrayList( data.size() ); + List strings = new ArrayList( 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 { diff --git a/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/GageData.java b/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/GageData.java index 07a0dca1d4..4372a8753f 100644 --- a/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/GageData.java +++ b/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/GageData.java @@ -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(). * * * @author dhladky @@ -909,7 +910,7 @@ public class GageData implements Comparable { return retVal; } - /* + /** * (non-Javadoc) * * @see java.lang.Object#toString() @@ -918,4 +919,169 @@ public class GageData implements Comparable { 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; + } } \ No newline at end of file diff --git a/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/GageDataTimeStep.java b/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/GageDataTimeStep.java new file mode 100644 index 0000000000..4a1356cab4 --- /dev/null +++ b/cave/com.raytheon.viz.hydrocommon/src/com/raytheon/viz/hydrocommon/data/GageDataTimeStep.java @@ -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. + * + *

+ * SOFTWARE HISTOR
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Sep 14, 2015  17978     lbousaidi   Initial Creation  
+ * 
+ * + * @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; + } + +} diff --git a/cave/com.raytheon.viz.volumebrowser/localization/volumebrowser/VbSources/sfcGrid.xml b/cave/com.raytheon.viz.volumebrowser/localization/volumebrowser/VbSources/sfcGrid.xml index e985e9cd1a..f0132417f3 100644 --- a/cave/com.raytheon.viz.volumebrowser/localization/volumebrowser/VbSources/sfcGrid.xml +++ b/cave/com.raytheon.viz.volumebrowser/localization/volumebrowser/VbSources/sfcGrid.xml @@ -68,7 +68,7 @@ - + diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarning.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarning.xml index 4ee4dac263..770fa57025 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarning.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarning.xml @@ -133,7 +133,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarning.vm)! - + @@ -183,7 +183,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarning.vm)! - + @@ -234,7 +234,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarning.vm)! - + diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarningFollowup.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarningFollowup.xml index 471e50889b..e6b541d84c 100755 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarningFollowup.xml +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/flashFloodWarningFollowup.xml @@ -134,7 +134,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarningFollo - + @@ -186,7 +186,7 @@ Must be paired with proper vm code (also commented out in flashFloodWarningFollo - +