Issue #2317 Unify airep and ncairep.
Former-commit-id:07c36e244c
[formerly 405f6beb9b20e4bda3d43173aa3e941af6b47399] Former-commit-id:bc0638de58
This commit is contained in:
parent
37dcf924bd
commit
ad30efaefa
73 changed files with 296 additions and 3231 deletions
|
@ -30,13 +30,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.dataplugin.airep"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.dataplugin.binlightning"
|
||||
download-size="0"
|
||||
|
|
|
@ -185,7 +185,7 @@
|
|||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="gov.noaa.nws.ncep.common.dataplugin.ncairep"
|
||||
id="gov.noaa.nws.ncep.common.dataplugin.airep"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
|
|
|
@ -5,6 +5,60 @@ overflow="visible"
|
|||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">
|
||||
<defs>
|
||||
<script type="text/python" plotDelegate="plotDelegate">
|
||||
import time
|
||||
|
||||
class AirepPlotDelegate(PlotDelegate):
|
||||
def __init__(self):
|
||||
PlotDelegate.__init__(self)
|
||||
|
||||
def getSampleText(self, rec):
|
||||
sampleString = "ARP "
|
||||
sampleString += rec.getString("stationId")
|
||||
sampleString += " "
|
||||
lat = rec.getFloat("latitude")
|
||||
if(lat < 0):
|
||||
sampleString += "%.3fS " % (-1*lat)
|
||||
else:
|
||||
sampleString += "%.3fN " % (lat)
|
||||
lon = rec.getFloat("longitude")
|
||||
if(lon < 0):
|
||||
sampleString += "%.3fW " % (-1*lon)
|
||||
else:
|
||||
sampleString += "%.3fE " % (lon)
|
||||
timeObs = rec.getLong("timeObs")
|
||||
sampleString += time.strftime("%H%M",time.localtime(timeObs/1000))
|
||||
sampleString += " F%d" % (rec.getInt("flightLevel")/100)
|
||||
temp = rec.getFloat("temperature")
|
||||
if temp < -273.15:
|
||||
pass
|
||||
elif temp < 0:
|
||||
sampleString += " M%d" % (int(-1*temp))
|
||||
else:
|
||||
sampleString += " P%d" % (int(temp))
|
||||
windDir = int(rec.getFloat("windDir"))
|
||||
windSpeed = int(rec.getFloat("windSpeed"))
|
||||
if windDir > -1080 or windSpeed > 0:
|
||||
sampleString += " %d/%dKT" % (windDir, windSpeed)
|
||||
turbFreq = rec.getString("turbFreq")
|
||||
turbInten = rec.getString("turbInten")
|
||||
turbType = rec.getString("turbType")
|
||||
if turbFreq != "" or turbInten != "" or turbType != "":
|
||||
sampleString += " TB"
|
||||
if turbFreq != "":
|
||||
sampleString += " "
|
||||
sampleString += turbFreq
|
||||
if turbInten != "":
|
||||
sampleString += " "
|
||||
sampleString += turbInten
|
||||
if turbType != "":
|
||||
sampleString += " "
|
||||
sampleString += turbType
|
||||
return sampleString
|
||||
|
||||
plotDelegate = AirepPlotDelegate()
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
@font-face { font-family: "WindSymbolFont";
|
||||
|
@ -24,27 +78,13 @@ xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">
|
|||
font-family: StandardFont;
|
||||
font-size: 1em;
|
||||
}
|
||||
text.weather
|
||||
{
|
||||
fill: none;
|
||||
font-size: 1em;
|
||||
stroke-width: 1px;
|
||||
font-family: WxSymbolFont;
|
||||
|
||||
}
|
||||
text.special
|
||||
{
|
||||
fill: none;
|
||||
font-size: 1em;
|
||||
stroke-width: 1px;
|
||||
font-size: 1em;
|
||||
font-family: SpecialSymbolFont;
|
||||
}
|
||||
]]>
|
||||
</style>
|
||||
<symbol overflow="visible" id="plotData" class="info">
|
||||
<text id="iceInensity" plotMode="table" class="weather" plotLookupTable="airep_icing_intens_trans.txt" plotParam="FLT_HZD" x="0" y="0">0</text>
|
||||
<text id="fltLvlText" plotMode="text" plotParam="FLT_LVL" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
|
||||
<text id="sampleParams1" plotMode="sample" plotParam="stationId,longitude,latitude,timeObs,flightLevel"> </text>
|
||||
<text id="sampleParams2" plotMode="sample" plotParam="temperature,windDir,windSpeed,turbInten,turbFreq,turbType"> </text>
|
||||
<text id="iceInensity" plotMode="table" class="weather" plotLookupTable="airep_icing_intens_trans.txt" plotParam="flightHazard" x="0" y="0">0</text>
|
||||
<text id="fltLvlText" plotMode="text" plotParam="flightLevel" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
|
||||
</symbol>
|
||||
|
||||
</defs>
|
||||
|
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.5 KiB |
|
@ -5,6 +5,60 @@ overflow="visible"
|
|||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">
|
||||
<defs>
|
||||
<script type="text/python" plotDelegate="plotDelegate">
|
||||
import time
|
||||
|
||||
class AirepPlotDelegate(PlotDelegate):
|
||||
def __init__(self):
|
||||
PlotDelegate.__init__(self)
|
||||
|
||||
def getSampleText(self, rec):
|
||||
sampleString = "ARP "
|
||||
sampleString += rec.getString("stationId")
|
||||
sampleString += " "
|
||||
lat = rec.getFloat("latitude")
|
||||
if(lat < 0):
|
||||
sampleString += "%.3fS " % (-1*lat)
|
||||
else:
|
||||
sampleString += "%.3fN " % (lat)
|
||||
lon = rec.getFloat("longitude")
|
||||
if(lon < 0):
|
||||
sampleString += "%.3fW " % (-1*lon)
|
||||
else:
|
||||
sampleString += "%.3fE " % (lon)
|
||||
timeObs = rec.getLong("timeObs")
|
||||
sampleString += time.strftime("%H%M",time.localtime(timeObs/1000))
|
||||
sampleString += " F%d" % (rec.getInt("flightLevel")/100)
|
||||
temp = rec.getFloat("temperature")
|
||||
if temp < -273.15:
|
||||
pass
|
||||
elif temp < 0:
|
||||
sampleString += " M%d" % (int(-1*temp))
|
||||
else:
|
||||
sampleString += " P%d" % (int(temp))
|
||||
windDir = int(rec.getFloat("windDir"))
|
||||
windSpeed = int(rec.getFloat("windSpeed"))
|
||||
if windDir > -1080 or windSpeed > 0:
|
||||
sampleString += " %d/%dKT" % (windDir, windSpeed)
|
||||
turbFreq = rec.getString("turbFreq")
|
||||
turbInten = rec.getString("turbInten")
|
||||
turbType = rec.getString("turbType")
|
||||
if turbFreq != "" or turbInten != "" or turbType != "":
|
||||
sampleString += " TB"
|
||||
if turbFreq != "":
|
||||
sampleString += " "
|
||||
sampleString += turbFreq
|
||||
if turbInten != "":
|
||||
sampleString += " "
|
||||
sampleString += turbInten
|
||||
if turbType != "":
|
||||
sampleString += " "
|
||||
sampleString += turbType
|
||||
return sampleString
|
||||
|
||||
plotDelegate = AirepPlotDelegate()
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
@font-face { font-family: "WindSymbolFont";
|
||||
|
@ -32,20 +86,14 @@ xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">
|
|||
font-family: WxSymbolFont;
|
||||
|
||||
}
|
||||
text.special
|
||||
{
|
||||
fill: none;
|
||||
font-size: 1em;
|
||||
stroke-width: 1px;
|
||||
font-size: 1em;
|
||||
font-family: SpecialSymbolFont;
|
||||
}
|
||||
]]>
|
||||
</style>
|
||||
<symbol overflow="visible" id="plotData" class="info">
|
||||
<text id="airepturbIntensity" plotMode="table" class="weather" plotLookupTable="turb_intens_trans.txt" plotParam="TBI" x="0" y="0">0</text>
|
||||
<text id="airepturbFreq" plotMode="table" class="weather" plotLookupTable="turb_freq_trans.txt" plotParam="TBF" style="text-anchor: end" x="0" y="-10">0</text>
|
||||
<text id="airepfltLvlText" plotMode="text" plotParam="FLT_LVL" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
|
||||
<text id="sampleParams1" plotMode="sample" plotParam="stationId,longitude,latitude,timeObs,flightLevel"> </text>
|
||||
<text id="sampleParams2" plotMode="sample" plotParam="temperature,windDir,windSpeed,turbInten,turbFreq,turbType"> </text>
|
||||
<text id="airepturbIntensity" plotMode="table" class="weather" plotLookupTable="turb_intens_trans.txt" plotParam="turbInten" x="0" y="0">0</text>
|
||||
<text id="airepturbFreq" plotMode="table" class="weather" plotLookupTable="turb_freq_trans.txt" plotParam="turbFreq" style="text-anchor: end" x="0" y="-10">0</text>
|
||||
<text id="airepfltLvlText" plotMode="text" plotParam="flightLevel" plotFormat="%3.0f" plotUnit="hft" style="text-anchor: end;" x="-15px" y="0px">75</text>
|
||||
</symbol>
|
||||
|
||||
</defs>
|
||||
|
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 3.8 KiB |
|
@ -151,7 +151,6 @@ public class PlotResourceData extends AbstractRequestableResourceData {
|
|||
* These use the original PlotResource, whoever can convert these gets
|
||||
* to delete thousands of lines of code, it will be amazing.
|
||||
*/
|
||||
pluginProps.put("airep", new PluginPlotProperties(false, false));
|
||||
pluginProps.put("acars", new PluginPlotProperties(false, false));
|
||||
|
||||
/*
|
||||
|
@ -194,6 +193,7 @@ public class PlotResourceData extends AbstractRequestableResourceData {
|
|||
pluginProps.put("bufrssmi", new PluginPlotProperties());
|
||||
pluginProps.put("madis", new PluginPlotProperties());
|
||||
pluginProps.put("pirep", new PluginPlotProperties());
|
||||
pluginProps.put("airep", new PluginPlotProperties());
|
||||
|
||||
ParsedURL.registerHandler(new LocalizationParsedURLHandler());
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
# DR #2316 drop pirep,ncpirep,airep,ncairep
|
||||
# DR #2316,2317 drop pirep,ncpirep,airep,ncairep
|
||||
|
||||
PSQL="/awips2/psql/bin/psql"
|
||||
|
||||
${PSQL} -U awips -d metadata -c "delete from plugin_info where name = 'pirep' or name = 'ncpirep';"
|
||||
${PSQL} -U awips -d metadata -c "drop table pirep, pirep_anc_data, ncpirep, ncpirep_anc_data;"
|
||||
${PSQL} -U awips -d metadata -c "delete from plugin_info where name in ('pirep','ncpirep','airep','ncairep');"
|
||||
${PSQL} -U awips -d metadata -c "drop table pirep, pirep_anc_data, ncpirep, ncpirep_anc_data, airep, ncairep;"
|
||||
|
|
|
@ -88,7 +88,6 @@
|
|||
<includeMode>excludeDpaAndOgc</includeMode>
|
||||
<!-- ncep excludes until tested -->
|
||||
<exclude>aww-ingest.xml</exclude>
|
||||
<exclude>ncairep-ingest.xml</exclude>
|
||||
<exclude>ncccfp-ingest.xml</exclude>
|
||||
<exclude>ncgrib-distribution.xml</exclude>
|
||||
<exclude>ncep-util-on-edex-ingest</exclude>
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -1,7 +0,0 @@
|
|||
#Thu Mar 26 10:16:19 CDT 2009
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -1,23 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Airep Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.edex.plugin.airep
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Export-Package: com.raytheon.edex.plugin.airep,
|
||||
com.raytheon.edex.plugin.airep.dao,
|
||||
com.raytheon.edex.plugin.airep.decoder
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.edex.db.dao,
|
||||
com.raytheon.edex.esb,
|
||||
com.raytheon.edex.exception,
|
||||
com.raytheon.edex.plugin,
|
||||
org.apache.commons.logging
|
||||
Require-Bundle: com.raytheon.uf.common.dataplugin.airep;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.database;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.decodertools;bundle-version="1.12.1174"
|
|
@ -1,219 +0,0 @@
|
|||
/**
|
||||
* 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.edex.plugin.airep;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.edex.esb.Headers;
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.AbstractDecoder;
|
||||
import com.raytheon.edex.plugin.airep.decoder.AIREPWeather;
|
||||
import com.raytheon.edex.plugin.airep.decoder.AirepParser;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.airep.AirepRecord;
|
||||
import com.raytheon.uf.common.pointdata.spatial.AircraftObsLocation;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||
|
||||
/**
|
||||
* Decoder strategy for Aicraft Report (AIREP) observation data. Most common
|
||||
* usage is as follows. <code>
|
||||
* AIREPDecoder dec = new AIREPDecoder();
|
||||
* dec.setMessage(messageData);
|
||||
* while(dec.hasNext())
|
||||
* {
|
||||
* PluginDataObject r = dec.decode();
|
||||
* // do something with record.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 03, 2008 384 jkorman Initial Coding.
|
||||
* Apr 08, 2008 1039 jkorman Added traceId for tracing data.
|
||||
* Nov 11, 2008 1684 chammack Camel Refactor
|
||||
* Sep 11, 2012 1011 jkorman Added decode of AIREP turbulence.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
public class AirepDecoder extends AbstractDecoder {
|
||||
// Name of the plugin controlling this decoder.
|
||||
private final String PLUGIN_NAME;
|
||||
|
||||
public static class AirepDecoderInput {
|
||||
public WMOHeader wmoHeader;
|
||||
|
||||
public String report;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pluginName
|
||||
* Name that identifies this decoder.
|
||||
* @throws DecoderException
|
||||
*/
|
||||
public AirepDecoder(String pluginName) throws DecoderException {
|
||||
PLUGIN_NAME = pluginName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next decoded data record.
|
||||
*
|
||||
* @param input
|
||||
* the decoder input
|
||||
* @return One record of decoded data.
|
||||
* @throws DecoderException
|
||||
* Thrown if no data is available.
|
||||
*/
|
||||
public PluginDataObject[] decode(AirepDecoderInput input, Headers header)
|
||||
throws DecoderException {
|
||||
|
||||
PluginDataObject[] reports = null;
|
||||
|
||||
AirepRecord report = null;
|
||||
String traceId = null;
|
||||
|
||||
try {
|
||||
WMOHeader wmoHeader = input.wmoHeader;
|
||||
if (wmoHeader != null) {
|
||||
traceId = wmoHeader.getWmoHeader().replace(" ", "_");
|
||||
logger.info(traceId + "- AirepDecoder.decode()");
|
||||
|
||||
Calendar refTime = TimeTools.findDataTime(
|
||||
wmoHeader.getYYGGgg(), header);
|
||||
if (refTime != null) {
|
||||
report = populateRecord(new AirepParser(input.report,
|
||||
refTime));
|
||||
}
|
||||
}
|
||||
if (report != null) {
|
||||
report.setTraceId(traceId);
|
||||
try {
|
||||
report.constructDataURI();
|
||||
} catch (PluginException e) {
|
||||
throw new DecoderException("Error constructing dataURI", e);
|
||||
}
|
||||
reports = new PluginDataObject[] { report };
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(traceId + "- Error in AirepDecoder", e);
|
||||
} finally {
|
||||
if (reports == null) {
|
||||
reports = new PluginDataObject[0];
|
||||
}
|
||||
}
|
||||
return reports;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param parser
|
||||
* The reccon parser that contains the decoded data.
|
||||
* @return The populated record.
|
||||
*/
|
||||
private AirepRecord populateRecord(AirepParser parser) {
|
||||
|
||||
AirepRecord record = null;
|
||||
AircraftObsLocation location = null;
|
||||
if (parser != null) {
|
||||
// If there is no obstime, don't bother going further.
|
||||
Calendar oTime = parser.getObservationTime();
|
||||
if (oTime != null) {
|
||||
record = new AirepRecord();
|
||||
location = new AircraftObsLocation();
|
||||
|
||||
record.setTimeObs(oTime);
|
||||
record.setRefHour(TimeTools.copyToNearestHour(oTime));
|
||||
|
||||
DataTime dataTime = new DataTime(oTime);
|
||||
record.setDataTime(dataTime);
|
||||
|
||||
record.setReportData(parser.getReportData());
|
||||
location.setStationId(parser.getAircraftId());
|
||||
record.setReportType(parser.getReportType());
|
||||
location.setLatitude(parser.getLatitude());
|
||||
location.setLongitude(parser.getLongitude());
|
||||
location.setFlightLevel(parser.getFlightLevel());
|
||||
location.setLocation(parser.getLatitude(),
|
||||
parser.getLongitude());
|
||||
|
||||
record.setTemp(parser.getTemperature());
|
||||
|
||||
record.setWindDirection(parser.getWindDirection());
|
||||
record.setWindSpeed(parser.getWindSpeed());
|
||||
|
||||
record.setLocation(location);
|
||||
|
||||
AIREPWeather wx = parser.getWeatherGroup();
|
||||
int flightConditions = -1;
|
||||
if (wx != null) {
|
||||
flightConditions = wx.getFlightConditions();
|
||||
record.setFlightHazard(wx.getHazard());
|
||||
record.setFlightWeather(wx.getWeather());
|
||||
}
|
||||
AirepParser.Turbulence turb = parser.getTurbulence();
|
||||
int t = -1;
|
||||
if (turb != null) {
|
||||
t = turb.getTurbulence() << 4;
|
||||
}
|
||||
if (flightConditions > -1) {
|
||||
if (t > -1) {
|
||||
record.setFlightConditions(flightConditions | t);
|
||||
} else {
|
||||
record.setFlightConditions(flightConditions);
|
||||
}
|
||||
} else {
|
||||
if (t > -1) {
|
||||
record.setFlightConditions(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return record;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param hdrMap
|
||||
* @return
|
||||
*/
|
||||
String getTraceId(Map<String, Object> hdrMap) {
|
||||
String traceId = null;
|
||||
if (hdrMap != null) {
|
||||
Object o = hdrMap.get("CamelFileName");
|
||||
if (o != null) {
|
||||
traceId = (String) o;
|
||||
}
|
||||
}
|
||||
return traceId;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,233 +0,0 @@
|
|||
/**
|
||||
* 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.edex.plugin.airep;
|
||||
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.WMO_HEADER;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.esb.Headers;
|
||||
import com.raytheon.edex.plugin.AbstractRecordSeparator;
|
||||
import com.raytheon.edex.plugin.airep.AirepDecoder.AirepDecoderInput;
|
||||
import com.raytheon.uf.edex.decodertools.core.DecoderTools;
|
||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||
|
||||
/**
|
||||
* The AirepSeparator takes a potential weather message and attempts to
|
||||
* determine the WMO header and data type of the enclosed data. Normal usage is
|
||||
* to create an instance and set the message data using the setData method. When
|
||||
* complete the separator contains the WMO header, the message data with all
|
||||
* leading data up to and including the WMO header removed. In addition all
|
||||
* extraneous spaces and carriage control has been removed. The message reports
|
||||
* are available using hasNext to determine if data is available, and the
|
||||
* getRecord method to retrieve the actual report data. Note that this separator
|
||||
* implementation should not be used on mixed text/binary weather messages.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 20080103 384 jkorman Initial Coding.
|
||||
* 11/13/2008 1684 chammack Camel Refactor
|
||||
* ======================================
|
||||
* AWIPS2 DR Work
|
||||
* 20120911 1011 jkorman Properly handle trailing end of report.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
public class AirepSeparator extends AbstractRecordSeparator {
|
||||
/** The logger */
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private static final String SPLITCHARS = "[=;$][^\\r\\n]*[\\r\\n]+";
|
||||
|
||||
private static final String AIREP_HDR = "AIREP[\\r\\n]+";
|
||||
|
||||
private static final String AIREP_MSG_LINE = "(ARP|ARS)";
|
||||
|
||||
private static final String EOR_E = "=";
|
||||
|
||||
private static final String EOR_S = ";";
|
||||
|
||||
private WMOHeader wmoHeader = null;
|
||||
|
||||
private byte[] messageData = null;
|
||||
|
||||
private List<String> reports = null;
|
||||
|
||||
private int currentReport = -1;
|
||||
|
||||
public static AirepSeparator separate(byte[] data, Headers headers) {
|
||||
AirepSeparator airepSeparator = new AirepSeparator();
|
||||
airepSeparator.setData(data, headers);
|
||||
return airepSeparator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next record. This implementation returns the record as a String.
|
||||
*
|
||||
* @return The next observation record as a String.
|
||||
*/
|
||||
public AirepDecoderInput next() {
|
||||
AirepDecoderInput data = null;
|
||||
if (hasNext()) {
|
||||
data = new AirepDecoderInput();
|
||||
data.report = reports.get(currentReport++);
|
||||
data.wmoHeader = wmoHeader;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is there another record available?
|
||||
*
|
||||
* @return Is there another record available?
|
||||
*/
|
||||
@Override
|
||||
public boolean hasNext() {
|
||||
return ((reports != null) && (reports.size() > 0) && (currentReport < reports
|
||||
.size()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the raw message data and invoke the internal message separation
|
||||
* process.
|
||||
*
|
||||
* @param rawMessage
|
||||
* The raw weather text message.
|
||||
*/
|
||||
@Override
|
||||
public void setData(byte[] rawMessage, Headers headers) {
|
||||
currentReport = -1;
|
||||
reports = null;
|
||||
rawMessage = DecoderTools.cleanData(rawMessage);
|
||||
if (rawMessage != null) {
|
||||
wmoHeader = new WMOHeader(rawMessage, headers);
|
||||
if (wmoHeader.isValid()) {
|
||||
messageData = DecoderTools.stripWMOHeader(rawMessage,
|
||||
WMO_HEADER);
|
||||
|
||||
separate(new String(messageData));
|
||||
}
|
||||
}
|
||||
|
||||
if ((reports != null) && (reports.size() > 0)) {
|
||||
currentReport = 0;
|
||||
for (int i = 0; i < reports.size(); i++) {
|
||||
String s = reports.get(i);
|
||||
if (s != null) {
|
||||
if (s.endsWith(EOR_E) || s.endsWith(EOR_S)) {
|
||||
reports.set(i, s.substring(0, s.length() - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.info("No reports found in data");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the message data.
|
||||
*
|
||||
* @return The cleaned message data.
|
||||
*/
|
||||
public byte[] getMessage() {
|
||||
return messageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the WMO header associated with the message data.
|
||||
*
|
||||
* @return The WMO header.
|
||||
*/
|
||||
public WMOHeader getWmoHeader() {
|
||||
return wmoHeader;
|
||||
}
|
||||
|
||||
private void separate(String message) {
|
||||
|
||||
Pattern pattern = Pattern.compile(AIREP_HDR);
|
||||
Matcher matcher = pattern.matcher(message);
|
||||
if (matcher.find()) {
|
||||
separateAIREP(message.substring(matcher.end()));
|
||||
} else {
|
||||
separateARPARS(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Separate airep data that comes in with AIREP header line. This data
|
||||
* usually does not contain ARP/ARS report start data.
|
||||
*/
|
||||
private void separateAIREP(String message) {
|
||||
|
||||
Pattern pattern = Pattern.compile(SPLITCHARS);
|
||||
Matcher matcher = pattern.matcher(message);
|
||||
|
||||
reports = new ArrayList<String>();
|
||||
int start = 0;
|
||||
int stop = message.length();
|
||||
while (matcher.find()) {
|
||||
stop = matcher.start() + 1;
|
||||
reports.add("ARP " + message.substring(start, stop));
|
||||
start = matcher.end();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Separate airep data that does not have the AIREP header line. This data
|
||||
* is checked to ensure that it contains ARP/ARS report start data.
|
||||
*/
|
||||
private void separateARPARS(String message) {
|
||||
ArrayList<Integer> bodyRecords = new ArrayList<Integer>();
|
||||
|
||||
Pattern pattern = Pattern.compile(AIREP_MSG_LINE);
|
||||
Matcher matcher = pattern.matcher(message);
|
||||
|
||||
bodyRecords = new ArrayList<Integer>();
|
||||
while (matcher.find()) {
|
||||
bodyRecords.add(matcher.start());
|
||||
}
|
||||
|
||||
reports = new ArrayList<String>();
|
||||
for (int i = 0; i < bodyRecords.size(); i++) {
|
||||
String observation = null;
|
||||
if (i < bodyRecords.size() - 1) {
|
||||
observation = message.substring(bodyRecords.get(i),
|
||||
bodyRecords.get(i + 1)).trim();
|
||||
} else {
|
||||
observation = message.substring(bodyRecords.get(i)).trim();
|
||||
}
|
||||
reports.add(observation);
|
||||
}
|
||||
bodyRecords = null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/**
|
||||
* 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.edex.plugin.airep.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.edex.db.dao.DefaultPluginDao;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.airep.AirepRecord;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
|
||||
/**
|
||||
* Set of DAO methods for AIREP Observation data.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 20080103 384 jkorman Initial Coding.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class AirepDao extends DefaultPluginDao {
|
||||
|
||||
/**
|
||||
* Creates a new ReccoDao
|
||||
*
|
||||
* @throws PluginException
|
||||
*/
|
||||
public AirepDao(String pluginName) throws PluginException {
|
||||
super(pluginName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves an sfcobs report using the datauri .
|
||||
*
|
||||
* @param dataURI
|
||||
* The dataURI to match against.
|
||||
* @return The report record if it exists.
|
||||
*/
|
||||
public AirepRecord queryByDataURI(String dataURI) {
|
||||
AirepRecord report = null;
|
||||
List<?> obs = null;
|
||||
try {
|
||||
obs = queryBySingleCriteria("dataURI", dataURI);
|
||||
} catch (DataAccessLayerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if ((obs != null) && (obs.size() > 0)) {
|
||||
report = (AirepRecord) obs.get(0);
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries for to determine if a given data uri exists on the sfcobs table.
|
||||
*
|
||||
* @param dataUri
|
||||
* The DataURI to find.
|
||||
* @return An array of objects. If not null, there should only be a single
|
||||
* element.
|
||||
*/
|
||||
public Object[] queryDataUriColumn(final String dataUri) {
|
||||
|
||||
String sql = "select datauri from awips.airep where datauri='"
|
||||
+ dataUri + "';";
|
||||
|
||||
Object[] results = executeSQLQuery(sql);
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
/**
|
||||
* 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.edex.plugin.airep.decoder;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
|
||||
/**
|
||||
* TODO Change this to a Java 1.5 enum.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date PTR# Engineer Description
|
||||
* ------------ -------- ------------- -------------------------------------
|
||||
* 20080103 384 jkorman Initial Coding.
|
||||
* </pre>
|
||||
*/
|
||||
public class AIREPObsType
|
||||
{
|
||||
private static final HashMap<String,Integer> AIREP_TYPES =
|
||||
new HashMap<String,Integer>();
|
||||
static {
|
||||
AIREP_TYPES.put("ARP",IDecoderConstants.AIREP_NORMAL);
|
||||
AIREP_TYPES.put("AIREP",IDecoderConstants.AIREP_NORMAL);
|
||||
AIREP_TYPES.put("ARS",IDecoderConstants.AIREP_SPECIAL);
|
||||
}
|
||||
|
||||
private final String obsType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param aType
|
||||
*/
|
||||
private AIREPObsType(String aType) {
|
||||
obsType = aType;
|
||||
} // AIREPObsType()
|
||||
|
||||
/**
|
||||
*
|
||||
* @param anObsType
|
||||
* @return
|
||||
*/
|
||||
public static AIREPObsType obsTypeFactory(String anObsType) {
|
||||
AIREPObsType obsTypeInstance = null;
|
||||
|
||||
if(AIREP_TYPES.containsKey(anObsType)) {
|
||||
obsTypeInstance = new AIREPObsType(anObsType);
|
||||
}
|
||||
return obsTypeInstance;
|
||||
} // obsTypeFactory()
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getValue() {
|
||||
return AIREP_TYPES.get(obsType);
|
||||
} // getValue()
|
||||
|
||||
public String getType() {
|
||||
return obsType;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<purgeRuleSet>
|
||||
<defaultRule>
|
||||
<versionsToKeep>24</versionsToKeep>
|
||||
<delta>=00-01:00:00</delta>
|
||||
<round>00-01:00:00</round>
|
||||
</defaultRule>
|
||||
</purgeRuleSet>
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<requestPatterns xmlns:ns2="group">
|
||||
<regex>^UA(US|PA|NT).. KWBC.*</regex>
|
||||
</requestPatterns>
|
|
@ -1,8 +0,0 @@
|
|||
#Wed Feb 09 14:51:45 CST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
@ -1,23 +0,0 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Airep
|
||||
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.airep
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.annotations,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.pointdata.spatial,
|
||||
com.raytheon.uf.common.serialization,
|
||||
com.raytheon.uf.common.time,
|
||||
com.vividsolutions.jts.geom,
|
||||
javax.measure.converter,
|
||||
javax.measure.quantity,
|
||||
javax.measure.unit,
|
||||
javax.persistence
|
||||
Require-Bundle: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
|
||||
org.hibernate;bundle-version="1.0.0"
|
||||
Export-Package: com.raytheon.uf.common.dataplugin.airep
|
|
@ -1 +0,0 @@
|
|||
com.raytheon.uf.common.dataplugin.airep.AirepRecord
|
|
@ -1,878 +0,0 @@
|
|||
/**
|
||||
* 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.uf.common.dataplugin.airep;
|
||||
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DateFormat;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.quantity.Angle;
|
||||
import javax.measure.quantity.Length;
|
||||
import javax.measure.quantity.Temperature;
|
||||
import javax.measure.quantity.Velocity;
|
||||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
import javax.measure.unit.Unit;
|
||||
import javax.persistence.Access;
|
||||
import javax.persistence.AccessType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Embedded;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.hibernate.annotations.Index;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.IDecoderGettable;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.geospatial.ISpatialEnabled;
|
||||
import com.raytheon.uf.common.pointdata.spatial.AircraftObsLocation;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 03, 2008 384 jkorman Initial Coding.
|
||||
* Jan 07, 2008 720 jkorman remove default assignments from
|
||||
* attributes.
|
||||
* Apr 05, 2012 435 dgilling Prevent NullPointerExceptions in
|
||||
* buildMessageData().
|
||||
* Apr 04, 2013 1846 bkowal Added an index on refTime and
|
||||
* forecastTime
|
||||
* Sep 11, 2012 1011 jkorman Added ability to report turbulence from
|
||||
* decoded TB group.
|
||||
* Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation.
|
||||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "airepseq")
|
||||
@Table(name = "airep", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "airep", indexes = { @Index(name = "airep_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class AirepRecord extends PluginDataObject implements ISpatialEnabled,
|
||||
IDecoderGettable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final Unit<Temperature> TEMPERATURE_UNIT = SI.CELSIUS;
|
||||
|
||||
public static final Unit<Velocity> WIND_SPEED_UNIT = NonSI.KNOT;
|
||||
|
||||
public static final Unit<Angle> WIND_DIR_UNIT = NonSI.DEGREE_ANGLE;
|
||||
|
||||
public static final Unit<Length> ALTITUDE_UNIT = NonSI.FOOT;
|
||||
|
||||
public static final Unit<Angle> LOCATION_UNIT = NonSI.DEGREE_ANGLE;
|
||||
|
||||
private static UnitConverter ftToHft = NonSI.FOOT.getConverterTo(SI
|
||||
.HECTO(NonSI.FOOT));
|
||||
|
||||
private static final HashMap<String, String> PARM_MAP = new HashMap<String, String>();
|
||||
|
||||
public static final int TURB_TYPE_CAT = 0x4;
|
||||
|
||||
public static final int TURB_TYPE_CHOP = 0x8;
|
||||
|
||||
public static final int TURB_TYPE_LLWS = 0xC;
|
||||
|
||||
public static final int TURB_FREQ_OCN = 0x1;
|
||||
|
||||
public static final int TURB_FREQ_INT = 0x2;
|
||||
|
||||
public static final int TURB_FREQ_CON = 0x3;
|
||||
|
||||
public static final int TURB_NEG = 0x00;
|
||||
|
||||
public static final int TURB_NEG_LGT = 0x10;
|
||||
|
||||
public static final int TURB_LGT = 0x20;
|
||||
|
||||
public static final int TURB_LGT_MOD = 0x30;
|
||||
|
||||
public static final int TURB_MOD = 0x40;
|
||||
|
||||
public static final int TURB_MOD_SEV = 0x50;
|
||||
|
||||
public static final int TURB_SEV = 0x60;
|
||||
|
||||
public static final int TURB_XTRM = 0x70;
|
||||
|
||||
// private static final HashMap<Integer, String> WX_MAP = new
|
||||
// HashMap<Integer, String>();
|
||||
|
||||
static {
|
||||
PARM_MAP.put("T", SFC_TEMP);
|
||||
PARM_MAP.put("WS", SFC_WNDSPD);
|
||||
PARM_MAP.put("WD", SFC_WNDDIR);
|
||||
PARM_MAP.put("NLAT", STA_LAT);
|
||||
PARM_MAP.put("NLON", STA_LON);
|
||||
PARM_MAP.put("FLT_LVL", UA_FLTLVL);
|
||||
|
||||
// WX_MAP.put(0, "CLR");
|
||||
// WX_MAP.put(1, "SCT");
|
||||
// WX_MAP.put(2, "BKN");
|
||||
// WX_MAP.put(3, "CONT");
|
||||
// WX_MAP.put(4, "LIGHTNING");
|
||||
// WX_MAP.put(5, "DZRA");
|
||||
// WX_MAP.put(6, "CONT RA");
|
||||
// WX_MAP.put(7, "CONT SN");
|
||||
// WX_MAP.put(8, "SH");
|
||||
// WX_MAP.put(9, "TSRA");
|
||||
}
|
||||
|
||||
private static final HashMap<String, Integer> TURB_MAP = new HashMap<String, Integer>();
|
||||
static {
|
||||
TURB_MAP.put("NEG", new Integer(TURB_NEG));
|
||||
TURB_MAP.put("SMOOTHLGT", new Integer(TURB_NEG_LGT));
|
||||
TURB_MAP.put("LGT", new Integer(TURB_LGT));
|
||||
TURB_MAP.put("LGTMOD", new Integer(TURB_LGT_MOD));
|
||||
TURB_MAP.put("MOD", new Integer(TURB_MOD));
|
||||
TURB_MAP.put("MODSEV", new Integer(TURB_MOD_SEV));
|
||||
TURB_MAP.put("SEV", new Integer(TURB_SEV));
|
||||
TURB_MAP.put("EXTRM", new Integer(TURB_XTRM));
|
||||
}
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
private Integer obsId;
|
||||
|
||||
// Time of the observation.
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
private Calendar timeObs;
|
||||
|
||||
// Time of the observation to the nearest hour.
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
private Calendar refHour;
|
||||
|
||||
//
|
||||
@DataURI(position = 1)
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
private Integer reportType;
|
||||
|
||||
// Text of the WMO header
|
||||
@Column(length = 32)
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private String wmoHeader;
|
||||
|
||||
// Correction indicator from wmo header
|
||||
@DataURI(position = 2)
|
||||
@Column(length = 8)
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private String corIndicator;
|
||||
|
||||
// Observation air temperature in degrees Kelvin.
|
||||
// Decimal(5,2)
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Double temp;
|
||||
|
||||
// Observation wind direction in angular degrees. Integer
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Integer windDirection;
|
||||
|
||||
// Observation wind speed in meters per second.
|
||||
// Decimal(5,2)
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Double windSpeed;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Integer flightHazard;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Integer flightWeather;
|
||||
|
||||
@Column
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
private Integer flightConditions;
|
||||
|
||||
@Embedded
|
||||
@DataURI(position = 3, embedded = true)
|
||||
@XmlElement
|
||||
@DynamicSerializeElement
|
||||
private AircraftObsLocation location;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public AirepRecord() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for DataURI construction through base class. This is used by
|
||||
* the notification service.
|
||||
*
|
||||
* @param uri
|
||||
* A data uri applicable to this class.
|
||||
* @param tableDef
|
||||
* The table definitions for this class.
|
||||
*/
|
||||
public AirepRecord(String uri) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
public Integer getObsId() {
|
||||
return obsId;
|
||||
}
|
||||
|
||||
public void setObsId(Integer obsId) {
|
||||
this.obsId = obsId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the wmoHeader
|
||||
*/
|
||||
public String getWmoHeader() {
|
||||
return wmoHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param wmoHeader
|
||||
* the wmoHeader to set
|
||||
*/
|
||||
public void setWmoHeader(String wmoHeader) {
|
||||
this.wmoHeader = wmoHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the report correction indicator.
|
||||
*
|
||||
* @return The corIndicator
|
||||
*/
|
||||
public String getCorIndicator() {
|
||||
return corIndicator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the report correction indicator.
|
||||
*
|
||||
* @param corIndicator
|
||||
* The corIndicator.
|
||||
*/
|
||||
public void setCorIndicator(String corIndicator) {
|
||||
this.corIndicator = corIndicator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the report data for this observation.
|
||||
*
|
||||
* @return The Report data.
|
||||
*/
|
||||
public String getReportData() {
|
||||
String s = null;
|
||||
if ((messageData != null) && (messageData instanceof String)) {
|
||||
s = (String) messageData;
|
||||
} else {
|
||||
s = buildMessageData();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the report data for this observation.
|
||||
*
|
||||
* @param reportData
|
||||
* The Report data.
|
||||
*/
|
||||
public void setReportData(String reportData) {
|
||||
messageData = reportData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get this observation's geometry.
|
||||
*
|
||||
* @return The geometry for this observation.
|
||||
*/
|
||||
public Geometry getGeometry() {
|
||||
return location.getGeometry();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the geometry latitude.
|
||||
*
|
||||
* @return The geometry latitude.
|
||||
*/
|
||||
public double getLatitude() {
|
||||
return location.getLatitude();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the geometry longitude.
|
||||
*
|
||||
* @return The geometry longitude.
|
||||
*/
|
||||
public double getLongitude() {
|
||||
return location.getLongitude();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the elevation, in meters, of the observing platform or location.
|
||||
*
|
||||
* @return The observation elevation, in meters.
|
||||
*/
|
||||
public Boolean getLocationDefined() {
|
||||
return location.getLocationDefined();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the station identifier for this observation.
|
||||
*
|
||||
* @return the stationId
|
||||
*/
|
||||
public String getStationId() {
|
||||
return location.getStationId();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the elevation, in meters, of the observing platform or location.
|
||||
*
|
||||
* @return The observation elevation, in meters.
|
||||
*/
|
||||
public Integer getFlightLevel() {
|
||||
return location.getFlightLevel();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the reportType
|
||||
*/
|
||||
public Integer getReportType() {
|
||||
return reportType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param reportType
|
||||
* the reportType to set
|
||||
*/
|
||||
public void setReportType(Integer reportType) {
|
||||
this.reportType = reportType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the timeObs
|
||||
*/
|
||||
public Calendar getTimeObs() {
|
||||
return timeObs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param timeObs
|
||||
* the timeObs to set
|
||||
*/
|
||||
public void setTimeObs(Calendar timeObs) {
|
||||
this.timeObs = timeObs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the refHour
|
||||
*/
|
||||
public Calendar getRefHour() {
|
||||
return refHour;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param refHour
|
||||
* the refHour to set
|
||||
*/
|
||||
public void setRefHour(Calendar refHour) {
|
||||
this.refHour = refHour;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the temp
|
||||
*/
|
||||
public Double getTemp() {
|
||||
return temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param temp
|
||||
* the temp to set
|
||||
*/
|
||||
public void setTemp(Double temp) {
|
||||
this.temp = temp;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the windDirection
|
||||
*/
|
||||
public Integer getWindDirection() {
|
||||
return windDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param windDirection
|
||||
* the windDirection to set
|
||||
*/
|
||||
public void setWindDirection(Integer windDirection) {
|
||||
this.windDirection = windDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the windspeed
|
||||
*/
|
||||
public Double getWindSpeed() {
|
||||
return windSpeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param windspeed
|
||||
* the windspeed to set
|
||||
*/
|
||||
public void setWindSpeed(Double windSpeed) {
|
||||
this.windSpeed = windSpeed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the flightHazard
|
||||
*/
|
||||
public Integer getFlightHazard() {
|
||||
return flightHazard;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flightHazard
|
||||
* the wx_past_1 to set
|
||||
*/
|
||||
public void setFlightHazard(Integer flightHazard) {
|
||||
this.flightHazard = flightHazard;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the flightWeather
|
||||
*/
|
||||
public Integer getFlightWeather() {
|
||||
return flightWeather;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flightWeather
|
||||
* the getFlightWeather to set
|
||||
*/
|
||||
public void setFlightWeather(Integer flightWeather) {
|
||||
this.flightWeather = flightWeather;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the flightConditions
|
||||
*/
|
||||
public Integer getFlightConditions() {
|
||||
return flightConditions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param flightConditions
|
||||
* the flightConditions to set
|
||||
*/
|
||||
public void setFlightConditions(Integer flightConditions) {
|
||||
this.flightConditions = flightConditions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDataURI(String dataURI) {
|
||||
super.setDataURI(dataURI);
|
||||
identifier = dataURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the IDecoderGettable reference for this record.
|
||||
*
|
||||
* @return The IDecoderGettable reference for this record.
|
||||
*/
|
||||
@Override
|
||||
public IDecoderGettable getDecoderGettable() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of a parameter that is represented as a String.
|
||||
*
|
||||
* @param paramName
|
||||
* The name of the parameter value to retrieve.
|
||||
* @return The String value of the parameter. If the parameter is unknown, a
|
||||
* null reference is returned.
|
||||
*/
|
||||
@Override
|
||||
public String getString(String paramName) {
|
||||
if ("STA".matches(paramName)) {
|
||||
return this.getStationId();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value and units of a named parameter within this observation.
|
||||
*
|
||||
* @param paramName
|
||||
* The name of the parameter value to retrieve.
|
||||
* @return An Amount with value and units. If the parameter is unknown, a
|
||||
* null reference is returned.
|
||||
*/
|
||||
@Override
|
||||
public Amount getValue(String paramName) {
|
||||
Amount a = null;
|
||||
|
||||
String pName = PARM_MAP.get(paramName);
|
||||
|
||||
if (SFC_TEMP.equals(pName) && (temp != null)) {
|
||||
a = new Amount(temp, TEMPERATURE_UNIT);
|
||||
} else if (SFC_WNDSPD.equals(pName) && (windSpeed != null)) {
|
||||
a = new Amount(windSpeed, WIND_SPEED_UNIT);
|
||||
} else if (SFC_WNDDIR.equals(pName) && (windDirection != null)) {
|
||||
a = new Amount(windDirection, WIND_DIR_UNIT);
|
||||
} else if (STA_LAT.equals(pName)) {
|
||||
a = new Amount(this.getLatitude(), LOCATION_UNIT);
|
||||
} else if (STA_LON.equals(pName)) {
|
||||
a = new Amount(this.getLongitude(), LOCATION_UNIT);
|
||||
} else if (UA_FLTLVL.equals(pName) && (getFlightLevel() != null)) {
|
||||
a = new Amount(this.getFlightLevel().intValue(), ALTITUDE_UNIT);
|
||||
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the value of a parameter that is represented as a String.
|
||||
*
|
||||
* @param paramName
|
||||
* The name of the parameter value to retrieve.
|
||||
* @return The String value of the parameter. If the parameter is unknown, a
|
||||
* null reference is returned.
|
||||
*/
|
||||
@Override
|
||||
public Collection<Amount> getValues(String paramName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the String representation of various AIREP parameters.
|
||||
*
|
||||
* @param The
|
||||
* parameter value to get.
|
||||
* @return A String array representing the value. A null reference may be
|
||||
* returned if the parameter does not exist or cannot be
|
||||
* represented.
|
||||
*/
|
||||
@Override
|
||||
public String[] getStrings(String paramName) {
|
||||
String[] retValue = null;
|
||||
String value = null;
|
||||
|
||||
if ("FLT_HZD".matches(paramName) && (flightHazard != null)) {
|
||||
if (flightHazard != null) {
|
||||
retValue = new String[] { flightHazard.toString() };
|
||||
}
|
||||
} else if ("TBI".matches(paramName) && (flightConditions != null)) {
|
||||
int turb = flightConditions >> 4;
|
||||
// Is there turbulence to decode?
|
||||
if ((turb & 0x80) > 0) {
|
||||
// get the intensity
|
||||
switch (turb & 0x70) {
|
||||
case TURB_NEG: {
|
||||
value = "NEG";
|
||||
break;
|
||||
}
|
||||
case TURB_NEG_LGT: {
|
||||
value = "SMOOTHLGT";
|
||||
break;
|
||||
}
|
||||
case TURB_LGT: {
|
||||
value = "LGT";
|
||||
break;
|
||||
}
|
||||
case TURB_LGT_MOD: {
|
||||
value = "LGTMOD";
|
||||
break;
|
||||
}
|
||||
case TURB_MOD: {
|
||||
value = "MOD";
|
||||
break;
|
||||
}
|
||||
case TURB_MOD_SEV: {
|
||||
value = "MODSEV";
|
||||
break;
|
||||
}
|
||||
case TURB_SEV: {
|
||||
value = "SEV";
|
||||
break;
|
||||
}
|
||||
case TURB_XTRM: {
|
||||
value = "EXTRM";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("TBF".matches(paramName) && (flightConditions != null)) {
|
||||
int turb = flightConditions >> 4;
|
||||
// Is there turbulence to decode?
|
||||
if ((turb & 0x80) > 0) {
|
||||
// get the intensity
|
||||
switch (turb & 0x03) {
|
||||
case TURB_FREQ_OCN: {
|
||||
value = "OCN";
|
||||
break;
|
||||
}
|
||||
case TURB_FREQ_INT: {
|
||||
value = "INT";
|
||||
break;
|
||||
}
|
||||
case TURB_FREQ_CON: {
|
||||
value = "CON";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (value != null) {
|
||||
retValue = new String[] { value };
|
||||
}
|
||||
return retValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AircraftObsLocation getSpatialObject() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public AircraftObsLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(AircraftObsLocation location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessageData() {
|
||||
return getReportData();
|
||||
}
|
||||
|
||||
private String buildMessageData() {
|
||||
boolean validLocation = (location != null);
|
||||
|
||||
StringBuilder messageData = new StringBuilder("ARP ");
|
||||
if (validLocation && (getStationId() != null)) {
|
||||
messageData.append(getStationId());
|
||||
}
|
||||
messageData.append(' ');
|
||||
|
||||
if ((validLocation) && (!Double.isNaN(getLatitude()))
|
||||
&& (!Double.isNaN(getLongitude()))) {
|
||||
messageData.append(formatLatLon(getLatitude(), true));
|
||||
messageData.append(' ');
|
||||
messageData.append(formatLatLon(getLongitude(), false));
|
||||
messageData.append(' ');
|
||||
}
|
||||
|
||||
if (timeObs != null) {
|
||||
DateFormat df = new SimpleDateFormat("HHmm");
|
||||
messageData.append(df.format(timeObs.getTime()));
|
||||
}
|
||||
messageData.append(" F");
|
||||
|
||||
if (validLocation && (getFlightLevel() != null)) {
|
||||
int flightLevel = (int) ftToHft.convert(getFlightLevel());
|
||||
messageData.append(flightLevel);
|
||||
}
|
||||
messageData.append(' ');
|
||||
|
||||
if (temp != null) {
|
||||
if (temp > 0) {
|
||||
messageData.append('P');
|
||||
} else {
|
||||
messageData.append('M');
|
||||
}
|
||||
messageData.append(Math.abs(temp.intValue()));
|
||||
}
|
||||
messageData.append(' ');
|
||||
|
||||
if ((windDirection != null) && (windSpeed != null)) {
|
||||
messageData.append(windDirection.intValue());
|
||||
messageData.append('/');
|
||||
messageData.append(windSpeed.intValue());
|
||||
messageData.append("KT");
|
||||
}
|
||||
if (flightConditions != null) {
|
||||
int turb = flightConditions >> 4;
|
||||
if ((turb & 0x80) > 0) {
|
||||
messageData.append(" TB");
|
||||
String[] data = getStrings("TBF");
|
||||
if ((data != null) && (data.length == 1)) {
|
||||
messageData.append(" ");
|
||||
messageData.append(data[0]);
|
||||
}
|
||||
data = getStrings("TBI");
|
||||
if ((data != null) && (data.length == 1)) {
|
||||
messageData.append(" ");
|
||||
messageData.append(data[0]);
|
||||
}
|
||||
String type = null;
|
||||
switch (turb & 0xC) {
|
||||
case TURB_TYPE_CAT: {
|
||||
type = "CAT";
|
||||
break;
|
||||
}
|
||||
case TURB_TYPE_CHOP: {
|
||||
type = "CHOP";
|
||||
break;
|
||||
}
|
||||
case TURB_TYPE_LLWS: {
|
||||
type = "LLWS";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (type != null) {
|
||||
messageData.append(" ");
|
||||
messageData.append(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
return messageData.toString();
|
||||
}
|
||||
|
||||
private String formatLatLon(double value, boolean isLatitude) {
|
||||
char dir;
|
||||
if (isLatitude) {
|
||||
if (value > 0) {
|
||||
dir = 'N';
|
||||
} else {
|
||||
dir = 'S';
|
||||
}
|
||||
} else {
|
||||
if (value > 0) {
|
||||
dir = 'E';
|
||||
} else {
|
||||
dir = 'W';
|
||||
}
|
||||
}
|
||||
|
||||
DecimalFormat df = new DecimalFormat("###.000");
|
||||
df.setRoundingMode(RoundingMode.DOWN);
|
||||
|
||||
return df.format(Math.abs(value)) + dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the hashCode for this object. This implementation returns the
|
||||
* hashCode of the generated dataURI.
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = (prime * result)
|
||||
+ ((getDataURI() == null) ? 0 : getDataURI().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this record is equal to another by checking the generated
|
||||
* dataURI.
|
||||
*
|
||||
* @param obj
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AirepRecord other = (AirepRecord) obj;
|
||||
if (getDataURI() == null) {
|
||||
if (other.getDataURI() != null) {
|
||||
return false;
|
||||
}
|
||||
} else if (!getDataURI().equals(other.getDataURI())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Column
|
||||
@Access(AccessType.PROPERTY)
|
||||
public String getDataURI() {
|
||||
return super.getDataURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "airep";
|
||||
}
|
||||
}
|
|
@ -122,13 +122,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.edex.plugin.airep"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.edex.plugin.ccfp"
|
||||
download-size="0"
|
||||
|
@ -311,13 +304,6 @@
|
|||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.dataplugin.airep"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.common.dataplugin.obs"
|
||||
download-size="0"
|
||||
|
|
|
@ -256,7 +256,7 @@
|
|||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="gov.noaa.nws.ncep.common.dataplugin.ncairep"
|
||||
id="gov.noaa.nws.ncep.common.dataplugin.airep"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
|
@ -347,7 +347,7 @@
|
|||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="gov.noaa.nws.ncep.edex.plugin.ncairep"
|
||||
id="gov.noaa.nws.ncep.edex.plugin.airep"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.common.dataplugin.airep</name>
|
||||
<name>gov.noaa.nws.ncep.common.dataplugin.airep</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
|
@ -1,7 +1,7 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Ncpirep Plug-in
|
||||
Bundle-SymbolicName: gov.noaa.nws.ncep.common.dataplugin.ncairep
|
||||
Bundle-Name: Airep Plug-in
|
||||
Bundle-SymbolicName: gov.noaa.nws.ncep.common.dataplugin.airep
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
|
@ -31,6 +31,6 @@ Import-Package: com.raytheon.edex.db.dao,
|
|||
javax.measure.unit,
|
||||
javax.persistence,
|
||||
org.springframework.orm.hibernate3
|
||||
Export-Package: gov.noaa.nws.ncep.common.dataplugin.ncairep,
|
||||
gov.noaa.nws.ncep.common.dataplugin.ncairep.dao
|
||||
Export-Package: gov.noaa.nws.ncep.common.dataplugin.airep,
|
||||
gov.noaa.nws.ncep.common.dataplugin.airep.dao
|
||||
|
|
@ -0,0 +1 @@
|
|||
gov.noaa.nws.ncep.common.dataplugin.airep.AirepRecord
|
|
@ -1,4 +1,4 @@
|
|||
package gov.noaa.nws.ncep.common.dataplugin.ncairep;
|
||||
package gov.noaa.nws.ncep.common.dataplugin.airep;
|
||||
|
||||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
|
@ -20,7 +20,7 @@ package gov.noaa.nws.ncep.common.dataplugin.ncairep;
|
|||
* further licensing information.
|
||||
**/
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.ncairep.dao.NcAirepDao;
|
||||
import gov.noaa.nws.ncep.common.dataplugin.airep.dao.AirepDao;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
@ -37,8 +37,7 @@ import com.raytheon.uf.common.pointdata.spatial.AircraftObsLocation;
|
|||
import com.raytheon.uf.common.time.DataTime;
|
||||
|
||||
/**
|
||||
* Provides a transform from NcAirepRecords to PointDataContainer and vice
|
||||
* versa.
|
||||
* Provides a transform from AirepRecords to PointDataContainer and vice versa.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -52,13 +51,14 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
* fields for TB, IC and SK.
|
||||
* Oct 18, 2011 286 Q.Zhou Fixed datarui in db
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Sep 05, 2013 2316 bsteffen Unify airep and ncairep.
|
||||
* </pre>
|
||||
*
|
||||
* @author f j yen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class NcAirepPointDataTransform {
|
||||
public class AirepPointDataTransform {
|
||||
|
||||
private static final String WIND_SPEED = "windSpeed";
|
||||
|
||||
|
@ -149,13 +149,13 @@ public class NcAirepPointDataTransform {
|
|||
ALL_PARAMS_LIST = sb.toString();
|
||||
}
|
||||
|
||||
private NcAirepDao dao;
|
||||
private AirepDao dao;
|
||||
|
||||
private PointDataDescription description;
|
||||
|
||||
public NcAirepPointDataTransform() {
|
||||
public AirepPointDataTransform() {
|
||||
try {
|
||||
this.dao = new NcAirepDao("ncairep");
|
||||
this.dao = new AirepDao("airep");
|
||||
this.description = dao.getPointDataDescription(null);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
@ -167,7 +167,7 @@ public class NcAirepPointDataTransform {
|
|||
|
||||
long t0 = System.currentTimeMillis();
|
||||
System.out.println("===============>toPointData"); // in
|
||||
// NcAirepPointDataTransform
|
||||
// AirepPointDataTransform
|
||||
// t0=" + t0);
|
||||
/* 999 */
|
||||
|
||||
|
@ -176,7 +176,7 @@ public class NcAirepPointDataTransform {
|
|||
|
||||
for (PluginDataObject p : pdo) {
|
||||
|
||||
if (!(p instanceof NcAirepRecord)) {
|
||||
if (!(p instanceof AirepRecord)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ public class NcAirepPointDataTransform {
|
|||
|
||||
}
|
||||
|
||||
NcAirepRecord nar = (NcAirepRecord) p;
|
||||
AirepRecord nar = (AirepRecord) p;
|
||||
PointDataView pdv = buildView(pdc, nar);
|
||||
nar.setPointDataView(pdv);
|
||||
|
||||
|
@ -202,7 +202,7 @@ public class NcAirepPointDataTransform {
|
|||
}
|
||||
|
||||
private PointDataView buildView(PointDataContainer container,
|
||||
NcAirepRecord record) {
|
||||
AirepRecord record) {
|
||||
PointDataView pdv = container.append();
|
||||
if (record.getCorIndicator() != null) {
|
||||
pdv.setString(CORRECTION_CODE, record.getCorIndicator());
|
||||
|
@ -233,8 +233,8 @@ public class NcAirepPointDataTransform {
|
|||
return pdv;
|
||||
}
|
||||
|
||||
public static NcAirepRecord toNcAirepRecord(PointDataView pdv) {
|
||||
NcAirepRecord nar = new NcAirepRecord();
|
||||
public static AirepRecord toAirepRecord(PointDataView pdv) {
|
||||
AirepRecord nar = new AirepRecord();
|
||||
nar.setObsId(pdv.getInt(OBS_ID));
|
||||
|
||||
nar.setCorIndicator(pdv.getString(CORRECTION_CODE));
|
||||
|
@ -265,13 +265,13 @@ public class NcAirepPointDataTransform {
|
|||
return nar;
|
||||
}
|
||||
|
||||
public static NcAirepRecord[] toNcAirepRecords(PointDataContainer container) {
|
||||
List<NcAirepRecord> records = new ArrayList<NcAirepRecord>();
|
||||
public static AirepRecord[] toAirepRecords(PointDataContainer container) {
|
||||
List<AirepRecord> records = new ArrayList<AirepRecord>();
|
||||
container.setCurrentSz(container.getAllocatedSz());
|
||||
for (int i = 0; i < container.getCurrentSz(); i++) {
|
||||
PointDataView pdv = container.readRandom(i);
|
||||
records.add(toNcAirepRecord(pdv));
|
||||
records.add(toAirepRecord(pdv));
|
||||
}
|
||||
return records.toArray(new NcAirepRecord[records.size()]);
|
||||
return records.toArray(new AirepRecord[records.size()]);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package gov.noaa.nws.ncep.common.dataplugin.ncairep;
|
||||
package gov.noaa.nws.ncep.common.dataplugin.airep;
|
||||
|
||||
/**
|
||||
* This software was modified from Raytheon's pirep plugin by
|
||||
|
@ -52,7 +52,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
||||
/**
|
||||
* NcAirepRecord is the Data Access component for pirep observation data.
|
||||
* AirepRecord is the Data Access component for pirep observation data.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -77,6 +77,7 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* May 07, 2013 1869 bsteffen Remove dataURI column from
|
||||
* PluginDataObject.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Sep 05, 2013 2316 bsteffen Unify airep and ncairep.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -85,18 +86,18 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
*/
|
||||
|
||||
@Entity
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "ncairepseq")
|
||||
@Table(name = "ncairep", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
@SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "airepseq")
|
||||
@Table(name = "airep", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) })
|
||||
/*
|
||||
* Both refTime and forecastTime are included in the refTimeIndex since
|
||||
* forecastTime is unlikely to be used.
|
||||
*/
|
||||
@org.hibernate.annotations.Table(appliesTo = "ncairep", indexes = { @Index(name = "ncairep_refTimeIndex", columnNames = {
|
||||
@org.hibernate.annotations.Table(appliesTo = "airep", indexes = { @Index(name = "airep_refTimeIndex", columnNames = {
|
||||
"refTime", "forecastTime" }) })
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class NcAirepRecord extends PluginDataObject implements ISpatialEnabled,
|
||||
public class AirepRecord extends PluginDataObject implements ISpatialEnabled,
|
||||
IDecoderGettable, IPointData, IPersistable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -291,7 +292,7 @@ public class NcAirepRecord extends PluginDataObject implements ISpatialEnabled,
|
|||
/**
|
||||
*
|
||||
*/
|
||||
public NcAirepRecord() {
|
||||
public AirepRecord() {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -303,7 +304,7 @@ public class NcAirepRecord extends PluginDataObject implements ISpatialEnabled,
|
|||
* @param tableDef
|
||||
* The table definitions for this class.
|
||||
*/
|
||||
public NcAirepRecord(String uri) {
|
||||
public AirepRecord(String uri) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
|
@ -848,7 +849,7 @@ public class NcAirepRecord extends PluginDataObject implements ISpatialEnabled,
|
|||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
NcAirepRecord other = (NcAirepRecord) obj;
|
||||
AirepRecord other = (AirepRecord) obj;
|
||||
if (getDataURI() == null) {
|
||||
if (other.getDataURI() != null) {
|
||||
return false;
|
||||
|
@ -899,6 +900,6 @@ public class NcAirepRecord extends PluginDataObject implements ISpatialEnabled,
|
|||
|
||||
@Override
|
||||
public String getPluginName() {
|
||||
return "ncairep";
|
||||
return "airep";
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package gov.noaa.nws.ncep.common.dataplugin.ncairep.dao;
|
||||
package gov.noaa.nws.ncep.common.dataplugin.airep.dao;
|
||||
|
||||
/**
|
||||
* This software was modified from Raytheon's pirep plugin by
|
||||
|
@ -6,9 +6,10 @@ package gov.noaa.nws.ncep.common.dataplugin.ncairep.dao;
|
|||
**/
|
||||
//uf.common.status.IUFStatusHandler cannot be resolved. It is indirectly
|
||||
//referenced from required .class files
|
||||
import gov.noaa.nws.ncep.common.dataplugin.ncairep.NcAirepRecord;
|
||||
import gov.noaa.nws.ncep.common.dataplugin.airep.AirepRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
|
@ -29,22 +30,23 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 04/28/2011 F. J. Yen Initial creation from airep
|
||||
* 08/31/2011 286 qzhou Moved this from ~edex.plugin.pirep
|
||||
* Sep 05, 2013 2316 bsteffen Unify airep and ncairep.
|
||||
* </pre>
|
||||
*
|
||||
* @author qzhou
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class NcAirepDao extends PointDataPluginDao<NcAirepRecord> {
|
||||
public class AirepDao extends PointDataPluginDao<AirepRecord> {
|
||||
|
||||
private PointDataDescription pdd;
|
||||
|
||||
/**
|
||||
* Creates a new NcAirepDao
|
||||
* Creates a new AirepDao
|
||||
*
|
||||
* @throws PluginException
|
||||
*/
|
||||
public NcAirepDao(String pluginName) throws PluginException {
|
||||
public AirepDao(String pluginName) throws PluginException {
|
||||
super(pluginName);
|
||||
}
|
||||
|
||||
|
@ -55,14 +57,14 @@ public class NcAirepDao extends PointDataPluginDao<NcAirepRecord> {
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieves an NcAirep report using the datauri .
|
||||
* Retrieves an Airep report using the datauri .
|
||||
*
|
||||
* @param dataURI
|
||||
* The dataURI to match against.
|
||||
* @return The report record if it exists.
|
||||
*/
|
||||
public NcAirepRecord queryByDataURI(String dataURI) {
|
||||
NcAirepRecord report = null;
|
||||
public AirepRecord queryByDataURI(String dataURI) {
|
||||
AirepRecord report = null;
|
||||
List<?> obs = null;
|
||||
try {
|
||||
obs = queryBySingleCriteria("dataURI", dataURI);
|
||||
|
@ -70,7 +72,7 @@ public class NcAirepDao extends PointDataPluginDao<NcAirepRecord> {
|
|||
e.printStackTrace();
|
||||
}
|
||||
if ((obs != null) && (obs.size() > 0)) {
|
||||
report = (NcAirepRecord) obs.get(0);
|
||||
report = (AirepRecord) obs.get(0);
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
@ -85,7 +87,7 @@ public class NcAirepDao extends PointDataPluginDao<NcAirepRecord> {
|
|||
*/
|
||||
public Object[] queryDataUriColumn(final String dataUri) {
|
||||
|
||||
String sql = "select datauri from awips.ncairep where datauri='"
|
||||
String sql = "select datauri from awips.airep where datauri='"
|
||||
+ dataUri + "';";
|
||||
|
||||
Object[] results = executeSQLQuery(sql);
|
||||
|
@ -99,13 +101,13 @@ public class NcAirepDao extends PointDataPluginDao<NcAirepRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public NcAirepRecord newObject() {
|
||||
return new NcAirepRecord();
|
||||
public AirepRecord newObject() {
|
||||
return new AirepRecord();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPointDataFileName(NcAirepRecord p) {
|
||||
return "ncairep.h5";
|
||||
public String getPointDataFileName(AirepRecord p) {
|
||||
return "airep.h5";
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -127,7 +129,7 @@ public class NcAirepDao extends PointDataPluginDao<NcAirepRecord> {
|
|||
if (pdd == null) {
|
||||
|
||||
pdd = PointDataDescription.fromStream(this.getClass()
|
||||
.getResourceAsStream("/res/pointdata/ncairep.xml"));
|
||||
.getResourceAsStream("/res/pointdata/airep.xml"));
|
||||
}
|
||||
return pdd;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>gov.noaa.nws.ncep.common.dataplugin.ncairep</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -1 +0,0 @@
|
|||
gov.noaa.nws.ncep.common.dataplugin.ncairep.NcAirepRecord
|
|
@ -1,4 +0,0 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
|
@ -7,7 +7,7 @@
|
|||
<constraint constraintValue="AIREP" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="ncairep" constraintType="EQUALS"/>
|
||||
<constraint constraintValue="airep" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
</baseConstraints>
|
||||
</NcInventoryDefinition>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<constraint constraintValue="AIREP" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="ncairep" constraintType="EQUALS"/>
|
||||
<constraint constraintValue="airep" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
</baseConstraints>
|
||||
</NcInventoryDefinition>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.edex.plugin.airep</name>
|
||||
<name>gov.noaa.nws.ncep.edex.plugin.airep</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
|
@ -1,7 +1,7 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Ncairep
|
||||
Bundle-SymbolicName: gov.noaa.nws.ncep.edex.plugin.ncairep
|
||||
Bundle-Name: Airep
|
||||
Bundle-SymbolicName: gov.noaa.nws.ncep.edex.plugin.airep
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
|
||||
Bundle-Vendor: NOAA/NWS/NCEP/NCO/SIB
|
||||
|
@ -14,9 +14,9 @@ Require-Bundle: com.raytheon.edex.common;bundle-version="1.12.1174",
|
|||
javax.persistence;bundle-version="1.0.0",
|
||||
org.apache.camel;bundle-version="1.0.0";resolution:=optional,
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
gov.noaa.nws.ncep.common.dataplugin.ncairep;bundle-version="1.0.0"
|
||||
Export-Package: gov.noaa.nws.ncep.edex.plugin.ncairep,
|
||||
gov.noaa.nws.ncep.edex.plugin.ncairep.decoder
|
||||
gov.noaa.nws.ncep.common.dataplugin.airep;bundle-version="1.0.0"
|
||||
Export-Package: gov.noaa.nws.ncep.edex.plugin.airep,
|
||||
gov.noaa.nws.ncep.edex.plugin.airep.decoder
|
||||
Import-Package: com.raytheon.uf.edex.pointdata,
|
||||
gov.noaa.nws.ncep.common.tools,
|
||||
gov.noaa.nws.ncep.edex.util,
|
|
@ -0,0 +1 @@
|
|||
gov.noaa.nws.ncep.common.dataplugin.airep.AirepRecord
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
<bean id="airepProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
|
||||
<property name="pluginName" ref="airepPluginName" />
|
||||
<property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.airep" />
|
||||
<property name="dao" value="com.raytheon.edex.plugin.airep.dao.AirepDao" />
|
||||
<property name="record" value="com.raytheon.uf.common.dataplugin.airep.AirepRecord" />
|
||||
<property name="pluginFQN" value="gov.noaa.nws.ncep.common.dataplugin.airep" />
|
||||
<property name="dao" value="gov.noaa.nws.ncep.common.dataplugin.airep.dao.AirepDao" />
|
||||
<property name="record" value="gov.noaa.nws.ncep.common.dataplugin.airep.AirepRecord" />
|
||||
</bean>
|
||||
|
||||
<bean factory-bean="pluginRegistry" factory-method="register">
|
|
@ -3,11 +3,13 @@
|
|||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="airepDecoder" class="com.raytheon.edex.plugin.airep.AirepDecoder">
|
||||
<bean id="airepDecoder" class="gov.noaa.nws.ncep.edex.plugin.airep.AirepDecoder">
|
||||
<constructor-arg ref="airepPluginName" />
|
||||
</bean>
|
||||
|
||||
<bean id="airepSeparator" class="com.raytheon.edex.plugin.airep.AirepSeparator" />
|
||||
<bean id="airepPointData" class="gov.noaa.nws.ncep.common.dataplugin.airep.AirepPointDataTransform"/>
|
||||
|
||||
<bean id="airepSeparator" class="gov.noaa.nws.ncep.edex.plugin.airep.AirepSeparator" />
|
||||
|
||||
<bean id="airepDistRegistry" factory-bean="distributionSrv"
|
||||
factory-method="register">
|
||||
|
@ -18,13 +20,13 @@
|
|||
<bean id="airepCamelRegistered" factory-bean="contextManager"
|
||||
factory-method="register" depends-on="persistCamelRegistered">
|
||||
<constructor-arg ref="airep-camel"/>
|
||||
</bean>
|
||||
|
||||
</bean>
|
||||
|
||||
<camelContext id="airep-camel"
|
||||
xmlns="http://camel.apache.org/schema/spring"
|
||||
errorHandlerRef="errorHandler"
|
||||
autoStartup="false">
|
||||
<!--
|
||||
|
||||
<endpoint id="airepFileEndpoint" uri="file:${edex.home}/data/sbn/airep?noop=true&idempotent=false" />
|
||||
|
||||
<route id="airepFileConsumerRoute">
|
||||
|
@ -35,11 +37,11 @@
|
|||
</setHeader>
|
||||
<to uri="jms-generic:queue:Ingest.airep" />
|
||||
</route>
|
||||
-->
|
||||
|
||||
|
||||
<!-- Begin airep routes -->
|
||||
<route id="airepIngestRoute">
|
||||
<from uri="jms-generic:queue:Ingest.airep?destinationResolver=#qpidDurableResolver" />
|
||||
<from uri="jms-generic:queue:Ingest.airep" />
|
||||
<setHeader headerName="pluginName">
|
||||
<constant>airep</constant>
|
||||
</setHeader>
|
||||
|
@ -51,18 +53,22 @@
|
|||
<doTry>
|
||||
<pipeline>
|
||||
<bean ref="airepDecoder" method="decode" />
|
||||
<to uri="direct-vm:indexAlert" />
|
||||
<!-- Add next line for h5 version and change next
|
||||
line from indexAlert to persistIndexAlert" /-->
|
||||
<bean ref="airepPointData" method="toPointData" />
|
||||
<!-- to uri="direct-vm:indexAlert" /-->
|
||||
<to uri="direct-vm:persistIndexAlert" />
|
||||
</pipeline>
|
||||
<doCatch>
|
||||
<exception>java.lang.Throwable</exception>
|
||||
<to uri="log:airep?level=ERROR"/>
|
||||
<to uri="log:airep?level=ERROR" />
|
||||
</doCatch>
|
||||
</doTry>
|
||||
</split>
|
||||
</pipeline>
|
||||
<doCatch>
|
||||
<exception>java.lang.Throwable</exception>
|
||||
<to uri="log:airep?level=ERROR"/>
|
||||
<to uri="log:airep?level=ERROR" />
|
||||
</doCatch>
|
||||
</doTry>
|
||||
</route>
|
|
@ -2,11 +2,11 @@
|
|||
* This software was modified from Raytheon's airep plugin by
|
||||
* NOAA/NWS/NCEP/NCO to order to output point data in HDF5.
|
||||
**/
|
||||
package gov.noaa.nws.ncep.edex.plugin.ncairep;
|
||||
package gov.noaa.nws.ncep.edex.plugin.airep;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.ncairep.NcAirepRecord;
|
||||
import gov.noaa.nws.ncep.edex.plugin.ncairep.decoder.NcAIREPWeather;
|
||||
import gov.noaa.nws.ncep.edex.plugin.ncairep.decoder.NcAirepParser;
|
||||
import gov.noaa.nws.ncep.common.dataplugin.airep.AirepRecord;
|
||||
import gov.noaa.nws.ncep.edex.plugin.airep.decoder.AIREPWeather;
|
||||
import gov.noaa.nws.ncep.edex.plugin.airep.decoder.AirepParser;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
|
@ -23,7 +23,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
|||
/**
|
||||
* Decoder strategy for Aicraft Report (AIREP) observation data. Most common
|
||||
* usage is as follows. <code>
|
||||
* NcAIREPDecoder dec = new NcAIREPDecoder();
|
||||
* AirepDecoder dec = new AirepDecoder();
|
||||
* dec.setMessage(messageData);
|
||||
* while(dec.hasNext())
|
||||
* {
|
||||
|
@ -43,16 +43,17 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
|||
* Sep 19, 2011 286 Q.Zhou Modified populateRecord to add 8 new
|
||||
* fields for TB, IC and SK.
|
||||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* Sep 05, 2013 2316 bsteffen Unify airep and ncairep.
|
||||
* </pre>
|
||||
*
|
||||
* @author F. J. Yen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class NcAirepDecoder extends AbstractDecoder {
|
||||
public class AirepDecoder extends AbstractDecoder {
|
||||
// Name of the plugin controlling this decoder.
|
||||
private final String PLUGIN_NAME;
|
||||
|
||||
public static class NcAirepDecoderInput {
|
||||
public static class AirepDecoderInput {
|
||||
public WMOHeader wmoHeader;
|
||||
|
||||
public String report;
|
||||
|
@ -63,7 +64,7 @@ public class NcAirepDecoder extends AbstractDecoder {
|
|||
* Name that identifies this decoder.
|
||||
* @throws DecoderException
|
||||
*/
|
||||
public NcAirepDecoder(String pluginName) throws DecoderException {
|
||||
public AirepDecoder(String pluginName) throws DecoderException {
|
||||
PLUGIN_NAME = pluginName;
|
||||
}
|
||||
|
||||
|
@ -76,21 +77,21 @@ public class NcAirepDecoder extends AbstractDecoder {
|
|||
* @throws DecoderException
|
||||
* Thrown if no data is available.
|
||||
*/
|
||||
public PluginDataObject[] decode(NcAirepDecoderInput input)
|
||||
public PluginDataObject[] decode(AirepDecoderInput input)
|
||||
throws DecoderException {
|
||||
|
||||
PluginDataObject[] reports = null;
|
||||
|
||||
NcAirepRecord report = null;
|
||||
AirepRecord report = null;
|
||||
String traceId = null;
|
||||
System.out.println("====" + new String(input.report)); // input.report
|
||||
// );
|
||||
|
||||
try {
|
||||
// traceId = getTraceId(hdrMap);
|
||||
logger.debug(traceId + "- NcAirepDecoder.decode()");
|
||||
logger.debug(traceId + "- AirepDecoder.decode()");
|
||||
|
||||
report = populateRecord(new NcAirepParser(input.report));
|
||||
report = populateRecord(new AirepParser(input.report));
|
||||
|
||||
if (report != null) {
|
||||
report.setTraceId(traceId);
|
||||
|
@ -105,7 +106,7 @@ public class NcAirepDecoder extends AbstractDecoder {
|
|||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error(traceId + "- Error in NcAirepDecoder", e);
|
||||
logger.error(traceId + "- Error in AirepDecoder", e);
|
||||
} finally {
|
||||
if (reports == null) {
|
||||
reports = new PluginDataObject[0];
|
||||
|
@ -121,9 +122,9 @@ public class NcAirepDecoder extends AbstractDecoder {
|
|||
* The reccon parser that contains the decoded data.
|
||||
* @return The populated record.
|
||||
*/
|
||||
private NcAirepRecord populateRecord(NcAirepParser parser) {
|
||||
private AirepRecord populateRecord(AirepParser parser) {
|
||||
|
||||
NcAirepRecord record = null;
|
||||
AirepRecord record = null;
|
||||
AircraftObsLocation location = null;
|
||||
|
||||
if (parser != null) {
|
||||
|
@ -132,7 +133,7 @@ public class NcAirepDecoder extends AbstractDecoder {
|
|||
|
||||
if (oTime != null) {
|
||||
|
||||
record = new NcAirepRecord();
|
||||
record = new AirepRecord();
|
||||
location = new AircraftObsLocation();
|
||||
|
||||
record.setTimeObs(oTime);
|
||||
|
@ -153,7 +154,7 @@ public class NcAirepDecoder extends AbstractDecoder {
|
|||
record.setWindSpeed(parser.getWindSpeed());
|
||||
record.setLocation(location);
|
||||
|
||||
NcAIREPWeather wx = parser.getWeatherGroup();
|
||||
AIREPWeather wx = parser.getWeatherGroup();
|
||||
if (wx != null) {
|
||||
record.setFlightConditions(wx.getFlightConditions());
|
||||
record.setFlightHazard(wx.getHazard());
|
|
@ -2,7 +2,9 @@
|
|||
* This software was modified from Raytheon's airep plugin by
|
||||
* NOAA/NWS/NCEP/NCO to order to output point data in HDF5.
|
||||
**/
|
||||
package gov.noaa.nws.ncep.edex.plugin.ncairep;
|
||||
package gov.noaa.nws.ncep.edex.plugin.airep;
|
||||
|
||||
import gov.noaa.nws.ncep.edex.plugin.airep.AirepDecoder.AirepDecoderInput;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -15,10 +17,9 @@ import org.apache.commons.logging.LogFactory;
|
|||
import com.raytheon.edex.esb.Headers;
|
||||
import com.raytheon.edex.plugin.AbstractRecordSeparator;
|
||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||
import gov.noaa.nws.ncep.edex.plugin.ncairep.NcAirepDecoder.NcAirepDecoderInput;
|
||||
|
||||
/**
|
||||
* The NcAirepSeparator takes a potential weather message and attempts to
|
||||
* The AirepSeparator takes a potential weather message and attempts to
|
||||
* determine the WMO header and data type of the enclosed data. Normal usage is
|
||||
* to create an instance and set the message data using the setData method. When
|
||||
* complete the separator contains the WMO header, the message data with all
|
||||
|
@ -41,12 +42,13 @@ import gov.noaa.nws.ncep.edex.plugin.ncairep.NcAirepDecoder.NcAirepDecoderInput;
|
|||
* Removed DecoderTools.cleanData(), stripHeader().
|
||||
* Handle amdar in the airep separator.
|
||||
* 10/04/2011 286 Q.Zhou Move addDayInTime() to the parser
|
||||
* Sep 05, 2013 2316 bsteffen Unify airep and ncairep.
|
||||
* </pre>
|
||||
*
|
||||
* @author F. J. Yen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class NcAirepSeparator extends AbstractRecordSeparator {
|
||||
public class AirepSeparator extends AbstractRecordSeparator {
|
||||
/** The logger */
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
|
@ -64,10 +66,10 @@ public class NcAirepSeparator extends AbstractRecordSeparator {
|
|||
|
||||
private int currentReport = -1;
|
||||
|
||||
public static NcAirepSeparator separate(byte[] data, Headers headers) {
|
||||
NcAirepSeparator ncAirepSeparator = new NcAirepSeparator();
|
||||
ncAirepSeparator.setData(data, headers);
|
||||
return ncAirepSeparator;
|
||||
public static AirepSeparator separate(byte[] data, Headers headers) {
|
||||
AirepSeparator airepSeparator = new AirepSeparator();
|
||||
airepSeparator.setData(data, headers);
|
||||
return airepSeparator;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,10 +77,10 @@ public class NcAirepSeparator extends AbstractRecordSeparator {
|
|||
*
|
||||
* @return The next observation record as a String.
|
||||
*/
|
||||
public NcAirepDecoderInput next() {
|
||||
NcAirepDecoderInput data = null;
|
||||
public AirepDecoderInput next() {
|
||||
AirepDecoderInput data = null;
|
||||
if (hasNext()) {
|
||||
data = new NcAirepDecoderInput();
|
||||
data = new AirepDecoderInput();
|
||||
data.report = reports.get(currentReport++);
|
||||
data.wmoHeader = wmoHeader;
|
||||
}
|
||||
|
@ -157,10 +159,10 @@ public class NcAirepSeparator extends AbstractRecordSeparator {
|
|||
String subMsg = message.substring(start, stop);
|
||||
//System.out.println("***subMsg "+subMsg);
|
||||
if (subMsg.contains("AIREP")) {
|
||||
separateNcAIREP(subMsg);
|
||||
separateAIREP(subMsg);
|
||||
}
|
||||
else if (subMsg.contains("AMDAR")) {
|
||||
separateNcAMDAR(subMsg);
|
||||
separateAMDAR(subMsg);
|
||||
}
|
||||
else {
|
||||
separateARPARS(subMsg); //amdar also goes to here
|
||||
|
@ -176,7 +178,7 @@ public class NcAirepSeparator extends AbstractRecordSeparator {
|
|||
* AMDAR 1901^M
|
||||
* LVR CNFNXL 3315N 11850E 190113 F226 MS123 278/038 TB/ S//1=^M
|
||||
*/
|
||||
private void separateNcAMDAR(String message) {
|
||||
private void separateAMDAR(String message) {
|
||||
// find header time. Later append it to observation
|
||||
String headerTime = findHeaderTime(message);
|
||||
|
||||
|
@ -209,7 +211,7 @@ public class NcAirepSeparator extends AbstractRecordSeparator {
|
|||
* AIREP^M
|
||||
* JST4 0050N17838W 2319 F360 MS46 302/025=^M
|
||||
*/
|
||||
private void separateNcAIREP(String message) {
|
||||
private void separateAIREP(String message) {
|
||||
// find header time. Later append it to observation
|
||||
String headerTime = findHeaderTime(message);
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
* This software was modified from Raytheon's airep plugin by
|
||||
* NOAA/NWS/NCEP/NCO to order to output point data in HDF5.
|
||||
**/
|
||||
package gov.noaa.nws.ncep.edex.plugin.ncairep.decoder;
|
||||
package gov.noaa.nws.ncep.edex.plugin.airep.decoder;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
@ -16,9 +16,11 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
|||
* Date PTR# Engineer Description
|
||||
* ------------ -------- ------------- -------------------------------------
|
||||
* 04/27/2011 F. J. Yen Initial creation from airep
|
||||
* Sep 05, 2013 2316 bsteffen Unify airep and ncairep.
|
||||
|
||||
* </pre>
|
||||
*/
|
||||
public class NcAIREPObsType
|
||||
public class AIREPObsType
|
||||
{
|
||||
private static final HashMap<String,Integer> AIREP_TYPES =
|
||||
new HashMap<String,Integer>();
|
||||
|
@ -34,20 +36,20 @@ public class NcAIREPObsType
|
|||
*
|
||||
* @param aType
|
||||
*/
|
||||
private NcAIREPObsType(String aType) {
|
||||
private AIREPObsType(String aType) {
|
||||
obsType = aType;
|
||||
} // NcAIREPObsType()
|
||||
} // AIREPObsType()
|
||||
|
||||
/**
|
||||
*
|
||||
* @param anObsType
|
||||
* @return
|
||||
*/
|
||||
public static NcAIREPObsType obsTypeFactory(String anObsType) {
|
||||
NcAIREPObsType obsTypeInstance = null;
|
||||
public static AIREPObsType obsTypeFactory(String anObsType) {
|
||||
AIREPObsType obsTypeInstance = null;
|
||||
|
||||
if(AIREP_TYPES.containsKey(anObsType)) {
|
||||
obsTypeInstance = new NcAIREPObsType(anObsType);
|
||||
obsTypeInstance = new AIREPObsType(anObsType);
|
||||
}
|
||||
return obsTypeInstance;
|
||||
} // obsTypeFactory()
|
|
@ -1,33 +1,24 @@
|
|||
/**
|
||||
* 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.
|
||||
* This software was modified from Raytheon's airep plugin by
|
||||
* NOAA/NWS/NCEP/NCO to order to output point data in HDF5.
|
||||
**/
|
||||
package com.raytheon.edex.plugin.airep.decoder;
|
||||
package gov.noaa.nws.ncep.edex.plugin.airep.decoder;
|
||||
|
||||
/**
|
||||
import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN;
|
||||
|
||||
/*a
|
||||
* TODO Enter a description here.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date PTR# Engineer Description
|
||||
* ------------ -------- ------------- -------------------------------------
|
||||
* 20080103 384 jkorman Initial Coding.
|
||||
* 04/27/2011 F.J.Yen Initial creation from airep.
|
||||
* Sep 05, 2013 2316 bsteffen Unify airep and ncairep.
|
||||
* </pre>
|
||||
* *
|
||||
* @author F. J. Yen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class AIREPWeather
|
||||
{
|
||||
|
@ -38,12 +29,17 @@ public class AIREPWeather
|
|||
private static final int WX_WEATHER = 1;
|
||||
private static final int WX_FLIGHT = 2;
|
||||
|
||||
private static final int IMISSD = IDecoderConstantsN.INTEGER_MISSING;
|
||||
|
||||
private final String theRawData;
|
||||
|
||||
// Decoded flight hazards - See table 3.3
|
||||
private Integer theHazard = null;
|
||||
private Integer theWeather = null;
|
||||
private Integer theFlightConditions = null;
|
||||
// private Integer theHazard = null;
|
||||
private Integer theHazard = IMISSD;
|
||||
// private Integer theWeather = null;
|
||||
private Integer theWeather = IMISSD;
|
||||
// private Integer theFlightConditions = null;
|
||||
private Integer theFlightConditions = IMISSD;
|
||||
|
||||
/**
|
||||
*
|
|
@ -2,7 +2,7 @@
|
|||
* This software was modified from Raytheon's airep plugin by
|
||||
* NOAA/NWS/NCEP/NCO to order to output point data in HDF5.
|
||||
**/
|
||||
package gov.noaa.nws.ncep.edex.plugin.ncairep.decoder;
|
||||
package gov.noaa.nws.ncep.edex.plugin.airep.decoder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
@ -24,7 +24,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN;
|
||||
|
||||
/**
|
||||
* The NcAirepParser takes a String that should contain a single AIREP observation
|
||||
* The AirepParser takes a String that should contain a single AIREP observation
|
||||
* and parses the individual elements of the observation, and performs a decode
|
||||
* of those elements. The data is made available to clients through a set of get
|
||||
* methods for each data item.
|
||||
|
@ -47,9 +47,10 @@ import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN;
|
|||
* 10/17/2011 286 Q.Zhou Added WX_COND_WORDS and checking.
|
||||
* 11/01/2011 286 Q.Zhou Added month and year to decodetime
|
||||
* 02/15/2012 Q.Zhou Added in decodeHazard() to ice type for possible icing type input
|
||||
* Sep 05, 2013 2316 bsteffen Unify airep and ncairep.
|
||||
* </pre>
|
||||
*/
|
||||
public class NcAirepParser
|
||||
public class AirepParser
|
||||
{
|
||||
/** The logger */
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
@ -155,7 +156,7 @@ public class NcAirepParser
|
|||
private Calendar observationTime = null;
|
||||
private AircraftFlightLevel flightLevel = null;
|
||||
private Float temperature = RMISSD;
|
||||
private NcAIREPWeather weatherGroup = null;
|
||||
private AIREPWeather weatherGroup = null;
|
||||
private Float windDirection = RMISSD;
|
||||
private Float windSpeed = RMISSD;
|
||||
private AircraftRemarks rptRemarks = null;
|
||||
|
@ -175,7 +176,7 @@ public class NcAirepParser
|
|||
* Create the parser for and decode an observation from a String.
|
||||
* @param anObservation A string containing the observation.
|
||||
*/
|
||||
public NcAirepParser(String anObservation) {
|
||||
public AirepParser(String anObservation) {
|
||||
reportData = anObservation;
|
||||
parseElements();
|
||||
}
|
||||
|
@ -184,7 +185,7 @@ public class NcAirepParser
|
|||
* Create the parser for and decode an observation from a String.
|
||||
* @param anObservation A string containing the observation.
|
||||
*/
|
||||
public NcAirepParser(byte [] anObservation) {
|
||||
public AirepParser(byte [] anObservation) {
|
||||
reportData = new String(anObservation);
|
||||
parseElements();
|
||||
}
|
||||
|
@ -232,9 +233,9 @@ public class NcAirepParser
|
|||
//System.out.println("**********theElements "+s);
|
||||
|
||||
// if(!DELIMITER.equals(s)) {
|
||||
// Object o = NcAIREPObsType.obsTypeFactory(s);
|
||||
// Object o = AIREPObsType.obsTypeFactory(s);
|
||||
// if((o != null)&&(reportType == null)) {
|
||||
// reportType = ((NcAIREPObsType) o).getValue();
|
||||
// reportType = ((AIREPObsType) o).getValue();
|
||||
// } else {
|
||||
// theElements.add(s);
|
||||
// }
|
||||
|
@ -635,7 +636,7 @@ public class NcAirepParser
|
|||
{
|
||||
if(WX_GROUP.matcher(s).find())
|
||||
{
|
||||
weatherGroup = new NcAIREPWeather(s);
|
||||
weatherGroup = new AIREPWeather(s);
|
||||
theElements.set(i,weatherGroup);
|
||||
break;
|
||||
}
|
||||
|
@ -1044,7 +1045,7 @@ public class NcAirepParser
|
|||
return temperature;
|
||||
} // getAirTemperature()
|
||||
|
||||
public NcAIREPWeather getWeatherGroup()
|
||||
public AIREPWeather getWeatherGroup()
|
||||
{
|
||||
return weatherGroup;
|
||||
} // getWeatherGroup()
|
|
@ -1,13 +1,14 @@
|
|||
package gov.noaa.nws.ncep.edex.plugin.ncairep.junit;
|
||||
package gov.noaa.nws.ncep.edex.plugin.airep.junit;
|
||||
|
||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||
import gov.noaa.nws.ncep.edex.plugin.ncairep.decoder.NcAirepParser;
|
||||
|
||||
import gov.noaa.nws.ncep.edex.plugin.airep.decoder.AirepParser;
|
||||
|
||||
public class TestParser {
|
||||
WMOHeader wmoHeader;
|
||||
String anObservation = "ARP UAL556 4126N 09338W 2359 F370 MS54 220/040KT TB SMTH=";
|
||||
public TestParser() {
|
||||
NcAirepParser parser = new NcAirepParser(anObservation);
|
||||
AirepParser parser = new AirepParser(anObservation);
|
||||
String turb = parser.getTurbInten();
|
||||
System.out.println("turb"+turb);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
WMO header pattern for ncairep
|
||||
WMO header pattern for airep
|
||||
-->
|
||||
<requestPatterns xmlns:ns2="group">
|
||||
<!-- The following is the original pattern for airep:
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>gov.noaa.nws.ncep.edex.plugin.ncairep</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -1 +0,0 @@
|
|||
gov.noaa.nws.ncep.common.dataplugin.ncairep.NcAirepRecord
|
|
@ -1,5 +0,0 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
res/
|
|
@ -1,20 +0,0 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||
|
||||
<bean id="ncairepPluginName" class="java.lang.String">
|
||||
<constructor-arg type="java.lang.String" value="ncairep" />
|
||||
</bean>
|
||||
|
||||
<bean id="ncairepProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
|
||||
<property name="pluginName" ref="ncairepPluginName" />
|
||||
<property name="pluginFQN" value="gov.noaa.nws.ncep.common.dataplugin.ncairep" />
|
||||
<property name="dao" value="gov.noaa.nws.ncep.common.dataplugin.ncairep.dao.NcAirepDao" />
|
||||
<property name="record" value="gov.noaa.nws.ncep.common.dataplugin.ncairep.NcAirepRecord" />
|
||||
</bean>
|
||||
|
||||
<bean factory-bean="pluginRegistry" factory-method="register">
|
||||
<constructor-arg ref="ncairepPluginName"/>
|
||||
<constructor-arg ref="ncairepProperties"/>
|
||||
</bean>
|
||||
</beans>
|
|
@ -1,76 +0,0 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="ncairepDecoder" class="gov.noaa.nws.ncep.edex.plugin.ncairep.NcAirepDecoder">
|
||||
<constructor-arg ref="ncairepPluginName" />
|
||||
</bean>
|
||||
|
||||
<bean id="ncairepPointData" class="gov.noaa.nws.ncep.common.dataplugin.ncairep.NcAirepPointDataTransform"/>
|
||||
|
||||
<bean id="ncairepSeparator" class="gov.noaa.nws.ncep.edex.plugin.ncairep.NcAirepSeparator" />
|
||||
|
||||
<bean id="ncairepDistRegistry" factory-bean="distributionSrv"
|
||||
factory-method="register">
|
||||
<constructor-arg value="ncairep" />
|
||||
<constructor-arg value="jms-dist:queue:Ingest.ncairep" />
|
||||
</bean>
|
||||
|
||||
<bean id="ncairepCamelRegistered" factory-bean="contextManager"
|
||||
factory-method="register" depends-on="persistCamelRegistered">
|
||||
<constructor-arg ref="ncairep-camel"/>
|
||||
</bean>
|
||||
|
||||
<camelContext id="ncairep-camel"
|
||||
xmlns="http://camel.apache.org/schema/spring"
|
||||
errorHandlerRef="errorHandler"
|
||||
autoStartup="false">
|
||||
|
||||
<endpoint id="ncairepFileEndpoint" uri="file:${edex.home}/data/sbn/ncairep?noop=true&idempotent=false" />
|
||||
|
||||
<route id="ncairepFileConsumerRoute">
|
||||
<from ref="ncairepFileEndpoint" />
|
||||
<bean ref="fileToString" />
|
||||
<setHeader headerName="pluginName">
|
||||
<constant>ncairep</constant>
|
||||
</setHeader>
|
||||
<to uri="jms-generic:queue:Ingest.ncairep" />
|
||||
</route>
|
||||
|
||||
|
||||
<!-- Begin ncairep routes -->
|
||||
<route id="ncairepIngestRoute">
|
||||
<from uri="jms-generic:queue:Ingest.ncairep" />
|
||||
<setHeader headerName="pluginName">
|
||||
<constant>ncairep</constant>
|
||||
</setHeader>
|
||||
<doTry>
|
||||
<pipeline>
|
||||
<bean ref="stringToFile" />
|
||||
<split streaming="true">
|
||||
<method bean="ncairepSeparator" method="separate" />
|
||||
<doTry>
|
||||
<pipeline>
|
||||
<bean ref="ncairepDecoder" method="decode" />
|
||||
<!-- Add next line for h5 version and change next
|
||||
line from indexAlert to persistIndexAlert" /-->
|
||||
<bean ref="ncairepPointData" method="toPointData" />
|
||||
<!-- to uri="direct-vm:indexAlert" /-->
|
||||
<to uri="direct-vm:persistIndexAlert" />
|
||||
</pipeline>
|
||||
<doCatch>
|
||||
<exception>java.lang.Throwable</exception>
|
||||
<to uri="log:ncairep?level=ERROR" />
|
||||
</doCatch>
|
||||
</doTry>
|
||||
</split>
|
||||
</pipeline>
|
||||
<doCatch>
|
||||
<exception>java.lang.Throwable</exception>
|
||||
<to uri="log:ncairep?level=ERROR" />
|
||||
</doCatch>
|
||||
</doTry>
|
||||
</route>
|
||||
</camelContext>
|
||||
</beans>
|
|
@ -1,143 +0,0 @@
|
|||
/**
|
||||
* This software was modified from Raytheon's airep plugin by
|
||||
* NOAA/NWS/NCEP/NCO to order to output point data in HDF5.
|
||||
**/
|
||||
package gov.noaa.nws.ncep.edex.plugin.ncairep.decoder;
|
||||
|
||||
import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN;
|
||||
|
||||
/*a
|
||||
* TODO Enter a description here.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date PTR# Engineer Description
|
||||
* ------------ -------- ------------- -------------------------------------
|
||||
* 04/27/2011 F.J.Yen Initial creation from airep.
|
||||
* </pre>
|
||||
* *
|
||||
* @author F. J. Yen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class NcAIREPWeather
|
||||
{
|
||||
private static final String VALID_CHARS = "/0123456789";
|
||||
private static final int WX_LENGTH = 3;
|
||||
|
||||
private static final int WX_HAZARD = 0;
|
||||
private static final int WX_WEATHER = 1;
|
||||
private static final int WX_FLIGHT = 2;
|
||||
|
||||
private static final int IMISSD = IDecoderConstantsN.INTEGER_MISSING;
|
||||
|
||||
private final String theRawData;
|
||||
|
||||
// Decoded flight hazards - See table 3.3
|
||||
// private Integer theHazard = null;
|
||||
private Integer theHazard = IMISSD;
|
||||
// private Integer theWeather = null;
|
||||
private Integer theWeather = IMISSD;
|
||||
// private Integer theFlightConditions = null;
|
||||
private Integer theFlightConditions = IMISSD;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param aType
|
||||
*/
|
||||
public NcAIREPWeather(String aWeatherGroup)
|
||||
{
|
||||
theRawData = aWeatherGroup;
|
||||
decodeElement();
|
||||
} // NcAIREPWeather()
|
||||
|
||||
public Integer getHazard()
|
||||
{
|
||||
return theHazard;
|
||||
} // getHazard()
|
||||
|
||||
public Integer getWeather()
|
||||
{
|
||||
return theWeather;
|
||||
} // getWeather()
|
||||
|
||||
public Integer getFlightConditions()
|
||||
{
|
||||
return theFlightConditions;
|
||||
} // getFlightConditions()
|
||||
|
||||
|
||||
//***********************************************
|
||||
// Table 3.3. AIREP Hazards (H).
|
||||
// Code Figure Explanation
|
||||
// 0 None
|
||||
// 1 Light Turbulence
|
||||
// 2 Moderate Turbulence
|
||||
// 3 Severe Turbulence
|
||||
// 4 Extreme Turbulence
|
||||
// 5 Trace of Icing
|
||||
// 6 Light Icing
|
||||
// 7 Moderate Icing
|
||||
// 8 Severe Icing
|
||||
// 9 Hail
|
||||
//
|
||||
// Table 3.4. AIREP Weather (W).
|
||||
// Code Figure Explanation
|
||||
// 0 Clear
|
||||
// 1 Scattered Clouds
|
||||
// 2 Broken Clouds
|
||||
// 3 Continuous Layers
|
||||
// 4 Lightning
|
||||
// 5 Drizzle
|
||||
// 6 Continuous Rain
|
||||
// 7 Continuous Snow
|
||||
// 8 Rain or Snow Showers
|
||||
// 9 Thunderstorms
|
||||
//
|
||||
//
|
||||
// Table 3.5. AIREP Flight Conditions (FC).
|
||||
// Code Figure Explanation
|
||||
// 0 Clear
|
||||
// 1 Above Clouds (tops less than 10,000 ft)
|
||||
// 2 Above Clouds (tops 10,000 to 18,000 ft)
|
||||
// 3 Above Clouds (tops over 18,000 ft)
|
||||
// 4 Below Clouds (bases less than 10,000 ft)
|
||||
// 5 Below Clouds (bases 10,000 to 18,000 ft)
|
||||
// 6 Below Clouds (bases above 18,000 ft)
|
||||
// 7 Between Broken or Overcast Layers
|
||||
// 8 In Clouds
|
||||
// 9 In and Out of Clouds
|
||||
//***********************************************
|
||||
|
||||
private void decodeElement()
|
||||
{
|
||||
if(theRawData.length() == WX_LENGTH)
|
||||
{
|
||||
int pos = VALID_CHARS.indexOf(theRawData.charAt(WX_HAZARD));
|
||||
if(pos >= 0)
|
||||
{
|
||||
theHazard = pos-1;
|
||||
}
|
||||
pos = VALID_CHARS.indexOf(theRawData.charAt(WX_WEATHER));
|
||||
if(pos >= 0)
|
||||
{
|
||||
theWeather = pos-1;
|
||||
}
|
||||
pos = VALID_CHARS.indexOf(theRawData.charAt(WX_FLIGHT));
|
||||
if(pos >= 0)
|
||||
{
|
||||
theFlightConditions = pos-1;
|
||||
}
|
||||
}
|
||||
} // decodeElement()
|
||||
|
||||
public String toString()
|
||||
{
|
||||
StringBuffer retData = new StringBuffer();
|
||||
retData.append((theHazard >= 0) ? String.valueOf(theHazard) : "/");
|
||||
retData.append((theWeather >= 0) ? String.valueOf(theWeather) : "/");
|
||||
retData.append((theFlightConditions >= 0) ? String.valueOf(theFlightConditions) : "/");
|
||||
|
||||
|
||||
return retData.toString();
|
||||
} // toString()
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<PlotParameterDefns>
|
||||
|
||||
<plugin>ncairep</plugin>
|
||||
<plugin>airep</plugin>
|
||||
<!-- From NMAP ACFT params
|
||||
brbk:1:2:112 1
|
||||
brbm:1:2 1
|
||||
|
@ -74,7 +74,7 @@ wtop top of wx in ft
|
|||
plotLookupTable="icing_type2_trans.txt"/>
|
||||
<!--
|
||||
this references a raytheon lookupTable but in their airepTurbDesign.svg file the plotParam is FLT_HZD???
|
||||
here we are using turbInten from ncairep instead of flightHazard. Is this correct?
|
||||
here we are using turbInten from airep instead of flightHazard. Is this correct?
|
||||
-->
|
||||
<PlotParameterDefn plotParamName="TBSY" metParamName="TurbulenceIntensitySymbol"
|
||||
dbParamName="turbInten"
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<plotModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="plotModel.xsd"
|
||||
plugin="ncairep" name="fullPlot"
|
||||
plugin="airep" name="fullPlot"
|
||||
svgTemplate="standardPlotModelTemplate.svg">
|
||||
|
||||
<!-- This was created from nmap full_standard plot model for ACFT
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<plotModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="plotModel.xsd"
|
||||
plugin="ncairep" name="standard"
|
||||
plugin="airep" name="standard"
|
||||
svgTemplate="standardPlotModelTemplate.svg">
|
||||
|
||||
<!-- This was created from nmap full_standard plot model for ACFT
|
|
@ -3,7 +3,7 @@
|
|||
<resourceDefnName>AIREP</resourceDefnName>
|
||||
<resourceCategory>UPPER_AIR</resourceCategory>
|
||||
<resourceParameters>
|
||||
pluginName=ncairep
|
||||
pluginName=airep
|
||||
reportType=AIREP
|
||||
legendString=Aircraft Reports
|
||||
spiFile=MTR.spi
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
! Parameters and Attributes for the default AIREP Resource
|
||||
!
|
||||
plotModel=@PlotModels/ncairep/fullPlot.xml
|
||||
plotModel=@PlotModels/airep/fullPlot.xml
|
||||
plotDensity=10
|
||||
conditionalFilter=
|
|
@ -1,4 +1,4 @@
|
|||
! Parameters and Attributes for the default AIREP Resource
|
||||
plotModel=@PlotModels/ncairep/standard.xml
|
||||
plotModel=@PlotModels/airep/standard.xml
|
||||
plotDensity=10
|
||||
conditionalFilter=
|
|
@ -52,7 +52,8 @@ import com.raytheon.viz.pointdata.rsc.retrieve.AbstractDbPlotInfoRetriever;
|
|||
* 11/04/2012 #944 ghull rm FcsPlotResource
|
||||
* 12/19/2012 #947 ghull save ConditionalFilter object to the RBD.
|
||||
* 04/15/2013 #864 ghull rm isForecastResource()
|
||||
*
|
||||
* Sep 05, 2013 2316 bsteffen Unify pirep and ncpirep.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -119,8 +120,8 @@ INatlCntrsResourceData {
|
|||
pluginNames.add("sfcobs");
|
||||
pluginNames.add("ncuair");
|
||||
pluginNames.add("ncscd");
|
||||
pluginNames.add("ncairep");
|
||||
pluginNames.add("ncpirep");
|
||||
pluginNames.add("airep");
|
||||
pluginNames.add("pirep");
|
||||
pluginNames.add("nctaf");
|
||||
pluginNames.add("ncpafm");
|
||||
pluginNames.add("modelsounding");
|
||||
|
@ -141,8 +142,8 @@ INatlCntrsResourceData {
|
|||
sfcPlugins.add("obs");
|
||||
sfcPlugins.add("sfcobs");
|
||||
sfcPlugins.add("ncscd");
|
||||
sfcPlugins.add("ncairep");
|
||||
sfcPlugins.add("ncpirep");
|
||||
sfcPlugins.add("airep");
|
||||
sfcPlugins.add("pirep");
|
||||
sfcPlugins.add("nctaf");
|
||||
sfcPlugins.add("ncpafm");
|
||||
sfcPlugins.add("bufrmosLAMP");
|
||||
|
|
Loading…
Add table
Reference in a new issue