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 1ad5a9c521..8652912fec 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 @@ -49,6 +49,26 @@ 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; +/** + * + * Canvas to display the trend graph. + * + *
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * ?????????? lvenable Initial creation + * Oct 9, 2013 #2447 lvenable Replaced creating a new color with using a + * system color (white). This fixes a memory + * leak. + * + *+ * + * @author lvenable + * @version 1.0 + */ public class TrendGraphCanvas { private final Composite parentComp; @@ -127,8 +147,6 @@ public class TrendGraphCanvas { private String valueFormatStr = null; - // private final double timeIncPerPix = Double.NaN; - private double valueLabelIncPerPix = Double.NaN; private boolean overMaxLimit = false; @@ -144,6 +162,26 @@ public class TrendGraphCanvas { */ private String ident = null; + /** + * Constructor. + * + * @param parentComp + * Parent composite. + * @param trendGraphData + * Trend graph data. + * @param currentDate + * Current date. + * @param scanTable + * Scan table. + * @param attrName + * Attribute name. + * @param vcp + * Volume coverage pattern. + * @param requestDataCallback + * Request callback. + * @param ident + * Identification. + */ public TrendGraphCanvas(Composite parentComp, TrendGraphData trendGraphData, Date currentDate, ScanTables scanTable, String attrName, Integer vcp, @@ -386,7 +424,7 @@ public class TrendGraphCanvas { return; double topAngle = attributeData.getMin() + rangeValue; - gc.setForeground(new Color(gc.getDevice(), 255, 255, 255)); + gc.setForeground(display.getSystemColor(SWT.COLOR_WHITE)); Object[] rngValLst = rngDateMap.values().toArray(); Object[] dates = rngDateMap.keySet().toArray(); for (int dateIndex = 0; dateIndex < (dates.length - 1); dateIndex++) { diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml index 7443be9698..c9a5605518 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml @@ -179,4 +179,5 @@
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Oct 04, 2013 2042 bsteffen Initial creation + * + *+ * + * @author bsteffen + * @version 1.0 + */ +public class Grib2Decoder extends PythonDecoder { + + public Grib2Decoder() { + super(); + setPluginName("grib"); + setPluginFQN("com.raytheon.edex.plugin.grib"); + setModuleName("GribDecoder"); + setRecordClassname(GridRecord.class.toString()); + setCache(true); + } + + + + public GridRecord[] decode(GribDecodeMessage message) throws GribException { + Map
+ * + * SOFTWARE HISTORY + * + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Oct 03, 2013 2041 bsteffen Initial creation + * + *+ * + * @author bsteffen + * @version 1.0 + * @see GribSplitter + */ +@DynamicSerialize +public class GribDecodeMessage implements Serializable { + + private static final long serialVersionUID = -8088823527599617780L; + + @DynamicSerializeElement + private String fileName; + + @DynamicSerializeElement + private long startPosition; + + @DynamicSerializeElement + private long messageLength; + + @DynamicSerializeElement + private byte gribEdition; + + public GribDecodeMessage() { + + } + + public GribDecodeMessage(String str) { + String[] parts = str.split("::"); + startPosition = Long.valueOf(parts[0]); + messageLength = Long.valueOf(parts[1]); + gribEdition = Byte.valueOf(parts[2]); + fileName = parts[3]; + + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public long getStartPosition() { + return startPosition; + } + + public void setStartPosition(long startPosition) { + this.startPosition = startPosition; + } + + public long getMessageLength() { + return messageLength; + } + + public void setMessageLength(long messageLength) { + this.messageLength = messageLength; + } + + public byte getGribEdition() { + return gribEdition; + } + + public void setGribEdition(byte gribEdition) { + this.gribEdition = gribEdition; + } + + public String toString() { + return startPosition + "::" + messageLength + "::" + gribEdition + "::" + + fileName; + } +} diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java index 59b58a9d80..8043b0db66 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java @@ -19,40 +19,32 @@ **/ package com.raytheon.edex.plugin.grib; -import java.io.File; -import java.io.IOException; import java.util.Map; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import ucar.grib.GribChecker; -import ucar.unidata.io.RandomAccessFile; - import com.raytheon.edex.plugin.grib.exception.GribException; -import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.status.IPerformanceStatusHandler; -import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.PerformanceStatus; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.time.util.ITimer; import com.raytheon.uf.common.time.util.TimeUtil; -import com.raytheon.uf.edex.python.decoder.PythonDecoder; /** * Generic decoder for decoding grib files * *
* SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 3/12/10 4758 bphillip Initial creation - * 02/12/2013 1615 bgonzale public decode method to a Processor exchange method. - * Mar 19, 2013 1785 bgonzale Added performance status handler and added status - * to process. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Mat 12, 2010 4758 bphillip Initial creation + * Feb 12, 2013 1615 bgonzale public decode method to a Processor + * exchange method. + * Mar 19, 2013 1785 bgonzale Added performance status handler and + * added status to process. + * Oct 07, 2013 2042 bsteffen Decode GribDecodeMessage instead of + * files. ** * @author njensen @@ -60,10 +52,6 @@ import com.raytheon.uf.edex.python.decoder.PythonDecoder; */ public class GribDecoder implements Processor { - private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(GribDecoder.class); - - private static final String[] DecoderNames = { "Grib1", "Grib2" }; private final IPerformanceStatusHandler perfLog = PerformanceStatus .getHandler(""); @@ -72,38 +60,27 @@ public class GribDecoder implements Processor { * @see org.apache.camel.Processor.process(Exchange) */ @Override - public void process(Exchange exchange) throws Exception { - final String DATA_TYPE = "dataType"; - final String GRIB = "grib"; - - File file = (File) exchange.getIn().getBody(); + public void process(Exchange exchange) throws GribException { Map
* * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Mar 7, 2012 bsteffen Initial creation + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Oct 07, 2013 2402 bsteffen Rewritten to output GribDecodeMessage. * ** * @author bsteffen - * @version 1.0 + * @version 2.0 */ - public class GribSplitter { + private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(GribSplitter.class); - private static final long TEN_MEGABYTES = 10485760; + private static final KMPMatch matcher = new KMPMatch("GRIB".getBytes()); - private static final String suffixFormat = "%s_record_%d"; - - private static final Pattern suffixPattern = Pattern - .compile(".*_record_\\d+$"); - - private final File tmpFileDirectory; - - public GribSplitter(String tmpFileLocation) { - this.tmpFileDirectory = new File(tmpFileLocation); - if (!tmpFileDirectory.exists()) { - tmpFileDirectory.mkdirs(); - } - } - - public void clean(Headers headers) { - String ingestFileName = (String) headers.get("ingestfilename"); - File file = new File(ingestFileName); - if (tmpFileDirectory.equals(file.getParentFile()) - && suffixPattern.matcher(file.getName()).find()) { - file.delete(); - } - } - - public List
* SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Feb 14, 2007 139 Phillippe Initial check-in. Refactor of initial - * implementation. - * Dec 17, 2007 600 bphillip Added dao pool usage - * Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() - * signature changed. - * Mar 19, 2013 1804 bsteffen Optimize decoder performance. - * Mar 19, 2013 1785 bgonzale Added performance status handler and - * added status to decode. - * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Feb 14, 2007 139 Phillippe Initial check-in. Refactor of initial + * implementation. + * Dec 17, 2007 600 bphillip Added dao pool usage + * Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() + * signature changed. + * Mar 19, 2013 1804 bsteffen Optimize decoder performance. + * Mar 19, 2013 1785 bgonzale Added performance status handler and + * added status to decode. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Oct 09, 2013 2457 bsteffen Improve error message for missing icao. ** * @author bphillip @@ -222,8 +223,8 @@ public class RadarDecoder extends AbstractDecoder { if (station == null) { record.setIcao("unkn"); logger.error(headers.get("ingestfilename") - + "-Unknown radar station id: " - + l3Radar.getSourceId()); + + " contains an rpg id(" + l3Radar.getSourceId() + + ") that is not in the radar_spatial table."); } else { record.setIcao(station.getRdaId().toLowerCase()); } diff --git a/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/util/RadarSpatialUtil.java b/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/util/RadarSpatialUtil.java index 418d9a05e2..10db305441 100644 --- a/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/util/RadarSpatialUtil.java +++ b/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/util/RadarSpatialUtil.java @@ -37,10 +37,12 @@ import com.vividsolutions.jts.geom.Coordinate; *
* * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * Mar 19, 2010 #4473 rjpeter Initial creation. - * Mar 19, 2013 1804 bsteffen Cache db queries in radar decoder. + * Date Ticket# Engineer Description + * ------------- -------- ----------- -------------------------- + * Mar 19, 2010 #4473 rjpeter Initial creation. + * Mar 19, 2013 1804 bsteffen Cache db queries in radar decoder. + * Oct 09, 2013 2457 bsteffen Eliminate NullPointerException for rpg + * ids that are not in the database. * ** @@ -110,8 +112,11 @@ public class RadarSpatialUtil { RadarStation station = rpgIdDec2radarStation.get(rpgIdDec); if (station == null) { RadarStationDao stat = new RadarStationDao(); - station = stat.queryByRpgIdDec(String.format("%03d", rpgIdDec)); - rpgIdDec2radarStation.put(rpgIdDec, station); + String rpgId = String.format("%03d", rpgIdDec); + station = stat.queryByRpgIdDec(rpgId); + if (station != null) { + rpgIdDec2radarStation.put(rpgIdDec, station); + } } return station; } diff --git a/msi/AWIPSII.Environment/AWIPSII.Environment.suo b/msi/AWIPSII.Environment/AWIPSII.Environment.suo index 15bc1810da..755a848eb3 100644 Binary files a/msi/AWIPSII.Environment/AWIPSII.Environment.suo and b/msi/AWIPSII.Environment/AWIPSII.Environment.suo differ diff --git a/msi/AWIPSII.Environment/AWIPSII.Environment/AWIPSII.Environment.csproj b/msi/AWIPSII.Environment/AWIPSII.Environment/AWIPSII.Environment.csproj index 22ec62e6d7..3e939b5f5a 100644 --- a/msi/AWIPSII.Environment/AWIPSII.Environment/AWIPSII.Environment.csproj +++ b/msi/AWIPSII.Environment/AWIPSII.Environment/AWIPSII.Environment.csproj @@ -40,9 +40,7 @@