From 8c6594a26c9ca73f8f259666b29d2df9329e7538 Mon Sep 17 00:00:00 2001 From: mjames-upc Date: Tue, 24 Jun 2014 11:26:14 -0600 Subject: [PATCH] satellite decoder NEXRCOMP work, change int back to byte, shift index by 50 instead of 100 Former-commit-id: a3c747d55b80a990292b6a00a98f4ddcf995679b --- .../res/scripts/physicalElements.sql | 30 +++++++++---------- .../plugin/satellite/SatelliteDecoder.java | 22 +++++++------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.satellite/res/scripts/physicalElements.sql b/edexOsgi/com.raytheon.edex.plugin.satellite/res/scripts/physicalElements.sql index 16291d4ce1..51a29117ae 100644 --- a/edexOsgi/com.raytheon.edex.plugin.satellite/res/scripts/physicalElements.sql +++ b/edexOsgi/com.raytheon.edex.plugin.satellite/res/scripts/physicalElements.sql @@ -81,18 +81,18 @@ INSERT INTO awips.satellite_physical_elements VALUES (61,'Polar Vis'); INSERT INTO awips.satellite_physical_elements VALUES (62,'Polar 3.9u'); INSERT INTO awips.satellite_physical_elements VALUES (63,'Polar 3.7u'); INSERT INTO awips.satellite_physical_elements VALUES (64,'Polar IR'); -INSERT INTO awips.satellite_physical_elements VALUES (118,'OHA One Hour Precipitation'); -INSERT INTO awips.satellite_physical_elements VALUES (119,'DSP Storm Total Precipitation'); -INSERT INTO awips.satellite_physical_elements VALUES (120,'DTA Storm Total Precipitation'); -INSERT INTO awips.satellite_physical_elements VALUES (121,'DAA'); -INSERT INTO awips.satellite_physical_elements VALUES (122,'N0C'); -INSERT INTO awips.satellite_physical_elements VALUES (123,'N0X'); -INSERT INTO awips.satellite_physical_elements VALUES (124,'N0Q'); -INSERT INTO awips.satellite_physical_elements VALUES (125,'HHC'); -INSERT INTO awips.satellite_physical_elements VALUES (126,'EET'); -INSERT INTO awips.satellite_physical_elements VALUES (127,'N0R'); -INSERT INTO awips.satellite_physical_elements VALUES (128,'DHR'); -INSERT INTO awips.satellite_physical_elements VALUES (129,'DVL'); -INSERT INTO awips.satellite_physical_elements VALUES (130,'N1P'); -INSERT INTO awips.satellite_physical_elements VALUES (131,'NTP'); -INSERT INTO awips.satellite_physical_elements VALUES (132,'WTF'); +INSERT INTO awips.satellite_physical_elements VALUES (68,'OHA One Hour Precipitation'); +INSERT INTO awips.satellite_physical_elements VALUES (69,'DSP Storm Total Precipitation'); +INSERT INTO awips.satellite_physical_elements VALUES (70,'DTA Storm Total Precipitation'); +INSERT INTO awips.satellite_physical_elements VALUES (71,'DAA'); +INSERT INTO awips.satellite_physical_elements VALUES (72,'N0C'); +INSERT INTO awips.satellite_physical_elements VALUES (73,'N0X'); +INSERT INTO awips.satellite_physical_elements VALUES (74,'N0Q 265-level Level 1 Base Reflectivity'); +INSERT INTO awips.satellite_physical_elements VALUES (75,'HHC Hybrid Hydrometeor Classification'); +INSERT INTO awips.satellite_physical_elements VALUES (76,'EET Enhanced Echo Tops'); +INSERT INTO awips.satellite_physical_elements VALUES (77,'N0R 16-level Base Reflectivity'); +INSERT INTO awips.satellite_physical_elements VALUES (78,'DHR Digital Hybrid Reflectivity'); +INSERT INTO awips.satellite_physical_elements VALUES (79,'DVL Digital VIL'); +INSERT INTO awips.satellite_physical_elements VALUES (80,'N1P One Hour Precipitation'); +INSERT INTO awips.satellite_physical_elements VALUES (81,'NTP Storm Total Precipitation'); +INSERT INTO awips.satellite_physical_elements VALUES (82,'WTF'); diff --git a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java index 05ebefbc28..1df46ff9d9 100644 --- a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java @@ -212,7 +212,11 @@ public class SatelliteDecoder { // read the physical element byte physByte = byteBuffer.get(3); - if (entityByte == 99) physByte = (byte) (100+byteBuffer.get(3)); + /* 50 here because of byte limit +127, so NEXRCOMP + * products start at 68 in satellite_physical_elements + * - can't change to int, must keep it byte because of ISpatialEnabled in viz.rsc?? + */ + if (entityByte == 99) physByte = (byte) (50+byteBuffer.get(3)); SatellitePhysicalElement physElem = dao .getPhysicalElement(physByte); @@ -222,26 +226,22 @@ public class SatelliteDecoder { + physByte); } - - - record.setPhysicalElement(physElem.getElementName()); // read the units + SatelliteUnit unit = dao.getUnit(byteBuffer.get(3)); if (entityByte == 99) { - SatelliteUnit unit = dao.getUnit((byte) (100+byteBuffer.get(3))); - } else { - SatelliteUnit unit = dao.getUnit(byteBuffer.get(3)); - } + unit = dao.getUnit((int) (100+byteBuffer.get(3))); + } if (unit != null) { record.setUnits(unit.getUnitName()); } // read the century intValue = 1900 + byteBuffer.get(8); - if (byteBuffer.get(8) < 100) { - intValue = 2000 + byteBuffer.get(8); - } + if (byteBuffer.get(8) < 100) { + intValue = 2000 + byteBuffer.get(8); + } calendar.set(Calendar.YEAR, intValue); // read the month of the year