Merge branch 'omaha_15.1.1' into omaha_14.4.1

Former-commit-id: 7605f77e2027026c83c0cc4c1e27ba617efbe70f
This commit is contained in:
Steve Harris 2014-07-16 13:21:53 -05:00
commit 5e04680687
64 changed files with 2374 additions and 1231 deletions

View file

@ -23,6 +23,7 @@ import java.util.Arrays;
import org.jivesoftware.smack.util.Base64;
import com.raytheon.uf.common.serialization.MarshalOptions;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -46,6 +47,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.SerializationMode;
* Dec 11, 2013 2562 bclement Initial creation
* Feb 27, 2013 2756 bclement extends BaseExtension
* Jun 12, 2013 2903 bclement default to wrap jaxb xml in base64
* Jul 15, 2014 3373 bclement added fragment marshal options
*
* </pre>
*
@ -69,6 +71,9 @@ public class SessionPayload extends BaseExtension {
public static final String ENCODING_ATTRIBUTE = "encoding";
private static final MarshalOptions UNFORMATTED_FRAGMENT = new MarshalOptions(
false, true);
private final PayloadType payloadType;
private final SerializationMode mode;
@ -135,7 +140,7 @@ public class SessionPayload extends BaseExtension {
try {
CollaborationXmlManager jaxb = CollaborationXmlManager
.getInstance();
String xml = jaxb.marshalToFragment(data);
String xml = jaxb.marshalToXml(data, UNFORMATTED_FRAGMENT);
/*
* wrap JAXB XML in base64 to avoid problems with openfire
* disconnecting due to complex XML

View file

@ -19,13 +19,12 @@
**/
package com.raytheon.uf.viz.collaboration.comm.provider;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.UnmarshallerHandler;
@ -60,6 +59,7 @@ import com.raytheon.uf.viz.core.reflect.SubClassLocator;
* ------------- -------- ----------- --------------------------
* Oct 31, 2013 2491 bsteffen Initial creation
* Dec 18, 2013 2562 bclement extend jaxb manager, xpp/fragment support
* Jul 15, 2014 3373 bclement jaxb manager changes, unmarshalFromXPP() doesn't pool
*
* </pre>
*
@ -147,43 +147,14 @@ public class CollaborationXmlManager extends JAXBManager {
*/
public Object unmarshalFromXPP(XmlPullParser parser)
throws CollaborationException {
Unmarshaller unmarshaller = null;
try {
unmarshaller = getUnmarshaller();
JAXBContext ctx = getJaxbContext();
Unmarshaller unmarshaller = ctx.createUnmarshaller();
UnmarshallerHandler handler = unmarshaller.getUnmarshallerHandler();
PullParserJaxbAdapter adapter = new PullParserJaxbAdapter(parser, handler);
return adapter.unmarshal();
} catch (Exception e) {
throw new CollaborationException("Unable to unmarshal data", e);
} finally {
// TODO magic number 10 because QUEUE_SIZE isn't visible
if ((unmarshaller != null) && (unmarshallers.size() < 10)) {
unmarshallers.add(unmarshaller);
}
}
}
/**
* Marshal object to unformatted (not pretty-printed) XML fragment (no XML
* preamble)
*
* @param obj
* @return
* @throws JAXBException
*/
public String marshalToFragment(Object obj) throws JAXBException {
Marshaller msh = getMarshaller();
try {
StringWriter writer = new StringWriter();
msh.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.FALSE);
msh.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
msh.marshal(obj, writer);
return writer.toString();
} finally {
// TODO magic number 10 because QUEUE_SIZE isn't visible
if ((msh != null) && (marshallers.size() < 10)) {
marshallers.add(msh);
}
}
}

View file

@ -73,6 +73,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* error, cleaned up code to prevent buttons
* from magically appearing, removed dead code,
* and other code clean up.
* 03 Jul 2014 #3348 rferrel Handle Enter event.
*
* </pre>
*
@ -257,6 +258,15 @@ public class ProcedureListDlg extends CaveSWTDialog {
*/
if (this.mode == Mode.OPEN) {
procedureTF.setEditable(false);
procedureTF.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
if (procedureTF.getText().length() > 0) {
selectAction();
}
}
});
}
}
@ -332,6 +342,11 @@ public class ProcedureListDlg extends CaveSWTDialog {
}
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
selectAction();
}
});
treeViewer.getTree().addMouseListener(new MouseAdapter() {

View file

@ -120,6 +120,8 @@ import com.raytheon.viz.gfe.core.parm.Parm;
* 11/20/2013 #2331 randerso Added getTopoData method
* 04/03/2014 #2737 randerso Moved clientISCSendStatus to SaveGFEGridRequest
* 04/09/2014 #3004 dgilling Support moved ClearPracticeVTECTableRequest.
* 07/01/2014 #3149 randerso Changed getGridData to handle limited number of grids returned
* and re-request if not all data returned
*
* </pre>
*
@ -563,21 +565,34 @@ public class IFPClient {
* @return List of grid slices
* @throws GFEServerException
*/
@SuppressWarnings("unchecked")
public List<IGridSlice> getGridData(ParmID parmId, List<TimeRange> gridTimes)
throws GFEServerException {
return getGridData(parmId, gridTimes, false);
}
@SuppressWarnings("unchecked")
public List<IGridSlice> getGridData(ParmID parmId,
List<TimeRange> gridTimes, boolean convertUnit)
throws GFEServerException {
GetGridRequest req = new GetGridRequest(parmId, gridTimes);
req.setConvertUnit(convertUnit);
GetGridDataRequest request = new GetGridDataRequest();
request.addRequest(req);
ServerResponse<?> resp = makeRequest(request);
List<IGridSlice> slices = (List<IGridSlice>) resp.getPayload();
List<IGridSlice> slices = new ArrayList<IGridSlice>(gridTimes.size());
while (slices.size() < gridTimes.size()) {
ServerResponse<List<IGridSlice>> resp = (ServerResponse<List<IGridSlice>>) makeRequest(request);
slices.addAll(resp.getPayload());
// if no slices returned (shouldn't happen unless server code is
// broken)
if (slices.isEmpty()) {
String msg = "No data returned from GetGridDataRequest for "
+ parmId + " for times:" + req.getTimes();
statusHandler.error(msg);
throw new GFEServerException(msg);
}
// if not all slices returned
if (slices.size() < gridTimes.size()) {
// request remaining times.
req.setTimes(gridTimes.subList(slices.size(), gridTimes.size()));
}
}
return slices;
}

View file

@ -1,11 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View file

@ -2,12 +2,18 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Lightning Plug-in
Bundle-SymbolicName: com.raytheon.viz.lightning;singleton:=true
Bundle-Version: 1.14.0
Bundle-Version: 1.14.1.qualifier
Bundle-Vendor: Raytheon
Require-Bundle: com.raytheon.uf.common.dataplugin.binlightning;bundle-version="1.0.0",
com.raytheon.viz.core,
com.raytheon.viz.ui
com.raytheon.viz.ui,
com.raytheon.viz.grid;bundle-version="1.14.0",
com.raytheon.uf.common.style;bundle-version="1.0.0",
com.raytheon.uf.common.colormap;bundle-version="1.14.0"
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.viz.lightning
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.raytheon.uf.viz.productbrowser
Import-Package: com.raytheon.uf.common.numeric.buffer,
com.raytheon.uf.common.numeric.filter,
com.raytheon.uf.common.numeric.source,
com.raytheon.uf.viz.productbrowser

View file

@ -0,0 +1,50 @@
<?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.
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<loadProperties xsi:type="gridLoadProperties" loadWithoutData="true">
</loadProperties>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="gridLightningResourceData"
isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true"
handlingPositiveStrikes="true" handlingNegativeStrikes="true"
handlingPulses="false" handlingCloudFlashes="false"
kmResolution="${resolution}">
<binOffset posOffset="0" negOffset="${negOffset}" virtualOffset="0"/>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="binlightning" constraintType="EQUALS" />
</mapping>
<mapping key="source">
<constraint constraintValue="${source}" constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
</resource>
</descriptor>
</displays>
</displayList>
</bundle>

View file

@ -0,0 +1,50 @@
<?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.
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<loadProperties xsi:type="gridLoadProperties" loadWithoutData="true">
</loadProperties>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="gridLightningResourceData"
isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true"
handlingPositiveStrikes="false" handlingNegativeStrikes="false"
handlingPulses="false" handlingCloudFlashes="true"
kmResolution="${resolution}">
<binOffset posOffset="0" negOffset="${negOffset}" virtualOffset="0"/>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="binlightning" constraintType="EQUALS" />
</mapping>
<mapping key="source">
<constraint constraintValue="${source}" constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
</resource>
</descriptor>
</displays>
</displayList>
</bundle>

View file

@ -0,0 +1,50 @@
<?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.
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<loadProperties xsi:type="gridLoadProperties" loadWithoutData="true">
</loadProperties>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="gridLightningResourceData"
isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true"
handlingPositiveStrikes="false" handlingNegativeStrikes="false"
handlingPulses="true" handlingCloudFlashes="false"
kmResolution="${resolution}">
<binOffset posOffset="0" negOffset="${negOffset}" virtualOffset="0"/>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="binlightning" constraintType="EQUALS" />
</mapping>
<mapping key="source">
<constraint constraintValue="${source}" constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
</resource>
</descriptor>
</displays>
</displayList>
</bundle>

View file

@ -0,0 +1,50 @@
<?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.
-->
<bundle>
<displayList>
<displays xsi:type="d2DMapRenderableDisplay" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<descriptor xsi:type="mapDescriptor">
<resource>
<loadProperties xsi:type="gridLoadProperties" loadWithoutData="true">
</loadProperties>
<properties isSystemResource="false"
isBlinking="false" isMapLayer="false" isHoverOn="false"
isVisible="true" />
<resourceData xsi:type="gridLightningResourceData"
isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true"
handlingPositiveStrikes="true" handlingNegativeStrikes="true"
handlingPulses="false" handlingCloudFlashes="true"
kmResolution="${resolution}">
<binOffset posOffset="0" negOffset="${negOffset}" virtualOffset="0"/>
<metadataMap>
<mapping key="pluginName">
<constraint constraintValue="binlightning" constraintType="EQUALS" />
</mapping>
<mapping key="source">
<constraint constraintValue="${source}" constraintType="EQUALS" />
</mapping>
</metadataMap>
</resourceData>
</resource>
</descriptor>
</displays>
</displayList>
</bundle>

View file

@ -0,0 +1,74 @@
<?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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/GridLightningCGPlot.xml"
menuText="60min cloud to ground density" id="1HrGridLightningCGPlot">
<substitute key="negOffset" value="3600"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningCloudFlashPlot.xml"
menuText="60min cloud flash density" id="1HrGridLightningCloudFlashPlot">
<substitute key="negOffset" value="3600"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningTotalFlashPlot.xml"
menuText="60min total flash density" id="1HrGridLightningFlashPlot">
<substitute key="negOffset" value="3600"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningPulsePlot.xml"
menuText="60min pulse density" id="1HrGridLightningPulsePlot">
<substitute key="negOffset" value="3600"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningCGPlot.xml"
menuText="15min cloud to ground density" id="1HrGridLightningCGPlot">
<substitute key="negOffset" value="900"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningCloudFlashPlot.xml"
menuText="15min cloud flash density" id="1HrGridLightningCloudFlashPlot">
<substitute key="negOffset" value="900"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningTotalFlashPlot.xml"
menuText="15min total flash density" id="1HrGridLightningFlashPlot">
<substitute key="negOffset" value="900"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningPulsePlot.xml"
menuText="15min pulse density" id="1HrGridLightningPulsePlot">
<substitute key="negOffset" value="900"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningCGPlot.xml"
menuText="5min cloud to ground density" id="1HrGridLightningCGPlot">
<substitute key="negOffset" value="300"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningCloudFlashPlot.xml"
menuText="5min cloud flash density" id="1HrGridLightningCloudFlashPlot">
<substitute key="negOffset" value="300"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningTotalFlashPlot.xml"
menuText="5min total flash density" id="1HrGridLightningFlashPlot">
<substitute key="negOffset" value="300"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/GridLightningPulsePlot.xml"
menuText="5min pulse density" id="1HrGridLightningPulsePlot">
<substitute key="negOffset" value="300"/>
</contribute>
</menuTemplate>

View file

@ -0,0 +1,52 @@
<?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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="subMenu" menuText="1km" id="1kmLightningGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningBundleItems.xml">
<substitute key="resolution" value="1" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="3km" id="3kmLightningGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningBundleItems.xml">
<substitute key="resolution" value="3" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="5km" id="5kmLightningGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningBundleItems.xml">
<substitute key="resolution" value="5" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="8km" id="8kmLightningGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningBundleItems.xml">
<substitute key="resolution" value="8" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="20km" id="20kmLightningGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningBundleItems.xml">
<substitute key="resolution" value="20" />
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="40km" id="40kmLightningGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningBundleItems.xml">
<substitute key="resolution" value="40" />
</contribute>
</contribute>
</menuTemplate>

View file

@ -24,14 +24,29 @@
<substitute key="source" value="NLDN"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="NLDN Grid" id="entlnGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningMenuItems.xml">
<substitute key="source" value="NLDN"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="GLD" id="GLDSubMenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gldLightningBundleItems.xml">
<substitute key="source" value="GLD"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="GLD Grid" id="entlnGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningMenuItems.xml">
<substitute key="source" value="GLD"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Total Lightning" id="ENTLNSubMenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/entlnLightningBundleItems.xml">
<substitute key="source" value="ENTLN"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Total Lightning Grid" id="entlnGridSubmenu">
<contribute xsi:type="subinclude" fileName="menus/lightning/gridLightningMenuItems.xml">
<substitute key="source" value="ENTLN"/>
</contribute>
</contribute>
</menuTemplate>

View file

@ -29,6 +29,13 @@
renderingOrderId="PLOT"
resourceType="PLAN_VIEW">
</resource>
<resource
class="com.raytheon.viz.lightning.GridLightningResource"
name="GridLightning"
recordClass="com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord"
renderingOrderId="PLOT"
resourceType="PLAN_VIEW">
</resource>
</extension>
<extension

View file

@ -0,0 +1,343 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.lightning;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.measure.converter.UnitConverter;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridEnvelope2D;
import org.geotools.geometry.DirectPosition2D;
import org.geotools.referencing.operation.DefaultMathTransformFactory;
import org.opengis.coverage.grid.GridEnvelope;
import org.opengis.geometry.Envelope;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.cs.CoordinateSystemAxis;
import org.opengis.referencing.datum.PixelInCell;
import org.opengis.referencing.operation.MathTransform;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.numeric.buffer.ShortBufferWrapper;
import com.raytheon.uf.common.numeric.filter.UnsignedFilter;
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.cache.CacheObject;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.viz.grid.rsc.general.AbstractGridResource;
import com.raytheon.viz.grid.rsc.general.GeneralGridData;
import com.raytheon.viz.lightning.cache.LightningFrame;
import com.raytheon.viz.lightning.cache.LightningFrameMetadata;
import com.raytheon.viz.lightning.cache.LightningFrameRetriever;
/**
* Resource to render lightning point data as contours and images
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 7, 2014 3333 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class GridLightningResource extends
AbstractGridResource<GridLightningResourceData> {
public static final String DENSITY_PARAM = "lightning density";
private final Map<DataTime, CacheObject<LightningFrameMetadata, LightningFrame>> cacheObjectMap = new ConcurrentHashMap<>();
/**
* @param resourceData
* @param loadProperties
*/
protected GridLightningResource(GridLightningResourceData resourceData,
LoadProperties loadProperties) {
super(resourceData, loadProperties);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.grid.rsc.general.AbstractGridResource#getMatchCriteria()
*/
@Override
public ParamLevelMatchCriteria getMatchCriteria() {
ParamLevelMatchCriteria rval = new ParamLevelMatchCriteria();
rval.setParameterName(Arrays.asList(DENSITY_PARAM));
return rval;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.grid.rsc.general.AbstractGridResource#
* createColorMapParameters
* (com.raytheon.viz.grid.rsc.general.GeneralGridData)
*/
@Override
protected ColorMapParameters createColorMapParameters(GeneralGridData data)
throws VizException {
ColorMapParameters rval = super.createColorMapParameters(data);
rval.setNoDataValue(0);
return rval;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.grid.rsc.general.AbstractGridResource#disposeInternal()
*/
@Override
protected void disposeInternal() {
cacheObjectMap.clear();
super.disposeInternal();
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.grid.rsc.general.AbstractGridResource#remove(com.raytheon
* .uf.common.time.DataTime)
*/
@Override
public void remove(DataTime dataTime) {
cacheObjectMap.remove(dataTime);
super.remove(dataTime);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.grid.rsc.general.AbstractGridResource#getData(com.raytheon
* .uf.common.time.DataTime, java.util.List)
*/
@Override
public List<GeneralGridData> getData(DataTime time,
List<PluginDataObject> pdos) throws VizException {
CoordinateReferenceSystem crs = descriptor.getCRS();
GeneralGridGeometry gridGeom = descriptor.getGridGeometry();
int kmResolution = resourceData.getKmResolution();
/* convert to meters to match projection dimension units */
int mResolution = kmResolution * 1000;
int nx = getAxisDimension(0, mResolution);
int ny = getAxisDimension(1, mResolution);
GridEnvelope gridRange = new GridEnvelope2D(0, 0, nx, ny);
GeneralGridGeometry imageGeometry = new GeneralGridGeometry(gridRange,
gridGeom.getEnvelope());
MathTransform latLonToGrid = getLonLatTransform(crs, imageGeometry);
/*
* use shorts to save space, a grid cell is unlikely to contain over 64K
* strikes
*/
short[] data = new short[nx * ny];
LightningFrame frame = getFrame(time, pdos);
List<Iterator<double[]>> iterators = new ArrayList<>(4);
if (resourceData.isHandlingPositiveStrikes()) {
iterators.add(frame.getPosLatLonList().iterator());
}
if (resourceData.isHandlingNegativeStrikes()) {
iterators.add(frame.getNegLatLonList().iterator());
}
if (resourceData.isHandlingCloudFlashes()) {
iterators.add(frame.getCloudLatLonList().iterator());
}
if (resourceData.isHandlingPulses()) {
iterators.add(frame.getPulseLatLonList().iterator());
}
for (Iterator<double[]> iter : iterators) {
while (iter.hasNext()) {
double[] lonLat = iter.next();
DirectPosition2D src = new DirectPosition2D(lonLat[0],
lonLat[1]);
DirectPosition2D dest = new DirectPosition2D();
try {
latLonToGrid.transform(src, dest);
} catch (Exception e) {
throw new VizException(e.getLocalizedMessage(), e);
}
int gridX = (int) Math.round(dest.x);
int gridY = (int) Math.round(dest.y);
int index = (nx * gridY) + gridX;
if (index < data.length) {
data[(nx * gridY) + gridX] += 1;
}
}
}
ShortBufferWrapper source = new ShortBufferWrapper(data, nx, ny);
GeneralGridData gridData = GeneralGridData.createScalarData(
imageGeometry, UnsignedFilter.apply(source), Unit.ONE);
return Arrays.asList(gridData);
}
/**
* Get updated frame from cache
*
* @param time
* @param pdos
* @return
*/
private LightningFrame getFrame(DataTime time, List<PluginDataObject> pdos) {
LightningFrameRetriever retriever = LightningFrameRetriever
.getInstance();
CacheObject<LightningFrameMetadata, LightningFrame> co;
synchronized (cacheObjectMap) {
co = cacheObjectMap.get(time);
if (co == null) {
/*
* no local reference to cache object, create key and get cache
* object which may be new or from another resource
*/
LightningFrameMetadata key = new LightningFrameMetadata(time,
resourceData.getBinOffset());
co = CacheObject.newCacheObject(key, retriever);
cacheObjectMap.put(time, co);
}
}
return retriever.updateAndGet(ensurePdoType(pdos), co);
}
/**
* @param pdos
* @return list of all BinLightningRecords in pdos
*/
private List<BinLightningRecord> ensurePdoType(List<PluginDataObject> pdos) {
List<BinLightningRecord> rval = new ArrayList<>(pdos.size());
for (PluginDataObject pdo : pdos) {
if (pdo instanceof BinLightningRecord) {
rval.add((BinLightningRecord) pdo);
}
}
return rval;
}
/**
* Get grid dimension for ordinal axis using the provided resolution. Uses
* the CRS and grid geometry of the descriptor.
*
* @param axis
* 0 for x, 1 for y
* @param mResolution
* in meters
* @return
*/
private int getAxisDimension(int axis, int mResolution) {
CoordinateReferenceSystem crs = descriptor.getCRS();
GeneralGridGeometry gridGeometry = descriptor.getGridGeometry();
CoordinateSystemAxis csa = crs.getCoordinateSystem().getAxis(axis);
Unit<?> crsUnit = csa.getUnit();
UnitConverter converter = crsUnit.getConverterTo(SI.METER);
Envelope env = gridGeometry.getEnvelope();
return (int) Math.round(converter.convert(env.getSpan(axis))
/ mResolution);
}
/**
* Create a new transform from lon/lat to grid coordinates
*
* @param crs
* coordinate reference system of display
* @param gridGeom
* target grid geometry
* @return
* @throws VizException
*/
private MathTransform getLonLatTransform(CoordinateReferenceSystem crs,
GeneralGridGeometry gridGeom)
throws VizException {
try {
MathTransform latLonToCrs = MapUtil.getTransformFromLatLon(crs);
MathTransform crsToGrid = gridGeom.getGridToCRS(
PixelInCell.CELL_CENTER).inverse();
DefaultMathTransformFactory dmtf = new DefaultMathTransformFactory();
return dmtf.createConcatenatedTransform(
latLonToCrs, crsToGrid);
} catch (Exception e) {
throw new VizException(
"Problem converting from lon/lat to requested grid geometry",
e);
}
}
/**
* Add all plugin data objects to resource
*
* @param pdos
*/
public void add(List<PluginDataObject> pdos) {
for (PluginDataObject pdo : pdos) {
addDataObject(pdo);
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#getName()
*/
@Override
public String getName() {
int res = resourceData.getKmResolution();
return LightningResource.formatResourceName(resourceData)
+ "Lightning " + res + "km Grid ";
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.grid.rsc.general.AbstractGridResource#project(org.opengis
* .referencing.crs.CoordinateReferenceSystem)
*/
@Override
public void project(CoordinateReferenceSystem crs) throws VizException {
clearRequestedData();
super.project(crs);
}
}

View file

@ -0,0 +1,119 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.lightning;
import java.util.Arrays;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
/**
* Configuration data needed to render lightning as grids
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 7, 2014 3333 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
@XmlAccessorType(XmlAccessType.NONE)
public class GridLightningResourceData extends LightningResourceData {
@XmlAttribute
/* defaults to 40km if not specified in bundle */
private int kmResolution = 40;
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.lightning.LightningResourceData#constructResource(com
* .raytheon.uf.viz.core.rsc.LoadProperties,
* com.raytheon.uf.common.dataplugin.PluginDataObject[])
*/
@Override
protected AbstractVizResource<?, ?> constructResource(
LoadProperties loadProperties, PluginDataObject[] objects) {
GridLightningResource rval = new GridLightningResource(this,
loadProperties);
rval.add(Arrays.asList(objects));
return rval;
}
/**
* @return the kmResolution
*/
public int getKmResolution() {
return kmResolution;
}
/**
* @param kmResolution
* the kmResolution to set
*/
public void setKmResolution(int kmResolution) {
this.kmResolution = kmResolution;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + kmResolution;
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
GridLightningResourceData other = (GridLightningResourceData) obj;
if (kmResolution != other.kmResolution)
return false;
return true;
}
}

View file

@ -20,11 +20,8 @@
package com.raytheon.viz.lightning;
import java.awt.Font;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -33,27 +30,13 @@ import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.swt.graphics.RGB;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.HDF5Util;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
import com.raytheon.uf.common.dataplugin.binlightning.LightningConstants;
import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgStrikeType;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.StorageException;
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
import com.raytheon.uf.common.datastorage.records.LongDataRecord;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
@ -62,7 +45,6 @@ import com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.cache.CacheObject;
import com.raytheon.uf.viz.core.cache.CacheObject.IObjectRetrieverAndDisposer;
import com.raytheon.uf.viz.core.drawables.IFont;
import com.raytheon.uf.viz.core.drawables.IFont.Style;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
@ -75,6 +57,9 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.DensityCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
import com.raytheon.viz.lightning.cache.LightningFrame;
import com.raytheon.viz.lightning.cache.LightningFrameMetadata;
import com.raytheon.viz.lightning.cache.LightningFrameRetriever;
/**
* LightningResource
@ -101,8 +86,10 @@ import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
* Jan 21, 2014 2667 bclement renamed record's lightSource field to source
* Jun 05, 2014 3226 bclement reference datarecords by LightningConstants
* Jun 06, 2014 DR 17367 D. Friedman Fix cache object usage.
* Jun 19, 2014 3214 bclement added pulse and could flash support
* Jul 09, 2014 3214 bclement fixed cache object usage for pulse and cloud flash
* Jun 19, 2014 3214 bclement added pulse and cloud flash support
* Jul 07, 2014 3333 bclement removed lightSource field
* Jul 10, 2014 3333 bclement moved cache object inner classes to own package
* moved name formatting to static method
*
* </pre>
*
@ -113,142 +100,6 @@ public class LightningResource extends
AbstractVizResource<LightningResourceData, IMapDescriptor> implements
IResourceDataChanged {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(LightningResource.class);
private static class LightningFrame {
public LightningFrameMetadata metadata;
public DataTime frameTime;
public List<double[]> posLatLonList = new ArrayList<double[]>();
public List<double[]> negLatLonList = new ArrayList<double[]>();
public List<double[]> cloudLatLonList = new ArrayList<double[]>();
public List<double[]> pulseLatLonList = new ArrayList<double[]>();
}
private static class LightningFrameMetadata {
private BinOffset offset;
private DataTime frameTime;
private String lightSource;
private List<BinLightningRecord> newRecords = new ArrayList<BinLightningRecord>();
private List<BinLightningRecord> processed = new ArrayList<BinLightningRecord>();
public LightningFrameMetadata(DataTime frameTime, BinOffset offset, String ls) {
this.frameTime = frameTime;
this.offset = offset;
this.lightSource = ls;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((frameTime == null) ? 0 : frameTime.hashCode());
result = prime * result
+ ((offset == null) ? 0 : offset.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LightningFrameMetadata other = (LightningFrameMetadata) obj;
if (frameTime == null) {
if (other.frameTime != null)
return false;
} else if (!frameTime.equals(other.frameTime))
return false;
if (offset == null) {
if (other.offset != null)
return false;
} else if (!offset.equals(other.offset))
return false;
if (lightSource == null) {
if (other.lightSource != null)
return false;
} else if (!lightSource.equals(other.lightSource))
return false;
return true;
}
}
private static class LightningFrameRetriever implements
IObjectRetrieverAndDisposer<LightningFrameMetadata, LightningFrame> {
@Override
public LightningFrame retrieveObject(LightningFrameMetadata metadata) {
synchronized (metadata) {
LightningFrame bundle = new LightningFrame();
bundle.frameTime = metadata.frameTime;
bundle.metadata = metadata;
populateData(metadata, bundle);
return bundle;
}
}
@Override
public int getSize(LightningFrame object) {
int doubleCount = 0;
if (object != null) {
synchronized (object) {
doubleCount += getSize(object.posLatLonList);
doubleCount += getSize(object.negLatLonList);
doubleCount += getSize(object.cloudLatLonList);
doubleCount += getSize(object.pulseLatLonList);
}
}
// 8 bytes per double
return doubleCount * 8;
}
/**
* @param lonLatList
* @return total number of doubles in list
*/
private static int getSize(List<double[]> lonLatList) {
int rval = 0;
for (double[] arr : lonLatList) {
rval += arr.length;
}
return rval;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.cache.CacheObject.IObjectRetrieverAndDisposer
* #disposeObject(java.lang.Object)
*/
@Override
public void disposeObject(LightningFrame object) {
LightningFrameMetadata metadata = object.metadata;
synchronized (metadata) {
metadata.newRecords.addAll(metadata.processed);
metadata.processed.clear();
}
}
}
private static final LightningFrameRetriever resourceBuilder = new LightningFrameRetriever();
private Map<DataTime, CacheObject<LightningFrameMetadata, LightningFrame>> cacheObjectMap;
private DataTime lastPaintedTime;
@ -257,8 +108,6 @@ public class LightningResource extends
private String resourceName;
private String lightSource;
private int posAdj;
private IFont font;
@ -272,13 +121,12 @@ public class LightningResource extends
private List<double[]> currPulseList = Collections.emptyList();
public LightningResource(LightningResourceData resourceData,
LoadProperties loadProperties, String ls, int pa) {
LoadProperties loadProperties, int pa) {
super(resourceData, loadProperties);
resourceData.addChangeListener(this);
this.dataTimes = new ArrayList<DataTime>();
this.cacheObjectMap = new ConcurrentHashMap<DataTime, CacheObject<LightningFrameMetadata, LightningFrame>>();
this.lightSource = ls;
this.posAdj = pa;
}
@ -329,52 +177,71 @@ public class LightningResource extends
}
});
this.resourceName = formatResourceName(resourceData)
+ "Lightning Plot ";
}
String timeString = "";
int absTimeInterval = Math.abs(this.resourceData.getBinOffset()
/**
* Create a resource name string from resource data configuration. Includes
* time interval, cloud flash, pos/neg, pulse and source name.
*
* @param resourceData
* @return
*/
public static String formatResourceName(LightningResourceData resourceData) {
String rval = "";
int absTimeInterval = Math.abs(resourceData.getBinOffset()
.getInterval());
// If a virtual offset is provided, it is aged lightning, so use
// the virtual offset to provide the "Old" time
int virtualOffset = this.resourceData.getBinOffset().getVirtualOffset();
int virtualOffset = resourceData.getBinOffset().getVirtualOffset();
if (virtualOffset != 0) {
timeString = convertTimeIntervalToString(virtualOffset) + "Old ";
rval = convertTimeIntervalToString(virtualOffset) + "Old ";
} else {
timeString = convertTimeIntervalToString(absTimeInterval);
rval = convertTimeIntervalToString(absTimeInterval);
}
if (this.resourceData.isExclusiveForType()) {
if (resourceData.isExclusiveForType()) {
String modifier;
if (this.resourceData.isHandlingCloudFlashes()) {
modifier = "Cloud Flash";
} else if (this.resourceData.isHandlingNegativeStrikes()) {
modifier = "Negative";
} else if (this.resourceData.isHandlingPositiveStrikes()) {
modifier = "Positive";
} else if (this.resourceData.isHandlingPulses()) {
modifier = "Pulse";
if (resourceData.isHandlingCloudFlashes()) {
modifier = "Cloud Flash ";
} else if (resourceData.isHandlingNegativeStrikes()) {
modifier = "Negative ";
} else if (resourceData.isHandlingPositiveStrikes()) {
modifier = "Positive ";
} else if (resourceData.isHandlingPulses()) {
modifier = "Pulse ";
} else {
modifier = "";
/* space to preserve formatting */
modifier = " ";
}
this.resourceName = timeString + modifier;
} else {
this.resourceName = timeString;
rval += modifier;
}
String lightType = " ";
if (!this.lightSource.isEmpty()) {
lightType += this.lightSource + " ";
HashMap<String, RequestConstraint> metadata = resourceData
.getMetadataMap();
if (metadata != null && metadata.containsKey(LightningConstants.SOURCE)) {
rval += metadata.get(LightningConstants.SOURCE)
.getConstraintValue() + " ";
}
this.resourceName += lightType + "Lightning Plot ";
return rval;
}
private String convertTimeIntervalToString(int time) {
/**
* Format time interval to human readable display string
*
* @param time
* in seconds
* @return
*/
private static String convertTimeIntervalToString(int time) {
time = Math.abs(time);
String timeString = null;
if (time >= 60 * 60) {
int hrs = time / (60 * 60);
if (time >= TimeUtil.SECONDS_PER_HOUR) {
int hrs = time / (TimeUtil.SECONDS_PER_HOUR);
timeString = hrs + " Hour ";
} else if (time < 60 * 60) {
int mins = time / 60;
} else {
int mins = time / TimeUtil.SECONDS_PER_MINUTE;
timeString = mins + " Minute ";
}
@ -430,16 +297,20 @@ public class LightningResource extends
if (needsUpdate) {
needsUpdate = false;
if (resourceData.isHandlingNegativeStrikes()) {
currNegList = convertToPixel(bundle.negLatLonList);
currNegList = convertToPixel(bundle
.getNegLatLonList());
}
if (resourceData.isHandlingPositiveStrikes()) {
currPosList = convertToPixel(bundle.posLatLonList);
currPosList = convertToPixel(bundle
.getPosLatLonList());
}
if (resourceData.isHandlingCloudFlashes()) {
currCloudList = convertToPixel(bundle.cloudLatLonList);
currCloudList = convertToPixel(bundle
.getCloudLatLonList());
}
if (resourceData.isHandlingPulses()) {
currPulseList = convertToPixel(bundle.pulseLatLonList);
currPulseList = convertToPixel(bundle
.getPulseLatLonList());
}
}
@ -571,7 +442,8 @@ public class LightningResource extends
if (co != null) {
LightningFrameMetadata metadata = co.getMetadata();
synchronized (metadata) {
if (metadata.newRecords.size() + metadata.processed.size() < 2) {
if (metadata.getNewRecords().size()
+ metadata.getProcessed().size() < 2) {
return;
}
}
@ -586,30 +458,28 @@ public class LightningResource extends
Map<DataTime, List<BinLightningRecord>> recordMap = new HashMap<DataTime, List<BinLightningRecord>>();
for (BinLightningRecord obj : objs) {
if (obj.getSource().equals(this.lightSource) || this.lightSource.isEmpty()) {
DataTime time = new DataTime(obj.getStartTime());
DataTime end = new DataTime(obj.getStopTime());
time = this.getResourceData().getBinOffset()
.getNormalizedTime(time);
end = this.getResourceData().getBinOffset().getNormalizedTime(end);
DataTime time = new DataTime(obj.getStartTime());
DataTime end = new DataTime(obj.getStopTime());
time = this.getResourceData().getBinOffset()
.getNormalizedTime(time);
end = this.getResourceData().getBinOffset().getNormalizedTime(end);
// check for frames in the middle
// get interval ( in seconds ) between frames
int interval = this.getResourceData().getBinOffset().getInterval();
while (end.greaterThan(time) || end.equals(time)) {
List<BinLightningRecord> records = recordMap.get(time);
if (records == null) {
records = new ArrayList<BinLightningRecord>();
recordMap.put(time, records);
}
records.add(obj);
// check for frames in the middle
// get interval ( in seconds ) between frames
int interval = this.getResourceData().getBinOffset().getInterval();
while (end.greaterThan(time) || end.equals(time)) {
List<BinLightningRecord> records = recordMap.get(time);
if (records == null) {
records = new ArrayList<BinLightningRecord>();
recordMap.put(time, records);
}
records.add(obj);
// increment to the next time
long newTime = time.getRefTime().getTime() + (interval * 1000);
TimeRange range = new TimeRange(newTime, newTime);
time = new DataTime(newTime, range);
}
}
// increment to the next time
long newTime = time.getRefTime().getTime() + (interval * 1000);
TimeRange range = new TimeRange(newTime, newTime);
time = new DataTime(newTime, range);
}
}
for (Map.Entry<DataTime, List<BinLightningRecord>> entry : recordMap
@ -621,42 +491,25 @@ public class LightningResource extends
List<BinLightningRecord> records = entry.getValue();
LightningFrameMetadata frame;
LightningFrameRetriever retriever = LightningFrameRetriever
.getInstance();
CacheObject<LightningFrameMetadata, LightningFrame> co;
synchronized (cacheObjectMap) {
co = cacheObjectMap.get(dt);
if (co == null) {
// New frame
/*
* no local reference to cache object, create key and get
* cache object which may be new or from another resource
*/
LightningFrameMetadata key = new LightningFrameMetadata(dt,
resourceData.getBinOffset(), this.lightSource);
co = CacheObject.newCacheObject(key, resourceBuilder);
resourceData.getBinOffset());
co = CacheObject.newCacheObject(key, retriever);
cacheObjectMap.put(dt, co);
dataTimes.add(dt);
}
}
frame = co.getMetadata();
synchronized (frame) {
// Add as new records
for (BinLightningRecord record : records) {
if (frame.newRecords.contains(record) == false
&& frame.processed.contains(record) == false) {
frame.newRecords.add(record);
}
}
if (frame.processed.size() > 0 && frame.newRecords.size() > 0) {
// if we've already processed some records, request the
// new ones now and merge
LightningFrame existing = co.getObjectSync();
LightningFrame newBundle = resourceBuilder
.retrieveObject(frame);
existing.posLatLonList.addAll(newBundle.posLatLonList);
existing.negLatLonList.addAll(newBundle.negLatLonList);
existing.cloudLatLonList.addAll(newBundle.cloudLatLonList);
existing.pulseLatLonList.addAll(newBundle.pulseLatLonList);
}
}
retriever.updateAndGet(records, co);
}
issueRefresh();
}
@ -690,220 +543,4 @@ public class LightningResource extends
issueRefresh();
}
private static void populateData(LightningFrameMetadata frame,
LightningFrame bundle) {
long t0 = System.currentTimeMillis();
long strikeCount = 0;
long dsTime = 0;
// Bin up requests to the same hdf5
Map<File, List<BinLightningRecord>> fileMap = new HashMap<File, List<BinLightningRecord>>();
for (BinLightningRecord record : frame.newRecords) {
File f = HDF5Util.findHDF5Location(record);
List<BinLightningRecord> recList = fileMap.get(f);
if (recList == null) {
recList = new ArrayList<BinLightningRecord>();
fileMap.put(f, recList);
}
recList.add(record);
frame.processed.add(record);
}
frame.newRecords.clear();
for (File f : fileMap.keySet()) {
List<BinLightningRecord> recList = fileMap.get(f);
String[] groups = new String[recList.size()];
for (int i = 0; i < recList.size(); i++) {
groups[i] = recList.get(i).getDataURI();
}
// Go fetch data
try {
long tDS0 = System.currentTimeMillis();
IDataStore ds = DataStoreFactory.getDataStore(f);
IDataRecord[] records = ds.retrieveGroups(groups, Request.ALL);
long tDS1 = System.currentTimeMillis();
dsTime += (tDS1 - tDS0);
// Throw in a map for easy accessibility
Map<String, List<IDataRecord>> recordMap = createRecordMap(records);
List<IDataRecord> times = recordMap
.get(LightningConstants.TIME_DATASET);
List<IDataRecord> intensities = recordMap
.get(LightningConstants.INTENSITY_DATASET);
List<IDataRecord> lats = recordMap
.get(LightningConstants.LAT_DATASET);
List<IDataRecord> lons = recordMap
.get(LightningConstants.LON_DATASET);
List<IDataRecord> types = recordMap
.get(LightningConstants.STRIKE_TYPE_DATASET);
List<IDataRecord> pulseIndexes = recordMap
.get(LightningConstants.PULSE_INDEX_DATASET);
int k = 0;
for (IDataRecord timeRec : times) {
if (hasPulseData(pulseIndexes, k)) {
populatePulseData(frame, bundle, timeRec.getGroup(), ds);
}
LongDataRecord time = (LongDataRecord) timeRec;
// Now loop through the obs times and intensities and
// start categorizing strikes
int numRecords = (int) time.getSizes()[0];
long[] timeData = time.getLongData();
int[] intensityData = ((IntegerDataRecord) intensities
.get(k)).getIntData();
float[] latitudeData = ((FloatDataRecord) lats.get(k))
.getFloatData();
float[] longitudeData = ((FloatDataRecord) lons.get(k))
.getFloatData();
byte[] typeData = ((ByteDataRecord) types.get(k))
.getByteData();
for (int i = 0; i < numRecords; i++) {
DataTime dt = new DataTime(new Date(timeData[i]));
dt = frame.offset.getNormalizedTime(dt);
List<double[]> list;
LtgStrikeType type = LtgStrikeType.getById(typeData[i]);
switch(type){
case CLOUD_TO_CLOUD:
list = bundle.cloudLatLonList;
break;
default:
if (intensityData[i] > 0) {
list = bundle.posLatLonList;
} else {
list = bundle.negLatLonList;
}
break;
}
double[] latLon = new double[] { longitudeData[i],
latitudeData[i] };
// only add the strike to the list if the data time
// of the strike matches the data time of the frame
if (dt.equals(bundle.frameTime)) {
list.add(latLon);
strikeCount++;
}
}
k++;
}
} catch (StorageException e) {
statusHandler.handle(Priority.PROBLEM,
"Storage error retrieving lightning data", e);
} catch (FileNotFoundException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to open lightning file", e);
}
}
long t1 = System.currentTimeMillis();
System.out.println("Decoded: " + strikeCount + " strikes in "
+ (t1 - t0) + "ms (hdf5 time = " + dsTime + "ms)");
}
/**
* Unpack records into map keyed by record name
*
* @param records
* @return
*/
private static Map<String, List<IDataRecord>> createRecordMap(
IDataRecord[] records) {
Map<String, List<IDataRecord>> recordMap = new HashMap<String, List<IDataRecord>>();
for (IDataRecord rec : records) {
List<IDataRecord> recordList = recordMap.get(rec.getName());
if (recordList == null) {
recordList = new ArrayList<IDataRecord>();
recordMap.put(rec.getName(), recordList);
}
recordList.add(rec);
}
return recordMap;
}
/**
* Search records and return first found with name
*
* @param records
* @param name
* @return null if none found
*/
private static IDataRecord findDataRecord(IDataRecord[] records, String name) {
IDataRecord rval = null;
for (IDataRecord record : records) {
if (record.getName().equals(name)) {
rval = record;
break;
}
}
return rval;
}
/**
* @param pulseIndexes
* @param recordIndex
* @return true if any data record in list has a valid pulse index
*/
private static boolean hasPulseData(List<IDataRecord> pulseIndexes,
int recordIndex) {
if (pulseIndexes != null) {
IDataRecord record = pulseIndexes.get(recordIndex);
int[] indexData = ((IntegerDataRecord) record).getIntData();
for (int i = 0; i < indexData.length; ++i) {
if (indexData[i] >= 0) {
return true;
}
}
}
return false;
}
/**
* Read pulse data from datastore and populate in frame
*
* @param frame
* @param bundle
* @param group
* @param ds
*/
private static void populatePulseData(LightningFrameMetadata frame,
LightningFrame bundle, String group, IDataStore ds) {
try {
IDataRecord[] records = ds.retrieve(group + DataURI.SEPARATOR
+ LightningConstants.PULSE_HDF5_GROUP_SUFFIX);
FloatDataRecord latRecord = (FloatDataRecord) findDataRecord(
records, LightningConstants.LAT_DATASET);
FloatDataRecord lonRecord = (FloatDataRecord) findDataRecord(
records, LightningConstants.LON_DATASET);
if (latRecord == null || lonRecord == null) {
throw new StorageException(
"Missing pulse latitude and/or longitude data", null);
}
float[] lats = latRecord.getFloatData();
float[] lons = lonRecord.getFloatData();
if (lats.length != lons.length) {
throw new StorageException(
"Mismatched pulse latitude/longitude data", latRecord);
}
for (int i = 0; i < lats.length; ++i) {
bundle.pulseLatLonList.add(new double[] { lons[i], lats[i] });
}
} catch (FileNotFoundException e) {
statusHandler.error("Unable to open lightning file", e);
} catch (StorageException e) {
statusHandler.error("Unable to read pulse datasets for group "
+ group, e);
}
}
}

View file

@ -28,8 +28,6 @@ import javax.xml.bind.annotation.XmlAttribute;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -47,7 +45,8 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
* ------------ ---------- ----------- --------------------------
* Feb 18, 2009 chammack Initial creation
* Feb 27, 2013 DCS 152 jgerth Support for WWLLN and multiple sources
* Jun 19, 2014 3214 bclement added pulse and could flash support
* Jun 19, 2014 3214 bclement added pulse and cloud flash support
* Jul 07, 2014 3333 bclement removed plotLightSource field
*
* </pre>
*
@ -71,29 +70,14 @@ public class LightningResourceData extends AbstractRequestableResourceData {
@XmlAttribute
private boolean handlingPulses = false;
@XmlAttribute
private String plotLightSource = "";
@XmlAttribute
private int countPosition = 0;
@Override
protected AbstractVizResource<?, ?> constructResource(
LoadProperties loadProperties, PluginDataObject[] objects) {
// jjg add
String ls = "";
if (this.metadataMap.containsKey("lightSource"))
ls = this.metadataMap.get("lightSource").getConstraintValue();
else if (!plotLightSource.isEmpty()) {
ls = plotLightSource;
RequestConstraint lsrc = new RequestConstraint(ls, ConstraintType.EQUALS);
this.metadataMap.put("lightSource", lsrc);
}
int pa = 0;
if (countPosition != 0)
pa = countPosition;
// end
LightningResource rsc = new LightningResource(this, loadProperties, ls, pa);
LightningResource rsc = new LightningResource(this, loadProperties,
countPosition);
List<BinLightningRecord> records = new ArrayList<BinLightningRecord>(
objects.length);
for (PluginDataObject pdo : objects) {
@ -208,21 +192,6 @@ public class LightningResourceData extends AbstractRequestableResourceData {
this.handlingPulses = handlingPulses;
}
/**
* @return plotLightSource the lightSource to get - JJG
*/
public String getPlotLightSource() {
return plotLightSource;
}
/**
* @param plotLightSource
* the lightSource to set - JJG
*/
public void setPlotLightSource(String plotLightSource) {
this.plotLightSource = plotLightSource;
}
/**
* @return countPosition
* the countPosition to get - JJG
@ -253,8 +222,6 @@ public class LightningResourceData extends AbstractRequestableResourceData {
result = prime * result + (handlingNegativeStrikes ? 1231 : 1237);
result = prime * result + (handlingPositiveStrikes ? 1231 : 1237);
result = prime * result + (handlingPulses ? 1231 : 1237);
result = prime * result
+ ((plotLightSource == null) ? 0 : plotLightSource.hashCode());
return result;
}
@ -282,11 +249,6 @@ public class LightningResourceData extends AbstractRequestableResourceData {
return false;
if (handlingPulses != other.handlingPulses)
return false;
if (plotLightSource == null) {
if (other.plotLightSource != null)
return false;
} else if (!plotLightSource.equals(other.plotLightSource))
return false;
return true;
}

View file

@ -0,0 +1,148 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.lightning.cache;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.common.time.DataTime;
/**
* Lightning location data for a single time frame. Data is separated out by
* flash/pulse category.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 9, 2014 3333 bclement moved from LightningResource
* added merge() and getDataSize()
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class LightningFrame {
private final LightningFrameMetadata metadata;
private final DataTime frameTime;
private final List<double[]> posLatLonList = new ArrayList<double[]>();
private final List<double[]> negLatLonList = new ArrayList<double[]>();
private final List<double[]> cloudLatLonList = new ArrayList<double[]>();
private final List<double[]> pulseLatLonList = new ArrayList<double[]>();
private static final int BYTES_PER_DOUBLE = Double.SIZE / Byte.SIZE;
/**
* @param frameTime
* @param metadata
*/
public LightningFrame(DataTime frameTime, LightningFrameMetadata metadata) {
this.frameTime = frameTime;
this.metadata = metadata;
}
/**
* Add all locations from other to this frame
*
* @param other
*/
public void merge(LightningFrame other) {
this.posLatLonList.addAll(other.posLatLonList);
this.negLatLonList.addAll(other.negLatLonList);
this.cloudLatLonList.addAll(other.cloudLatLonList);
this.pulseLatLonList.addAll(other.pulseLatLonList);
}
/**
* @return total size of location data in bytes
*/
public int getDataSize() {
int doubleCount = 0;
doubleCount += getSize(getPosLatLonList());
doubleCount += getSize(getNegLatLonList());
doubleCount += getSize(getCloudLatLonList());
doubleCount += getSize(getPulseLatLonList());
return doubleCount * BYTES_PER_DOUBLE;
}
/**
* @param lonLatList
* @return total number of doubles in list
*/
private static int getSize(List<double[]> lonLatList) {
int rval = 0;
for (double[] arr : lonLatList) {
rval += arr.length;
}
return rval;
}
/**
* @return the metadata
*/
public LightningFrameMetadata getMetadata() {
return metadata;
}
/**
* @return the frameTime
*/
public DataTime getFrameTime() {
return frameTime;
}
/**
* @return the posLatLonList
*/
public List<double[]> getPosLatLonList() {
return posLatLonList;
}
/**
* @return the negLatLonList
*/
public List<double[]> getNegLatLonList() {
return negLatLonList;
}
/**
* @return the cloudLatLonList
*/
public List<double[]> getCloudLatLonList() {
return cloudLatLonList;
}
/**
* @return the pulseLatLonList
*/
public List<double[]> getPulseLatLonList() {
return pulseLatLonList;
}
}

View file

@ -0,0 +1,119 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.lightning.cache;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.common.time.DataTime;
/**
* Time and record data used to create a LightningFrame
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 9, 2014 3333 bclement moved from LightningResource
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class LightningFrameMetadata {
private final BinOffset offset;
private final DataTime frameTime;
private final List<BinLightningRecord> newRecords = new ArrayList<BinLightningRecord>();
private final List<BinLightningRecord> processed = new ArrayList<BinLightningRecord>();
public LightningFrameMetadata(DataTime frameTime, BinOffset offset) {
this.frameTime = frameTime;
this.offset = offset;
}
/**
* @return the offset
*/
public BinOffset getOffset() {
return offset;
}
/**
* @return the frameTime
*/
public DataTime getFrameTime() {
return frameTime;
}
/**
* @return the newRecords
*/
public List<BinLightningRecord> getNewRecords() {
return newRecords;
}
/**
* @return the processed
*/
public List<BinLightningRecord> getProcessed() {
return processed;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((frameTime == null) ? 0 : frameTime.hashCode());
result = prime * result + ((offset == null) ? 0 : offset.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
LightningFrameMetadata other = (LightningFrameMetadata) obj;
if (frameTime == null) {
if (other.frameTime != null)
return false;
} else if (!frameTime.equals(other.frameTime))
return false;
if (offset == null) {
if (other.offset != null)
return false;
} else if (!offset.equals(other.offset))
return false;
return true;
}
}

View file

@ -0,0 +1,398 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.lightning.cache;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.dataplugin.HDF5Util;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
import com.raytheon.uf.common.dataplugin.binlightning.LightningConstants;
import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgStrikeType;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
import com.raytheon.uf.common.datastorage.IDataStore;
import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.StorageException;
import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
import com.raytheon.uf.common.datastorage.records.LongDataRecord;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.cache.CacheObject;
import com.raytheon.uf.viz.core.cache.CacheObject.IObjectRetrieverAndDisposer;
/**
* Cache object retriever for lighting frame data. Singleton to ensure that
* cached data is shared between resources.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 9, 2014 3333 bclement moved from LightningResource
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class LightningFrameRetriever implements
IObjectRetrieverAndDisposer<LightningFrameMetadata, LightningFrame> {
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(LightningFrameRetriever.class);
private static final LightningFrameRetriever instance = new LightningFrameRetriever();
/**
* @return singleton instance
*/
public static LightningFrameRetriever getInstance() {
return instance;
}
/**
* singleton constructor
*/
private LightningFrameRetriever() {
}
/**
* Add any new records to cache and return the updated frame
*
* @param records
* @param co
* @return
*/
public LightningFrame updateAndGet(List<BinLightningRecord> records,
CacheObject<LightningFrameMetadata, LightningFrame> co) {
LightningFrameMetadata metadata = co.getMetadata();
LightningFrame rval;
synchronized (metadata) {
// Add as new records
List<BinLightningRecord> newRecords = metadata.getNewRecords();
List<BinLightningRecord> processed = metadata.getProcessed();
for (BinLightningRecord record : records) {
if (newRecords.contains(record) == false
&& processed.contains(record) == false) {
newRecords.add(record);
}
}
rval = co.getObjectAsync();
if (processed.size() > 0 && newRecords.size() > 0) {
// if we've already processed some records, request the
// new ones now and merge
LightningFrame newBundle = retrieveObject(metadata);
rval.merge(newBundle);
}
}
return rval;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.cache.CacheObject.IObjectRetriever#retrieveObject
* (java.lang.Object)
*/
@Override
public LightningFrame retrieveObject(LightningFrameMetadata metadata) {
synchronized (metadata) {
LightningFrame bundle = new LightningFrame(metadata.getFrameTime(),
metadata);
populateData(metadata, bundle);
return bundle;
}
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.cache.CacheObject.IObjectRetriever#getSize(java
* .lang.Object)
*/
@Override
public int getSize(LightningFrame object) {
int rval = 0;
if (object != null) {
synchronized (object) {
rval = object.getDataSize();
}
}
return rval;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.cache.CacheObject.IObjectRetrieverAndDisposer
* #disposeObject(java.lang.Object)
*/
@Override
public void disposeObject(LightningFrame object) {
LightningFrameMetadata metadata = object.getMetadata();
synchronized (metadata) {
List<BinLightningRecord> newRecords = metadata.getNewRecords();
List<BinLightningRecord> processed = metadata.getProcessed();
newRecords.addAll(processed);
processed.clear();
}
}
/**
* Populate frame with data from HDF5
*
* @param frame
* @param bundle
*/
private static void populateData(final LightningFrameMetadata frame,
LightningFrame bundle) {
long t0 = System.currentTimeMillis();
long strikeCount = 0;
long dsTime = 0;
// Bin up requests to the same hdf5
Map<File, List<BinLightningRecord>> fileMap = new HashMap<File, List<BinLightningRecord>>();
List<BinLightningRecord> newRecords = frame.getNewRecords();
List<BinLightningRecord> processed = frame.getProcessed();
for (BinLightningRecord record : newRecords) {
File f = HDF5Util.findHDF5Location(record);
List<BinLightningRecord> recList = fileMap.get(f);
if (recList == null) {
recList = new ArrayList<BinLightningRecord>();
fileMap.put(f, recList);
}
recList.add(record);
processed.add(record);
}
newRecords.clear();
for (File f : fileMap.keySet()) {
List<BinLightningRecord> recList = fileMap.get(f);
String[] groups = new String[recList.size()];
for (int i = 0; i < recList.size(); i++) {
groups[i] = recList.get(i).getDataURI();
}
// Go fetch data
try {
long tDS0 = System.currentTimeMillis();
IDataStore ds = DataStoreFactory.getDataStore(f);
IDataRecord[] records = ds.retrieveGroups(groups, Request.ALL);
long tDS1 = System.currentTimeMillis();
dsTime += (tDS1 - tDS0);
// Throw in a map for easy accessibility
Map<String, List<IDataRecord>> recordMap = createRecordMap(records);
List<IDataRecord> times = recordMap
.get(LightningConstants.TIME_DATASET);
List<IDataRecord> intensities = recordMap
.get(LightningConstants.INTENSITY_DATASET);
List<IDataRecord> lats = recordMap
.get(LightningConstants.LAT_DATASET);
List<IDataRecord> lons = recordMap
.get(LightningConstants.LON_DATASET);
List<IDataRecord> types = recordMap
.get(LightningConstants.STRIKE_TYPE_DATASET);
List<IDataRecord> pulseIndexes = recordMap
.get(LightningConstants.PULSE_INDEX_DATASET);
int k = 0;
for (IDataRecord timeRec : times) {
if (hasPulseData(pulseIndexes, k)) {
populatePulseData(frame, bundle, timeRec.getGroup(), ds);
}
LongDataRecord time = (LongDataRecord) timeRec;
// Now loop through the obs times and intensities and
// start categorizing strikes
int numRecords = (int) time.getSizes()[0];
long[] timeData = time.getLongData();
int[] intensityData = ((IntegerDataRecord) intensities
.get(k)).getIntData();
float[] latitudeData = ((FloatDataRecord) lats.get(k))
.getFloatData();
float[] longitudeData = ((FloatDataRecord) lons.get(k))
.getFloatData();
byte[] typeData = ((ByteDataRecord) types.get(k))
.getByteData();
for (int i = 0; i < numRecords; i++) {
DataTime dt = new DataTime(new Date(timeData[i]));
dt = frame.getOffset().getNormalizedTime(dt);
List<double[]> list;
LtgStrikeType type = LtgStrikeType.getById(typeData[i]);
switch (type) {
case CLOUD_TO_CLOUD:
list = bundle.getCloudLatLonList();
break;
default:
if (intensityData[i] > 0) {
list = bundle.getPosLatLonList();
} else {
list = bundle.getNegLatLonList();
}
break;
}
double[] latLon = new double[] { longitudeData[i],
latitudeData[i] };
// only add the strike to the list if the data time
// of the strike matches the data time of the frame
if (dt.equals(bundle.getFrameTime())) {
list.add(latLon);
strikeCount++;
}
}
k++;
}
} catch (StorageException e) {
statusHandler.handle(Priority.PROBLEM,
"Storage error retrieving lightning data", e);
} catch (FileNotFoundException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to open lightning file", e);
}
}
long t1 = System.currentTimeMillis();
System.out.println("Decoded: " + strikeCount + " strikes in "
+ (t1 - t0) + "ms (hdf5 time = " + dsTime + "ms)");
}
/**
* Unpack records into map keyed by record name
*
* @param records
* @return
*/
public static Map<String, List<IDataRecord>> createRecordMap(
IDataRecord[] records) {
Map<String, List<IDataRecord>> recordMap = new HashMap<String, List<IDataRecord>>();
for (IDataRecord rec : records) {
List<IDataRecord> recordList = recordMap.get(rec.getName());
if (recordList == null) {
recordList = new ArrayList<IDataRecord>();
recordMap.put(rec.getName(), recordList);
}
recordList.add(rec);
}
return recordMap;
}
/**
* Search records and return first found with name
*
* @param records
* @param name
* @return null if none found
*/
private static IDataRecord findDataRecord(IDataRecord[] records, String name) {
IDataRecord rval = null;
for (IDataRecord record : records) {
if (record.getName().equals(name)) {
rval = record;
break;
}
}
return rval;
}
/**
* @param pulseIndexes
* @param recordIndex
* @return true if any data record in list has a valid pulse index
*/
private static boolean hasPulseData(List<IDataRecord> pulseIndexes,
int recordIndex) {
if (pulseIndexes != null) {
IDataRecord record = pulseIndexes.get(recordIndex);
int[] indexData = ((IntegerDataRecord) record).getIntData();
for (int i = 0; i < indexData.length; ++i) {
if (indexData[i] >= 0) {
return true;
}
}
}
return false;
}
/**
* Read pulse data from datastore and populate in frame
*
* @param frame
* @param bundle
* @param group
* @param ds
*/
private static void populatePulseData(LightningFrameMetadata frame,
LightningFrame bundle, String group, IDataStore ds) {
try {
IDataRecord[] records = ds.retrieve(group + DataURI.SEPARATOR
+ LightningConstants.PULSE_HDF5_GROUP_SUFFIX);
FloatDataRecord latRecord = (FloatDataRecord) findDataRecord(
records, LightningConstants.LAT_DATASET);
FloatDataRecord lonRecord = (FloatDataRecord) findDataRecord(
records, LightningConstants.LON_DATASET);
if (latRecord == null || lonRecord == null) {
throw new StorageException(
"Missing pulse latitude and/or longitude data", null);
}
float[] lats = latRecord.getFloatData();
float[] lons = lonRecord.getFloatData();
if (lats.length != lons.length) {
throw new StorageException(
"Mismatched pulse latitude/longitude data", latRecord);
}
for (int i = 0; i < lats.length; ++i) {
bundle.getPosLatLonList()
.add(new double[] { lons[i], lats[i] });
}
} catch (FileNotFoundException e) {
statusHandler.error("Unable to open lightning file", e);
} catch (StorageException e) {
statusHandler.error("Unable to read pulse datasets for group "
+ group, e);
}
}
}

View file

@ -0,0 +1,11 @@
#!/bin/bash
tables=$(psql -U awips -d metadata -tc "select table_name from information_schema.columns where column_name = 'reftime'")
echo "Updating record tables to disallow null times"
for table in $tables
do
echo "Updating $table"
psql -U awips -d metadata -c "ALTER TABLE $table ALTER COLUMN reftime SET NOT NULL"
done
echo "Done"

View file

@ -52,16 +52,13 @@
<constructor-arg value="com.raytheon.uf.common.dataplugin.gfe.request.GetDiscreteDefinitionRequest"/>
<constructor-arg ref="discreteDefinitionHandler"/>
</bean>
<bean id="gridDataHandler" class="com.raytheon.edex.plugin.gfe.server.handler.GetGridDataHandler"/>
<bean id="gridDataHandler" class="com.raytheon.edex.plugin.gfe.server.handler.GetGridDataHandler">
<property name="byteLimitInMB" value="${thriftService.byteLimitInMB}" />
</bean>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.dataplugin.gfe.request.GetGridDataRequest"/>
<constructor-arg ref="gridDataHandler"/>
</bean>
<bean id="pythonGridDataHandler" class="com.raytheon.edex.plugin.gfe.server.handler.GetPythonGridDataHandler"/>
<bean factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.dataplugin.gfe.request.GetPythonGridDataRequest"/>
<constructor-arg ref="pythonGridDataHandler"/>
</bean>
<bean id="gridInventoryHandler" class="com.raytheon.edex.plugin.gfe.server.handler.GetGridInventoryHandler"/>
<bean id="getGridInventoryRequestRegister" factory-bean="handlerRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.common.dataplugin.gfe.request.GetGridInventoryRequest"/>

View file

@ -28,7 +28,6 @@ import java.util.List;
import java.util.Map;
import com.raytheon.edex.plugin.gfe.db.dao.GFEDao;
import com.raytheon.edex.plugin.gfe.server.database.D2DGridDatabase;
import com.raytheon.edex.plugin.gfe.server.database.GridDatabase;
import com.raytheon.edex.plugin.gfe.server.lock.LockManager;
import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory;
@ -76,6 +75,7 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory;
* 04/23/13 #1949 rjpeter Removed excess validation on retrieval, added
* inventory for a given time range.
* 06/13/13 #2044 randerso Refactored to use non-singleton LockManager
* 07/01/2014 #3149 randerso Removed unit conversion (unused)
* </pre>
*
* @author bphillip
@ -325,12 +325,7 @@ public class GridParm {
if (!CollectionUtil.isNullOrEmpty(reqTimes)) {
// Get the data
if (getRequest.isConvertUnit() && (db instanceof D2DGridDatabase)) {
sr = ((D2DGridDatabase) db).getGridData(id, reqTimes,
getRequest.isConvertUnit());
} else {
sr = db.getGridData(id, reqTimes);
}
sr = db.getGridData(id, reqTimes);
if (!sr.isOkay()) {
sr.addMessage("Failure in retrieving grid data from GridDatabase");
return sr;

View file

@ -20,23 +20,35 @@
package com.raytheon.edex.plugin.gfe.server.handler;
import java.util.Arrays;
import java.util.List;
import com.raytheon.edex.plugin.gfe.server.GridParmManager;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GridParmInfo;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.uf.common.dataplugin.gfe.request.GetGridDataRequest;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.dataplugin.gfe.server.request.GetGridRequest;
import com.raytheon.uf.common.dataplugin.gfe.slice.IGridSlice;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.util.SizeUtil;
/**
* GFE task for getting grid data slices
*
* May return less than the full amount of data requested if returned grids
* exceed MAX_BYTES_PER_REQUEST in total size. The requestor is expected to
* re-request remaining data.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 04/18/08 #875 bphillip Initial Creation
* 09/22/09 3058 rjpeter Converted to IRequestHandler
* 06/13/13 2044 randerso Refactored to use IFPServer
* 06/13/13 2044 randerso Refactored to use IFPServer
* 07/01/2014 #3149 randerso Changed to limit size of data returned
* </pre>
*
* @author randerso
@ -44,10 +56,98 @@ import com.raytheon.uf.common.serialization.comm.IRequestHandler;
*/
public class GetGridDataHandler extends BaseGfeRequestHandler implements
IRequestHandler<GetGridDataRequest> {
private int byteLimitInMB = 100;
/**
* @return the byteLimitInMB
*/
public int getByteLimitInMB() {
return this.byteLimitInMB;
}
/**
* @param byteLimitInMB
* the byteLimitInMB to set
*/
public void setByteLimitInMB(int byteLimitInMB) {
this.byteLimitInMB = byteLimitInMB;
}
@Override
public ServerResponse<List<IGridSlice>> handleRequest(
GetGridDataRequest request) throws Exception {
return getIfpServer(request).getGridParmMgr().getGridData(
request.getRequests());
ServerResponse<List<IGridSlice>> sr = new ServerResponse<List<IGridSlice>>();
GridParmManager gpm = getIfpServer(request).getGridParmMgr();
int gridCount = 0;
int remaining = (int) (this.byteLimitInMB * SizeUtil.BYTES_PER_MB * 0.9);
List<IGridSlice> data = null;
for (GetGridRequest req : request.getRequests()) {
ParmID parmId = req.getParmId();
List<TimeRange> times = req.getTimes();
ServerResponse<GridParmInfo> ss1 = gpm.getGridParmInfo(parmId);
if (!ss1.isOkay()) {
sr.addMessages(ss1);
return sr;
}
GridParmInfo gpi = ss1.getPayload();
int gridSize = gpi.getGridLoc().getNx() * gpi.getGridLoc().getNy();
switch (gpi.getGridType()) {
case SCALAR:
gridSize *= 4;
break;
case VECTOR:
gridSize *= 8;
break;
case WEATHER:
case DISCRETE:
break;
default:
break;
}
int maxGrids = remaining / gridSize;
// ensure we return at least 1 grid
if ((maxGrids == 0) && (gridCount == 0)) {
maxGrids = 1;
}
// no more grids will fit break out of loop
if (maxGrids == 0) {
break;
}
if (maxGrids < times.size()) {
// truncate the request
times = times.subList(0, maxGrids);
req.setTimes(times);
}
gridCount += times.size();
remaining -= times.size() * gridSize;
ServerResponse<List<IGridSlice>> ssr = gpm.getGridData(Arrays
.asList(req));
if (ssr.isOkay()) {
if (data == null) {
data = ssr.getPayload();
} else {
data.addAll(ssr.getPayload());
}
} else {
sr.addMessages(ssr);
break;
}
}
if (sr.isOkay()) {
sr.setPayload(data);
}
return sr;
}
}

View file

@ -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.gfe.server.handler;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.common.dataplugin.gfe.request.GetPythonGridDataRequest;
import com.raytheon.uf.common.dataplugin.gfe.server.message.ServerResponse;
import com.raytheon.uf.common.dataplugin.gfe.slice.IGridSlice;
import com.raytheon.uf.common.dataplugin.gfe.slice.PythonWeatherGridSlice;
import com.raytheon.uf.common.dataplugin.gfe.slice.WeatherGridSlice;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
/**
* Handler for GetPythonGridDataRequest
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 4, 2011 dgilling Initial creation
* Jun 13, 2013 #2044 randerso Refactored to use IFPServer
*
* </pre>
*
* @deprecated use the Data Access Framework
*
* @author dgilling
* @version 1.0
*/
// TODO: REMOVE THIS CLASS AND ITS REQUEST TYPE if
// DiscreteDefinition/DiscreteKey and WxDefinition/WeatherKey class hierarchy is
// ever fully-implemented in Python.
@Deprecated
public class GetPythonGridDataHandler extends BaseGfeRequestHandler implements
IRequestHandler<GetPythonGridDataRequest> {
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.common.serialization.comm.IRequestHandler#handleRequest
* (com.raytheon.uf.common.serialization.comm.IServerRequest)
*/
@Override
public ServerResponse<List<IGridSlice>> handleRequest(
GetPythonGridDataRequest request) throws Exception {
ServerResponse<List<IGridSlice>> finalResp = new ServerResponse<List<IGridSlice>>();
ServerResponse<List<IGridSlice>> sr = getIfpServer(request)
.getGridParmMgr().getGridData(request.getRequests());
if (!sr.isOkay()) {
finalResp.addMessages(sr);
finalResp.setPayload(new ArrayList<IGridSlice>(0));
return finalResp;
}
// convert grid slices as needed
List<IGridSlice> slices = new ArrayList<IGridSlice>(sr.getPayload()
.size());
for (IGridSlice slice : sr.getPayload()) {
if (!(slice instanceof WeatherGridSlice)) {
slices.add(slice);
} else {
slices.add(new PythonWeatherGridSlice((WeatherGridSlice) slice));
}
}
finalResp.setPayload(slices);
return finalResp;
}
}

View file

@ -89,6 +89,7 @@ import com.raytheon.uf.common.util.Pair;
* Added getKeys(tr) to get grid times overlapping a time range
* Removed caching of inventory as it was not being updated when
* grids were updated/deleted
* Jul 01, 2014 #3149 randerso Changed to use updated GetGridRequest. Cleaned up code
*
* </pre>
*
@ -201,39 +202,19 @@ public class IFPWE {
* @throws GfeException
*/
public IGridSlice getItem(TimeRange timeRange) throws GfeException {
GetGridRequest req = new GetGridRequest();
req.setParmId(parmId);
GFERecord gfeRec = new GFERecord(parmId, timeRange);
ArrayList<GFERecord> gfeList = new ArrayList<GFERecord>();
gfeList.add(gfeRec);
req.setRecords(gfeList);
GetGridRequest req = new GetGridRequest(parmId,
Arrays.asList(timeRange));
ArrayList<GetGridRequest> reqList = new ArrayList<GetGridRequest>();
reqList.add(req);
List<IGridSlice> data = new ArrayList<IGridSlice>();
ServerResponse<List<IGridSlice>> ssr = gridParmMgr.getGridData(reqList);
data = ssr.getPayload();
IGridSlice slice = null;
if ((data == null) || (data.size() == 0)) {
if (!ssr.isOkay()) {
String msg = "Error getting grid data for " + parmId.toString()
+ " at time " + timeRange.toString();
for (ServerMsg smsg : ssr.getMessages()) {
msg += "\n" + smsg.getMessage();
}
+ " at time " + timeRange.toString() + ssr.message();
throw new GfeException(msg);
} else if (data.size() > 1) {
// theoretically should never get here
String msg = "Retrieved too much data for " + parmId.toString()
+ "at time " + timeRange.toString();
for (ServerMsg smsg : ssr.getMessages()) {
msg += "\n" + smsg.getMessage();
}
throw new GfeException(msg);
} else {
slice = data.get(0);
}
IGridSlice slice = ssr.getPayload().get(0);
return slice;
}

View file

@ -29,6 +29,7 @@ package com.raytheon.uf.common.dataplugin.binlightning;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 30, 2014 3226 bclement Initial creation
* Jul 07, 2014 3333 bclement added SOURCE
*
* </pre>
*
@ -39,6 +40,10 @@ public class LightningConstants {
public static final String PULSE_HDF5_GROUP_SUFFIX = "pulse";
// metadata column names
public static final String SOURCE = "source";
// HDF5 dataset names
public static final String TIME_DATASET = "obsTime";

View file

@ -37,6 +37,7 @@ import com.raytheon.uf.common.dataaccess.impl.AbstractDataPluginFactory;
import com.raytheon.uf.common.dataaccess.impl.DefaultGeometryData;
import com.raytheon.uf.common.dataaccess.util.PDOUtil;
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
import com.raytheon.uf.common.dataplugin.binlightning.LightningConstants;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.datastorage.DataStoreFactory;
@ -70,6 +71,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* ------------- -------- ----------- --------------------------
* Jan 21, 2014 2667 bclement Initial creation
* Feb 06, 2014 2672 bsteffen Add envelope support
* Jul 07, 2014 3333 bclement now uses lightning constants
*
* </pre>
*
@ -78,18 +80,18 @@ import com.vividsolutions.jts.geom.GeometryFactory;
*/
public class BinLightningAccessFactory extends AbstractDataPluginFactory {
private static final String sourceKey = "source";
private static final String sourceKey = LightningConstants.SOURCE;
private static final IUFStatusHandler log = UFStatus
.getHandler(BinLightningRecord.class);
private static final GeometryFactory geomFactory = new GeometryFactory();
private static final String timeKey = "obsTime";
private static final String timeKey = LightningConstants.TIME_DATASET;
private static final String latKey = "latitude";
private static final String latKey = LightningConstants.LAT_DATASET;
private static final String lonKey = "longitude";
private static final String lonKey = LightningConstants.LON_DATASET;
private static final String[] requiredKeys = { timeKey, latKey, lonKey };

View file

@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<colorMap>
<color a="1.0" b="1.0" g="1.0" r="1.0"/>
<color a="1.0" b="1.0" g="1.0" r="1.0"/>
<color a="1.0" b="1.0" g="0.9843137" r="1.0"/>
<color a="1.0" b="1.0" g="0.96862745" r="1.0"/>
<color a="1.0" b="1.0" g="0.9529412" r="1.0"/>
<color a="1.0" b="1.0" g="0.93333334" r="1.0"/>
<color a="1.0" b="1.0" g="0.91764706" r="1.0"/>
<color a="1.0" b="1.0" g="0.8980392" r="1.0"/>
<color a="1.0" b="1.0" g="0.88235295" r="1.0"/>
<color a="1.0" b="1.0" g="0.8627451" r="1.0"/>
<color a="1.0" b="1.0" g="0.84313726" r="1.0"/>
<color a="1.0" b="1.0" g="0.8235294" r="1.0"/>
<color a="1.0" b="1.0" g="0.8039216" r="1.0"/>
<color a="1.0" b="1.0" g="0.78431374" r="1.0"/>
<color a="1.0" b="1.0" g="0.7607843" r="1.0"/>
<color a="1.0" b="1.0" g="0.7411765" r="1.0"/>
<color a="1.0" b="1.0" g="0.7176471" r="1.0"/>
<color a="1.0" b="1.0" g="0.69803923" r="1.0"/>
<color a="1.0" b="1.0" g="0.67058825" r="1.0"/>
<color a="1.0" b="1.0" g="0.64705884" r="1.0"/>
<color a="1.0" b="1.0" g="0.62352943" r="1.0"/>
<color a="1.0" b="1.0" g="0.59607846" r="1.0"/>
<color a="1.0" b="1.0" g="0.5686275" r="1.0"/>
<color a="1.0" b="1.0" g="0.5372549" r="1.0"/>
<color a="1.0" b="1.0" g="0.5058824" r="1.0"/>
<color a="1.0" b="1.0" g="0.4745098" r="1.0"/>
<color a="1.0" b="1.0" g="0.4392157" r="1.0"/>
<color a="1.0" b="1.0" g="0.4" r="1.0"/>
<color a="1.0" b="1.0" g="0.35686275" r="1.0"/>
<color a="1.0" b="1.0" g="0.30980393" r="1.0"/>
<color a="1.0" b="1.0" g="0.2509804" r="1.0"/>
<color a="1.0" b="1.0" g="0.1764706" r="1.0"/>
<color a="1.0" b="1.0" g="0.0" r="1.0"/>
<color a="1.0" b="1.0" g="0.0" r="0.9843137"/>
<color a="1.0" b="1.0" g="0.0" r="0.96862745"/>
<color a="1.0" b="1.0" g="0.0" r="0.9529412"/>
<color a="1.0" b="1.0" g="0.0" r="0.9372549"/>
<color a="1.0" b="1.0" g="0.0" r="0.92156863"/>
<color a="1.0" b="1.0" g="0.0" r="0.9019608"/>
<color a="1.0" b="1.0" g="0.0" r="0.8862745"/>
<color a="1.0" b="1.0" g="0.0" r="0.8666667"/>
<color a="1.0" b="1.0" g="0.0" r="0.84705883"/>
<color a="1.0" b="1.0" g="0.0" r="0.83137256"/>
<color a="1.0" b="1.0" g="0.0" r="0.8117647"/>
<color a="1.0" b="1.0" g="0.0" r="0.7921569"/>
<color a="1.0" b="1.0" g="0.0" r="0.77254903"/>
<color a="1.0" b="1.0" g="0.0" r="0.7490196"/>
<color a="1.0" b="1.0" g="0.0" r="0.7294118"/>
<color a="1.0" b="1.0" g="0.0" r="0.7058824"/>
<color a="1.0" b="1.0" g="0.0" r="0.6862745"/>
<color a="1.0" b="1.0" g="0.0" r="0.6627451"/>
<color a="1.0" b="1.0" g="0.0" r="0.6392157"/>
<color a="1.0" b="1.0" g="0.0" r="0.6117647"/>
<color a="1.0" b="1.0" g="0.0" r="0.5882353"/>
<color a="1.0" b="1.0" g="0.0" r="0.56078434"/>
<color a="1.0" b="1.0" g="0.0" r="0.5294118"/>
<color a="1.0" b="1.0" g="0.0" r="0.49803922"/>
<color a="1.0" b="1.0" g="0.0" r="0.46666667"/>
<color a="1.0" b="1.0" g="0.0" r="0.43137255"/>
<color a="1.0" b="1.0" g="0.0" r="0.39607844"/>
<color a="1.0" b="1.0" g="0.0" r="0.3529412"/>
<color a="1.0" b="1.0" g="0.0" r="0.30588236"/>
<color a="1.0" b="1.0" g="0.0" r="0.24705882"/>
<color a="1.0" b="1.0" g="0.0" r="0.1764706"/>
<color a="1.0" b="1.0" g="0.0" r="0.0"/>
<color a="1.0" b="1.0" g="0.1764706" r="0.0"/>
<color a="1.0" b="1.0" g="0.24705882" r="0.0"/>
<color a="1.0" b="1.0" g="0.30588236" r="0.0"/>
<color a="1.0" b="1.0" g="0.3529412" r="0.0"/>
<color a="1.0" b="1.0" g="0.39607844" r="0.0"/>
<color a="1.0" b="1.0" g="0.43137255" r="0.0"/>
<color a="1.0" b="1.0" g="0.46666667" r="0.0"/>
<color a="1.0" b="1.0" g="0.49803922" r="0.0"/>
<color a="1.0" b="1.0" g="0.5294118" r="0.0"/>
<color a="1.0" b="1.0" g="0.56078434" r="0.0"/>
<color a="1.0" b="1.0" g="0.5882353" r="0.0"/>
<color a="1.0" b="1.0" g="0.6117647" r="0.0"/>
<color a="1.0" b="1.0" g="0.6392157" r="0.0"/>
<color a="1.0" b="1.0" g="0.6627451" r="0.0"/>
<color a="1.0" b="1.0" g="0.6862745" r="0.0"/>
<color a="1.0" b="1.0" g="0.7058824" r="0.0"/>
<color a="1.0" b="1.0" g="0.7294118" r="0.0"/>
<color a="1.0" b="1.0" g="0.7490196" r="0.0"/>
<color a="1.0" b="1.0" g="0.77254903" r="0.0"/>
<color a="1.0" b="1.0" g="0.7921569" r="0.0"/>
<color a="1.0" b="1.0" g="0.8117647" r="0.0"/>
<color a="1.0" b="1.0" g="0.83137256" r="0.0"/>
<color a="1.0" b="1.0" g="0.84705883" r="0.0"/>
<color a="1.0" b="1.0" g="0.8666667" r="0.0"/>
<color a="1.0" b="1.0" g="0.8862745" r="0.0"/>
<color a="1.0" b="1.0" g="0.9019608" r="0.0"/>
<color a="1.0" b="1.0" g="0.92156863" r="0.0"/>
<color a="1.0" b="1.0" g="0.9372549" r="0.0"/>
<color a="1.0" b="1.0" g="0.9529412" r="0.0"/>
<color a="1.0" b="1.0" g="0.96862745" r="0.0"/>
<color a="1.0" b="1.0" g="0.9843137" r="0.0"/>
<color a="1.0" b="1.0" g="1.0" r="0.0"/>
<color a="1.0" b="0.99215686" g="0.99215686" r="0.09411765"/>
<color a="1.0" b="0.98039216" g="0.98039216" r="0.13725491"/>
<color a="1.0" b="0.96862745" g="0.96862745" r="0.16470589"/>
<color a="1.0" b="0.95686275" g="0.95686275" r="0.19215687"/>
<color a="1.0" b="0.94509804" g="0.94509804" r="0.21568628"/>
<color a="1.0" b="0.93333334" g="0.93333334" r="0.23529412"/>
<color a="1.0" b="0.92156863" g="0.92156863" r="0.25490198"/>
<color a="1.0" b="0.9098039" g="0.9098039" r="0.27450982"/>
<color a="1.0" b="0.8980392" g="0.8980392" r="0.2901961"/>
<color a="1.0" b="0.8862745" g="0.8862745" r="0.30588236"/>
<color a="1.0" b="0.87058824" g="0.87058824" r="0.32156864"/>
<color a="1.0" b="0.85882354" g="0.85882354" r="0.33333334"/>
<color a="1.0" b="0.84705883" g="0.84705883" r="0.34901962"/>
<color a="1.0" b="0.8352941" g="0.8352941" r="0.36078432"/>
<color a="1.0" b="0.81960785" g="0.81960785" r="0.37254903"/>
<color a="1.0" b="0.80784315" g="0.80784315" r="0.3882353"/>
<color a="1.0" b="0.7921569" g="0.7921569" r="0.4"/>
<color a="1.0" b="0.78039217" g="0.78039217" r="0.4117647"/>
<color a="1.0" b="0.7647059" g="0.7647059" r="0.42352942"/>
<color a="1.0" b="0.7490196" g="0.7490196" r="0.43137255"/>
<color a="1.0" b="0.7372549" g="0.7372549" r="0.44313726"/>
<color a="1.0" b="0.72156864" g="0.72156864" r="0.45490196"/>
<color a="1.0" b="0.7058824" g="0.7058824" r="0.4627451"/>
<color a="1.0" b="0.6901961" g="0.6901961" r="0.4745098"/>
<color a="1.0" b="0.6745098" g="0.6745098" r="0.48235294"/>
<color a="1.0" b="0.65882355" g="0.65882355" r="0.49411765"/>
<color a="1.0" b="0.6392157" g="0.6392157" r="0.5019608"/>
<color a="1.0" b="0.62352943" g="0.62352943" r="0.5137255"/>
<color a="1.0" b="0.6039216" g="0.6039216" r="0.52156866"/>
<color a="1.0" b="0.5882353" g="0.5882353" r="0.5294118"/>
<color a="1.0" b="0.5686275" g="0.5686275" r="0.5372549"/>
<color a="1.0" b="0.54901963" g="0.54901963" r="0.54901963"/>
<color a="1.0" b="0.5372549" g="0.5686275" r="0.5372549"/>
<color a="1.0" b="0.5294118" g="0.5882353" r="0.5294118"/>
<color a="1.0" b="0.52156866" g="0.60784316" r="0.52156866"/>
<color a="1.0" b="0.50980395" g="0.62352943" r="0.50980395"/>
<color a="1.0" b="0.5019608" g="0.6431373" r="0.5019608"/>
<color a="1.0" b="0.49019608" g="0.65882355" r="0.49019608"/>
<color a="1.0" b="0.48235294" g="0.6784314" r="0.48235294"/>
<color a="1.0" b="0.47058824" g="0.69411767" r="0.47058824"/>
<color a="1.0" b="0.4627451" g="0.70980394" r="0.4627451"/>
<color a="1.0" b="0.4509804" g="0.7254902" r="0.4509804"/>
<color a="1.0" b="0.4392157" g="0.7411765" r="0.4392157"/>
<color a="1.0" b="0.42745098" g="0.75686276" r="0.42745098"/>
<color a="1.0" b="0.41568628" g="0.77254903" r="0.41568628"/>
<color a="1.0" b="0.40392157" g="0.78431374" r="0.40392157"/>
<color a="1.0" b="0.39215687" g="0.8" r="0.39215687"/>
<color a="1.0" b="0.38039216" g="0.8156863" r="0.38039216"/>
<color a="1.0" b="0.36862746" g="0.827451" r="0.36862746"/>
<color a="1.0" b="0.3529412" g="0.84313726" r="0.3529412"/>
<color a="1.0" b="0.34117648" g="0.85490197" r="0.34117648"/>
<color a="1.0" b="0.3254902" g="0.8666667" r="0.3254902"/>
<color a="1.0" b="0.30980393" g="0.88235295" r="0.30980393"/>
<color a="1.0" b="0.29411766" g="0.89411765" r="0.29411766"/>
<color a="1.0" b="0.2784314" g="0.90588236" r="0.2784314"/>
<color a="1.0" b="0.25882354" g="0.91764706" r="0.25882354"/>
<color a="1.0" b="0.23921569" g="0.92941177" r="0.23921569"/>
<color a="1.0" b="0.21960784" g="0.94509804" r="0.21960784"/>
<color a="1.0" b="0.19607843" g="0.95686275" r="0.19607843"/>
<color a="1.0" b="0.16862746" g="0.96862745" r="0.16862746"/>
<color a="1.0" b="0.13725491" g="0.98039216" r="0.13725491"/>
<color a="1.0" b="0.09803922" g="0.9882353" r="0.09803922"/>
<color a="1.0" b="0.0" g="1.0" r="0.0"/>
<color a="1.0" b="0.0" g="1.0" r="0.1764706"/>
<color a="1.0" b="0.0" g="1.0" r="0.24705882"/>
<color a="1.0" b="0.0" g="1.0" r="0.30588236"/>
<color a="1.0" b="0.0" g="1.0" r="0.3529412"/>
<color a="1.0" b="0.0" g="1.0" r="0.39607844"/>
<color a="1.0" b="0.0" g="1.0" r="0.43137255"/>
<color a="1.0" b="0.0" g="1.0" r="0.46666667"/>
<color a="1.0" b="0.0" g="1.0" r="0.49803922"/>
<color a="1.0" b="0.0" g="1.0" r="0.5294118"/>
<color a="1.0" b="0.0" g="1.0" r="0.56078434"/>
<color a="1.0" b="0.0" g="1.0" r="0.5882353"/>
<color a="1.0" b="0.0" g="1.0" r="0.6117647"/>
<color a="1.0" b="0.0" g="1.0" r="0.6392157"/>
<color a="1.0" b="0.0" g="1.0" r="0.6627451"/>
<color a="1.0" b="0.0" g="1.0" r="0.6862745"/>
<color a="1.0" b="0.0" g="1.0" r="0.7058824"/>
<color a="1.0" b="0.0" g="1.0" r="0.7294118"/>
<color a="1.0" b="0.0" g="1.0" r="0.7490196"/>
<color a="1.0" b="0.0" g="1.0" r="0.77254903"/>
<color a="1.0" b="0.0" g="1.0" r="0.7921569"/>
<color a="1.0" b="0.0" g="1.0" r="0.8117647"/>
<color a="1.0" b="0.0" g="1.0" r="0.83137256"/>
<color a="1.0" b="0.0" g="1.0" r="0.84705883"/>
<color a="1.0" b="0.0" g="1.0" r="0.8666667"/>
<color a="1.0" b="0.0" g="1.0" r="0.8862745"/>
<color a="1.0" b="0.0" g="1.0" r="0.9019608"/>
<color a="1.0" b="0.0" g="1.0" r="0.92156863"/>
<color a="1.0" b="0.0" g="1.0" r="0.9372549"/>
<color a="1.0" b="0.0" g="1.0" r="0.9529412"/>
<color a="1.0" b="0.0" g="1.0" r="0.96862745"/>
<color a="1.0" b="0.0" g="1.0" r="0.9843137"/>
<color a="1.0" b="0.0" g="1.0" r="1.0"/>
<color a="1.0" b="0.0" g="0.9843137" r="1.0"/>
<color a="1.0" b="0.0" g="0.96862745" r="1.0"/>
<color a="1.0" b="0.0" g="0.9529412" r="1.0"/>
<color a="1.0" b="0.0" g="0.9372549" r="1.0"/>
<color a="1.0" b="0.0" g="0.92156863" r="1.0"/>
<color a="1.0" b="0.0" g="0.9019608" r="1.0"/>
<color a="1.0" b="0.0" g="0.8862745" r="1.0"/>
<color a="1.0" b="0.0" g="0.8666667" r="1.0"/>
<color a="1.0" b="0.0" g="0.84705883" r="1.0"/>
<color a="1.0" b="0.0" g="0.83137256" r="1.0"/>
<color a="1.0" b="0.0" g="0.8117647" r="1.0"/>
<color a="1.0" b="0.0" g="0.7921569" r="1.0"/>
<color a="1.0" b="0.0" g="0.77254903" r="1.0"/>
<color a="1.0" b="0.0" g="0.7490196" r="1.0"/>
<color a="1.0" b="0.0" g="0.7294118" r="1.0"/>
<color a="1.0" b="0.0" g="0.7058824" r="1.0"/>
<color a="1.0" b="0.0" g="0.6862745" r="1.0"/>
<color a="1.0" b="0.0" g="0.6627451" r="1.0"/>
<color a="1.0" b="0.0" g="0.6392157" r="1.0"/>
<color a="1.0" b="0.0" g="0.6117647" r="1.0"/>
<color a="1.0" b="0.0" g="0.5882353" r="1.0"/>
<color a="1.0" b="0.0" g="0.56078434" r="1.0"/>
<color a="1.0" b="0.0" g="0.5294118" r="1.0"/>
<color a="1.0" b="0.0" g="0.49803922" r="1.0"/>
<color a="1.0" b="0.0" g="0.46666667" r="1.0"/>
<color a="1.0" b="0.0" g="0.43137255" r="1.0"/>
<color a="1.0" b="0.0" g="0.39607844" r="1.0"/>
<color a="1.0" b="0.0" g="0.3529412" r="1.0"/>
<color a="1.0" b="0.0" g="0.30588236" r="1.0"/>
<color a="1.0" b="0.0" g="0.24705882" r="1.0"/>
<color a="1.0" b="0.0" g="0.1764706" r="1.0"/>
<color a="1.0" b="0.0" g="0.0" r="1.0"/>
<color a="1.0" b="0.1764706" g="0.1764706" r="1.0"/>
<color a="1.0" b="0.24705882" g="0.24705882" r="1.0"/>
<color a="1.0" b="0.30588236" g="0.30588236" r="1.0"/>
<color a="1.0" b="0.3529412" g="0.3529412" r="1.0"/>
<color a="1.0" b="0.39607844" g="0.39607844" r="1.0"/>
<color a="1.0" b="0.43137255" g="0.43137255" r="1.0"/>
<color a="1.0" b="0.46666667" g="0.46666667" r="1.0"/>
<color a="1.0" b="0.49803922" g="0.49803922" r="1.0"/>
<color a="1.0" b="0.5294118" g="0.5294118" r="1.0"/>
<color a="1.0" b="0.56078434" g="0.56078434" r="1.0"/>
<color a="1.0" b="0.5882353" g="0.5882353" r="1.0"/>
<color a="1.0" b="0.6117647" g="0.6117647" r="1.0"/>
<color a="1.0" b="0.6392157" g="0.6392157" r="1.0"/>
<color a="1.0" b="0.6627451" g="0.6627451" r="1.0"/>
<color a="1.0" b="0.6862745" g="0.6862745" r="1.0"/>
<color a="1.0" b="0.7058824" g="0.7058824" r="1.0"/>
<color a="1.0" b="0.7294118" g="0.7294118" r="1.0"/>
<color a="1.0" b="0.7490196" g="0.7490196" r="1.0"/>
<color a="1.0" b="0.77254903" g="0.77254903" r="1.0"/>
<color a="1.0" b="0.7921569" g="0.7921569" r="1.0"/>
<color a="1.0" b="0.8117647" g="0.8117647" r="1.0"/>
<color a="1.0" b="0.83137256" g="0.83137256" r="1.0"/>
<color a="1.0" b="0.84705883" g="0.84705883" r="1.0"/>
<color a="1.0" b="0.8666667" g="0.8666667" r="1.0"/>
<color a="1.0" b="0.8862745" g="0.8862745" r="1.0"/>
<color a="1.0" b="0.9019608" g="0.9019608" r="1.0"/>
<color a="1.0" b="0.92156863" g="0.92156863" r="1.0"/>
<color a="1.0" b="0.9372549" g="0.9372549" r="1.0"/>
<color a="1.0" b="0.9529412" g="0.9529412" r="1.0"/>
<color a="1.0" b="0.96862745" g="0.96862745" r="1.0"/>
<color a="1.0" b="0.9843137" g="0.9843137" r="1.0"/>
<color a="1.0" b="1.0" g="1.0" r="1.0"/>
</colorMap>

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
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.
-->
<styleRuleset>
<styleRule>
<paramLevelMatches>
<parameter>lightning density</parameter>
</paramLevelMatches>
<imageStyle>
<interpolate>false</interpolate>
<range levelScale="LINEAR" adaptive="true">
<minValue>0</minValue>
<maxValue>1000</maxValue>
</range>
<defaultColormap>Grid/gridded data</defaultColormap>
</imageStyle>
</styleRule>
</styleRuleset>

View file

@ -1,7 +0,0 @@
#Wed Jun 03 14:27:16 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

View file

@ -2,17 +2,16 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Cwat Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.cwat
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.viz.core
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Require-Bundle: javax.persistence;bundle-version="1.0.0",
com.raytheon.uf.common.serialization,
com.raytheon.uf.common.monitor;bundle-version="1.11.5",
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.radar,
com.raytheon.uf.common.geospatial,
com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.datastorage
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.common.dataplugin.cwat
Import-Package: org.apache.commons.logging

View file

@ -1,7 +0,0 @@
#Mon Jun 22 13:46:54 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

View file

@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: FFMP common Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.ffmp
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.viz.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: com.raytheon.uf.common.dataplugin.ffmp,
com.raytheon.uf.common.dataplugin.ffmp.dataaccess
Require-Bundle: javax.persistence;bundle-version="1.0.0",
@ -14,16 +14,16 @@ Require-Bundle: javax.persistence;bundle-version="1.0.0",
com.raytheon.uf.common.hydro;bundle-version="1.11.11",
com.raytheon.uf.common.mpe;bundle-version="1.11.11",
com.raytheon.uf.common.localization;bundle-version="1.11.13",
com.raytheon.uf.common.status;bundle-version="1.12.1174",
com.raytheon.uf.common.status,
com.raytheon.uf.common.site,
com.raytheon.uf.common.dataplugin.shef;bundle-version="1.12.1174",
com.raytheon.uf.common.cache;bundle-version="1.12.1174",
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0",
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.shef,
com.raytheon.uf.common.cache,
com.raytheon.uf.common.serialization.comm,
com.raytheon.uf.common.dataplugin.grid,
com.raytheon.uf.common.dataaccess,
com.google.guava;bundle-version="1.0.0",
javax.measure;bundle-version="1.0.0",
com.raytheon.uf.common.message;bundle-version="1.12.1174",
com.raytheon.uf.common.message,
com.raytheon.uf.common.dataquery,
com.raytheon.uf.common.datastorage,
com.raytheon.uf.common.dataplugin

View file

@ -28,6 +28,7 @@ import javax.measure.unit.Unit;
import com.raytheon.uf.common.dataaccess.IDataRequest;
import com.raytheon.uf.common.dataaccess.exception.DataRetrievalException;
import com.raytheon.uf.common.dataaccess.exception.IncompatibleRequestException;
import com.raytheon.uf.common.dataaccess.geom.IGeometryData;
import com.raytheon.uf.common.dataaccess.impl.AbstractDataPluginFactory;
import com.raytheon.uf.common.dataaccess.impl.DefaultGeometryData;
@ -40,6 +41,7 @@ import com.raytheon.uf.common.dataplugin.ffmp.FFMPRecord;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates.MODE;
import com.raytheon.uf.common.dataplugin.ffmp.HucLevelGeometriesFactory;
import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint.ConstraintType;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
@ -70,6 +72,7 @@ import com.vividsolutions.jts.geom.Geometry;
* May 1, 2014 3099 bkowal No longer use an empty pfaf list when the
* data request locationNames list is empty.
* Jun 24, 2014 3170 mnash Get the accumulated time if multiple times are requested
* Jul 14, 2014 3184 njensen Overrode getAvailableLevels()
*
* </pre>
*
@ -354,4 +357,10 @@ public class FFMPGeometryFactory extends AbstractDataPluginFactory {
return pfafList.toArray(new String[pfafList.size()]);
}
@Override
public Level[] getAvailableLevels(IDataRequest request) {
throw new IncompatibleRequestException(request.getDatatype()
+ " data does not support the concept of levels");
}
}

View file

@ -43,9 +43,10 @@ import com.raytheon.uf.common.serialization.comm.RequestRouter;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 9, 2011 bsteffen Initial creation
* May 02, 2013 1949 bsteffen Update GFE data access in Product
* May 02, 2013 1949 bsteffen Update GFE data access in Product
* Browser, Volume Browser, and Data Access
* Framework.
* Jul 01, 2014 3149 randerso Changed to use updated GetGridRequest
*
* </pre>
*
@ -96,9 +97,8 @@ public class GFEDataAccessUtil {
* @throws Exception
*/
public static IGridSlice getSlice(GFERecord gfeRecord) throws Exception {
GetGridRequest gridRequest = new GetGridRequest();
gridRequest.setParmId(gfeRecord.getParmId());
gridRequest.setRecords(Arrays.asList(gfeRecord));
GetGridRequest gridRequest = new GetGridRequest(gfeRecord.getParmId(),
Arrays.asList(gfeRecord.getDataTime().getValidPeriod()));
GetGridDataRequest request = new GetGridDataRequest();
request.setSiteID(gfeRecord.getDbId().getSiteId());

View file

@ -1,52 +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.gfe.request;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
/**
* This class is only intended for use with Python clients as it returns
* IGridSlices in a way that can be easily deserialized by Python without
* requiring full implementation the Java class hierarchy.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 4, 2011 dgilling Initial creation
*
* </pre>
*
* @deprecated use the Data Access Framework
*
* @author dgilling
* @version 1.0
*/
// TODO: REMOVE THIS CLASS AND ITS HANDLER if DiscreteDefinition/DiscreteKey and
// WxDefinition/WeatherKey class hierarchy is ever fully-implemented in Python.
@Deprecated
@DynamicSerialize
public class GetPythonGridDataRequest extends GetGridDataRequest {
}

View file

@ -20,12 +20,9 @@
package com.raytheon.uf.common.dataplugin.gfe.server.request;
import java.util.ArrayList;
import java.util.List;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
import com.raytheon.uf.common.serialization.ISerializableObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.common.time.TimeRange;
@ -38,6 +35,8 @@ import com.raytheon.uf.common.time.TimeRange;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 04/08/08 #875 bphillip Initial Creation
* 07/01/2014 #3149 randerso Simplified to contain only a ParmID and
* list of TimeRanges.
*
* </pre>
*
@ -46,41 +45,18 @@ import com.raytheon.uf.common.time.TimeRange;
*/
@DynamicSerialize
public class GetGridRequest implements ISerializableObject {
public class GetGridRequest {
/** The records to be saved */
@DynamicSerializeElement
private List<GFERecord> records;
private List<TimeRange> times;
/** The parmID of the request */
@DynamicSerializeElement
private ParmID parmId;
/**
* Denotes whether the data retrieved from this request will be converted to
* match the corresponding grid parm info
*/
@DynamicSerializeElement
private boolean convertUnit = false;
/**
* @return the convertUnit
*/
public boolean isConvertUnit() {
return convertUnit;
}
/**
* @param convertUnit
* the convertUnit to set
*/
public void setConvertUnit(boolean convertUnit) {
this.convertUnit = convertUnit;
}
/**
* Creates a new GetGridRequest
*/
@ -96,19 +72,9 @@ public class GetGridRequest implements ISerializableObject {
* @param times
* The times of the requested grids
*/
public GetGridRequest(List<GFERecord> records) {
if (records.size() > 0) {
parmId = records.get(0).getParmId();
}
this.records = records;
}
public GetGridRequest(ParmID parmId, List<TimeRange> trs) {
public GetGridRequest(ParmID parmId, List<TimeRange> times) {
this.parmId = parmId;
records = new ArrayList<GFERecord>();
for (TimeRange tr : trs) {
records.add(new GFERecord(parmId, tr));
}
this.times = times;
}
public ParmID getParmId() {
@ -120,19 +86,11 @@ public class GetGridRequest implements ISerializableObject {
}
public List<TimeRange> getTimes() {
List<TimeRange> times = new ArrayList<TimeRange>();
for (GFERecord rec : records) {
times.add(rec.getTimeRange());
}
return times;
return this.times;
}
public List<GFERecord> getRecords() {
return records;
}
public void setRecords(List<GFERecord> records) {
this.records = records;
public void setTimes(List<TimeRange> times) {
this.times = times;
}
}

View file

@ -1,7 +0,0 @@
#Wed Jan 20 03:11:47 CST 2010
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

View file

@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ldadmesonet Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.ldadmesonet
Bundle-Version: 1.12.1174.qualifier
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
Bundle-Version: 1.14.0.qualifier
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: com.raytheon.edex.common,
com.raytheon.uf.common.pointdata;bundle-version="1.11.16",
com.raytheon.uf.edex.pointdata;bundle-version="1.11.16",

View file

@ -1,7 +0,0 @@
#Tue Jan 26 15:25:37 CST 2010
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

View file

@ -2,20 +2,19 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Perciprate Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.preciprate
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.viz.core
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Require-Bundle: javax.persistence;bundle-version="1.0.0",
com.raytheon.uf.common.serialization,
org.geotools;bundle-version="2.5.2",
com.raytheon.uf.common.monitor;bundle-version="1.11.5",
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin.radar,
javax.measure;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.geospatial,
com.raytheon.uf.common.datastorage
Export-Package: com.raytheon.uf.common.dataplugin.preciprate
Import-Package: com.raytheon.uf.common.status,
org.apache.commons.logging
Import-Package: com.raytheon.uf.common.status

View file

@ -1,7 +0,0 @@
#Mon Nov 30 10:06:00 CST 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

View file

@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Qc Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.qc
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Require-Bundle: com.raytheon.edex.common;bundle-version="1.11.17",
javax.persistence;bundle-version="1.0.0",
com.raytheon.uf.common.pointdata;bundle-version="1.12.1161",

View file

@ -1,8 +0,0 @@
#Thu Dec 16 08:21:55 CST 2010
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

View file

@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: QPF common Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.qpf
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.viz.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: com.raytheon.uf.common.dataplugin.qpf
Require-Bundle: javax.persistence;bundle-version="1.0.0",
com.raytheon.uf.common.serialization,
@ -14,4 +14,3 @@ Require-Bundle: javax.persistence;bundle-version="1.0.0",
com.raytheon.uf.common.geospatial,
com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.datastorage
Import-Package: org.apache.commons.logging

View file

@ -1,7 +0,0 @@
#Tue Mar 16 15:54:19 CDT 2010
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

View file

@ -2,10 +2,10 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: QPF common Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.scan
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.viz.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: com.raytheon.uf.common.dataplugin.scan,
com.raytheon.uf.common.dataplugin.scan.data
Require-Bundle: javax.persistence;bundle-version="1.0.0",

View file

@ -1,7 +0,0 @@
#Thu Mar 26 10:25:50 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

View file

@ -3,12 +3,12 @@ Bundle-ManifestVersion: 1
Bundle-Name: Taf Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.taf
Bundle-Version: 1.14.0.qualifier
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Bundle-Vendor: RAYTHEON
Export-Package: com.raytheon.uf.common.dataplugin.taf
Require-Bundle: org.apache.commons.lang,
javax.persistence
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.dataplugin.annotations,
com.raytheon.uf.common.dataplugin.persist,

View file

@ -23,10 +23,12 @@ import java.sql.Timestamp;
import java.util.Map;
import com.raytheon.uf.common.dataaccess.IDataRequest;
import com.raytheon.uf.common.dataaccess.exception.IncompatibleRequestException;
import com.raytheon.uf.common.dataaccess.exception.TimeAgnosticDataException;
import com.raytheon.uf.common.dataaccess.geom.IGeometryData;
import com.raytheon.uf.common.dataaccess.impl.AbstractGeometryDatabaseFactory;
import com.raytheon.uf.common.dataaccess.impl.FactoryUtil;
import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.time.BinOffset;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange;
@ -51,6 +53,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* Feb 14, 2013 1614 bsteffen Refactor data access framework to use
* single request.
* Mar 03, 2014 2673 bsteffen Add ability to query only ref times.
* Jul 14, 2014 3184 njensen Overrode getAvailableLevels()
*
* </pre>
*
@ -194,4 +197,10 @@ public class HydroGeometryFactory extends AbstractGeometryDatabaseFactory {
protected String assembleGetAvailableLocationNames(IDataRequest request) {
return "select lid from location;";
}
@Override
public Level[] getAvailableLevels(IDataRequest request) {
throw new IncompatibleRequestException(request.getDatatype()
+ " data does not support the concept of levels");
}
}

View file

@ -19,10 +19,12 @@
**/
package com.raytheon.uf.common.registry;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.serialization.jaxb.JaxbMarshallerStrategy;
import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
/**
@ -38,6 +40,7 @@ import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 8/8/2013 1692 bphillip Initial implementation
* Jul 15, 2014 3373 bclement jaxb manager changes
* </pre>
*
* @author bphillip
@ -48,17 +51,6 @@ public class RegistryJaxbManager extends JAXBManager {
/** The namespace mapper property name on the marshaller */
private static final String NAMESPACE_PREFIX_MAPPER_PROPERTY = "com.sun.xml.bind.namespacePrefixMapper";
protected NamespacePrefixMapper namespaceMapper;
/**
* Creates a new RegistryJaxbManager. Hidden from public use
*
* @throws JAXBException
*/
protected RegistryJaxbManager() throws JAXBException {
super();
}
/**
* Creates a new RegistryJaxbManager with the given namespace mapper
*
@ -72,25 +64,29 @@ public class RegistryJaxbManager extends JAXBManager {
public RegistryJaxbManager(RegistryNamespaceMapper namespaceMapper)
throws JAXBException {
super(
createStrategy(namespaceMapper),
oasis.names.tc.ebxml.regrep.xsd.lcm.v4.ObjectFactory.class,
oasis.names.tc.ebxml.regrep.xsd.query.v4.ObjectFactory.class,
oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class,
oasis.names.tc.ebxml.regrep.xsd.rs.v4.ObjectFactory.class,
oasis.names.tc.ebxml.regrep.xsd.spi.v4.ObjectFactory.class,
com.raytheon.uf.common.registry.services.rest.response.RestCollectionResponse.class);
this.namespaceMapper = namespaceMapper;
}
@Override
protected Marshaller getMarshaller() throws JAXBException {
Marshaller m = marshallers.poll();
if (m == null) {
m = getJaxbContext().createMarshaller();
if (namespaceMapper != null) {
m.setProperty(NAMESPACE_PREFIX_MAPPER_PROPERTY, namespaceMapper);
private static JaxbMarshallerStrategy createStrategy(
final NamespacePrefixMapper namespaceMapper) {
return new JaxbMarshallerStrategy() {
@Override
protected Marshaller createMarshaller(JAXBContext context)
throws JAXBException {
Marshaller rval = super.createMarshaller(context);
if (namespaceMapper != null) {
rval.setProperty(NAMESPACE_PREFIX_MAPPER_PROPERTY,
namespaceMapper);
}
return rval;
}
}
return m;
};
}
}

View file

@ -38,6 +38,7 @@ import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 8/8/2013 1692 bphillip Initial implementation
* Jul 15, 2014 3373 bclement removed warning
* </pre>
*
* @author bphillip
@ -73,7 +74,7 @@ public class RegistryNamespaceMapper extends NamespacePrefixMapper implements
}
@Override
public Iterator getPrefixes(String namespaceURI) {
public Iterator<?> getPrefixes(String namespaceURI) {
throw new UnsupportedOperationException();
}

View file

@ -50,6 +50,7 @@ import com.raytheon.uf.common.util.ReflectionUtil;
* ------------ ---------- ----------- --------------------------
* Nov 12, 2013 ---- njensen Initial release.
* Nov 24, 2013 2584 dhladky versioning
* Jul 15, 2014 3373 bclement pooling jaxb manager
* </pre>
*
* @author njensen
@ -118,7 +119,7 @@ public class EbxmlJaxbManager {
public synchronized JAXBManager getJaxbManager() throws JAXBException {
if (jaxb == null) {
jaxb = new JAXBManager(jaxables.toArray(new Class[0]));
jaxb = new JAXBManager(true, jaxables.toArray(new Class[0]));
}
return jaxb;
}

View file

@ -16,46 +16,20 @@
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
*
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 30, 2011 bclement Initial creation
* Aug 18, 2013 #2097 dhladky extended JAXBManager
*
*/
package com.raytheon.uf.edex.ogc.common.jaxb;
import java.io.ByteArrayOutputStream;
import java.io.FileReader;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.sun.xml.bind.api.JAXBRIContext;
import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
@ -68,7 +42,9 @@ import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2011 bclement Initial creation
* Mar 30, 2011 bclement Initial creation
* Aug 18, 2013 #2097 dhladky extended JAXBManager
* Jul 15, 2014 3373 bclement rewritten to use JAXBManager
*
* </pre>
*
@ -77,31 +53,72 @@ import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
*/
public class OgcJaxbManager extends JAXBManager {
protected final JAXBContext jaxbContext;
protected static final int QUEUE_SIZE = 10;
protected final Queue<Unmarshaller> unmarshallers = new ConcurrentLinkedQueue<Unmarshaller>();
protected final Queue<Marshaller> marshallers = new ConcurrentLinkedQueue<Marshaller>();
protected volatile int unmarshallersCreated = 0;
protected volatile int marshallersCreated = 0;
protected final IUFStatusHandler log = UFStatus.getHandler(this.getClass());
private volatile NamespacePrefixMapper mapper;
protected final ReadWriteLock prefixLock = new ReentrantReadWriteLock();
protected static final String JAXB_NAMESPACE_MAPPER = "com.sun.xml.bind.namespacePrefixMapper";
public OgcJaxbManager(Class<?>[] classes) throws JAXBException {
jaxbContext = JAXBContext.newInstance(classes, getJaxbConfig());
private final OgcMarshallerStrategy marshStrategy;
/**
* @param classes
* @throws JAXBException
*/
public OgcJaxbManager(Class<?>[] classes) throws JAXBException {
this(new OgcMarshallerStrategy(), classes);
}
private static Map<String, Object> getJaxbConfig() throws JAXBException {
/**
* @param mapper
* mapping of namespaces to namespace prefixes
* @param classes
* @throws JAXBException
*/
public OgcJaxbManager(NamespacePrefixMapper mapper, Class<?>[] classes)
throws JAXBException {
this(createStrategy(mapper), classes);
}
/**
* @see JAXBManager#JAXBManager(boolean,
* com.raytheon.uf.common.serialization.jaxb.JaxbMarshallerStrategy,
* Class...)
* @param strategy
* @param classes
* @throws JAXBException
*/
public OgcJaxbManager(OgcMarshallerStrategy strategy, Class<?>[] classes)
throws JAXBException {
super(strategy, classes);
this.marshStrategy = strategy;
}
/**
* Create a marshaller strategy that uses the provided namespace prefix
* mapping
*
* @param mapper
* @return
*/
private static OgcMarshallerStrategy createStrategy(
final NamespacePrefixMapper mapper) {
return new OgcMarshallerStrategy() {
@Override
protected Marshaller createMarshaller(JAXBContext context)
throws JAXBException {
Marshaller rval = super.createMarshaller(context);
if (mapper != null) {
rval.setProperty(JAXB_NAMESPACE_MAPPER, mapper);
}
return rval;
}
};
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.common.serialization.JAXBManager#getJaxbConfig()
*/
@Override
protected Map<String, Object> getJaxbConfig() throws JAXBException {
Map<String, Object> jaxbConfig = new HashMap<String, Object>();
TransientAnnotationReader reader = new TransientAnnotationReader();
try {
@ -116,210 +133,28 @@ public class OgcJaxbManager extends JAXBManager {
return jaxbConfig;
}
protected Unmarshaller getUnmarshaller() throws JAXBException {
Unmarshaller m = unmarshallers.poll();
if (m == null) {
if (unmarshallersCreated < QUEUE_SIZE) {
synchronized (unmarshallers) {
m = jaxbContext.createUnmarshaller();
++unmarshallersCreated;
}
} else {
int tries = 0;
do {
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// ignore
}
m = unmarshallers.poll();
tries++;
if (tries >= 20) {
log.debug("Unable to get jaxb unmarshaller from pool after "
+ tries + " tries. Growing pool size.");
synchronized (unmarshallers) {
m = jaxbContext.createUnmarshaller();
++unmarshallersCreated;
}
}
} while (m == null);
}
}
return m;
}
protected Marshaller getMarshaller() throws JAXBException {
Marshaller m = marshallers.poll();
if (m == null) {
if (marshallersCreated < QUEUE_SIZE) {
synchronized (marshallers) {
m = jaxbContext.createMarshaller();
++marshallersCreated;
}
} else {
int tries = 0;
do {
try {
Thread.sleep(50);
} catch (InterruptedException e) {
// ignore
}
m = marshallers.poll();
tries++;
if (tries >= 20) {
log.debug("Unable to get jaxb marshaller from pool after "
+ tries + " tries. Growing pool size.");
synchronized (marshallers) {
m = jaxbContext.createMarshaller();
++marshallersCreated;
}
}
} while (m == null);
}
}
return m;
}
public Object unmarshal(String xml) throws JAXBException {
Unmarshaller msh = null;
try {
msh = getUnmarshaller();
StringReader reader = new StringReader(xml);
Object obj = msh.unmarshal(reader);
if (obj instanceof JAXBElement<?>) {
obj = ((JAXBElement<?>) obj).getValue();
}
return obj;
} finally {
if (msh != null) {
unmarshallers.add(msh);
}
}
}
/**
* @see OgcMarshallerStrategy#unmarshal(JAXBContext, Node)
* @param node
* @return
* @throws JAXBException
*/
public Object unmarshal(Node node) throws JAXBException {
Unmarshaller msh = null;
try {
msh = getUnmarshaller();
Object obj = msh.unmarshal(node);
if (obj instanceof JAXBElement<?>) {
obj = ((JAXBElement<?>) obj).getValue();
}
return obj;
} finally {
if (msh != null) {
unmarshallers.add(msh);
}
}
}
public Object unmarshal(FileReader reader) throws JAXBException {
Unmarshaller msh = null;
try {
msh = getUnmarshaller();
Object obj = msh.unmarshal(reader);
if (obj instanceof JAXBElement<?>) {
obj = ((JAXBElement<?>) obj).getValue();
}
return obj;
} finally {
if (msh != null) {
unmarshallers.add(msh);
}
}
}
public Object unmarshal(InputStream xml) throws JAXBException {
Unmarshaller msh = null;
try {
msh = getUnmarshaller();
Object obj = msh.unmarshal(xml);
if (obj instanceof JAXBElement<?>) {
obj = ((JAXBElement<?>) obj).getValue();
}
return obj;
} finally {
if (msh != null) {
unmarshallers.add(msh);
}
}
}
public String marshal(Object obj) throws JAXBException {
return marshal(obj, true);
}
public String marshal(Object obj, boolean formatted) throws JAXBException {
return marshal(obj, null, formatted, false);
}
public String marshal(Object obj, boolean formatted, boolean fragment)
throws JAXBException {
return marshal(obj, null, formatted, fragment);
JAXBContext ctx = getJaxbContext();
return marshStrategy.unmarshal(ctx, node);
}
/**
* @see OgcMarshallerStrategy#marshalToNode(JAXBContext, Object)
* @param obj
* @return
* @throws JAXBException
* @throws ParserConfigurationException
*/
public Node marshalToNode(Object obj) throws JAXBException,
ParserConfigurationException {
Marshaller msh = getMarshaller();
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocument();
msh.marshal(obj, doc);
return doc.getFirstChild();
} finally {
marshallers.add(msh);
}
JAXBContext ctx = getJaxbContext();
return marshStrategy.marshalToNode(ctx, obj);
}
public void marshal(Object obj, OutputStream out, String schemaLocation,
boolean formatted, boolean fragment) throws JAXBException {
Marshaller msh = getMarshaller();
try {
msh.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formatted);
msh.setProperty(Marshaller.JAXB_FRAGMENT, fragment);
if (mapper != null) {
Lock read = prefixLock.readLock();
read.lock();
try {
msh.setProperty(JAXB_NAMESPACE_MAPPER, mapper);
} finally {
read.unlock();
}
}
if (schemaLocation != null && !schemaLocation.isEmpty()) {
msh.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, schemaLocation);
}
msh.marshal(obj, out);
} finally {
marshallers.add(msh);
}
}
public String marshal(Object obj, String schemaLocation, boolean formatted,
boolean fragment)
throws JAXBException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
marshal(obj, out, schemaLocation, formatted, fragment);
return out.toString();
}
public void setPrefixMap(final Map<String, String> prefixMap) {
Lock write = prefixLock.writeLock();
write.lock();
try {
this.mapper = new NamespacePrefixMapper() {
@Override
public String getPreferredPrefix(String namespaceUri,
String suggestion, boolean requirePrefix) {
return prefixMap.get(namespaceUri);
}
};
} finally {
write.unlock();
}
}
}

View file

@ -0,0 +1,106 @@
/**
* 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.edex.ogc.common.jaxb;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import com.raytheon.uf.common.serialization.jaxb.PooledJaxbMarshallerStrategy;
/**
* Marshaller strategy for OGC XML operations. Includes w3c dom operations.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 15, 2014 3373 bclement Initial creation
*
* </pre>
*
* @author bclement
* @version 1.0
*/
public class OgcMarshallerStrategy extends PooledJaxbMarshallerStrategy {
/**
*
*/
public OgcMarshallerStrategy() {
super();
}
/**
* @param poolSize
* @param pooledObjectSizeLimit
*/
public OgcMarshallerStrategy(int poolSize, int pooledObjectSizeLimit) {
super(poolSize, pooledObjectSizeLimit);
}
/**
* Unmarshal object from w3c node.
*
* @param ctx
* @param node
* @return
* @throws JAXBException
*/
public Object unmarshal(JAXBContext ctx, Node node) throws JAXBException {
Unmarshaller msh = createUnmarshaller(ctx);
Object obj = msh.unmarshal(node);
if (obj instanceof JAXBElement<?>) {
obj = ((JAXBElement<?>) obj).getValue();
}
return obj;
}
/**
* Marshal object to w3c node
*
* @param ctx
* @param obj
* @return
* @throws JAXBException
* @throws ParserConfigurationException
*/
public Node marshalToNode(JAXBContext ctx, Object obj)
throws JAXBException, ParserConfigurationException {
Marshaller msh = createMarshaller(ctx);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocument();
msh.marshal(obj, doc);
return doc.getFirstChild();
}
}

View file

@ -43,6 +43,7 @@ import com.raytheon.uf.common.message.Header;
import com.raytheon.uf.common.message.Message;
import com.raytheon.uf.common.message.Property;
import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.serialization.MarshalOptions;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.site.SiteMap;
@ -72,6 +73,7 @@ import com.raytheon.uf.edex.plugin.text.db.TextDB;
* --------------------------------
* 27Apr2012 564 jkorman Added sort to ALL times retrieval.
* May 15, 2014 2536 bclement moved from uf.edex.textdbsrv, added marshalToStream()
* Jul 15, 2014 3373 bclement jaxb manager api changes
*
* </pre>
*
@ -457,7 +459,7 @@ public class TextViewAdapter implements ICommandExecutor {
} catch (JAXBException e) {
throw new SerializationException("Unable to create JAXB manager", e);
}
jaxbManager.marshalToStream(prod, stream, false);
jaxbManager.marshalToStream(prod, stream, MarshalOptions.UNFORMATTED);
}
/**

View file

@ -1,7 +0,0 @@
#Sun Nov 15 13:01:55 CST 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

View file

@ -2,9 +2,8 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Vil Plug-in
Bundle-SymbolicName: com.raytheon.uf.edex.plugin.vil
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization, com.raytheon.uf.viz.core
Require-Bundle: com.raytheon.uf.common.monitor,
com.raytheon.uf.edex.cpgsrv;resolution:=optional,
com.raytheon.uf.common.dataplugin.vil,
@ -22,7 +21,7 @@ Import-Package: com.raytheon.edex.urifilter,
com.raytheon.uf.common.util.registry,
com.raytheon.uf.edex.plugin.scan.common,
org.apache.commons.logging
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.uf.edex.plugin.vil,
com.raytheon.uf.edex.plugin.vil.common

View file

@ -38,6 +38,8 @@ import net.opengis.gml.v_3_1_1.ObjectFactory;
import org.apache.commons.lang.ArrayUtils;
import org.w3c.dom.Node;
import com.raytheon.uf.common.serialization.MarshalOptions;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.util.registry.RegistryException;
@ -47,6 +49,7 @@ import com.raytheon.uf.edex.ogc.common.jaxb.OgcJaxbManager;
import com.raytheon.uf.edex.wfs.WfsException;
import com.raytheon.uf.edex.wfs.WfsFeatureType;
import com.raytheon.uf.edex.wfs.request.QualifiedName;
import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
/**
* Wfs registry implementation. Handles wfs sources and the JAXB context
@ -59,6 +62,7 @@ import com.raytheon.uf.edex.wfs.request.QualifiedName;
* ------------ ---------- ----------- --------------------------
* Apr 11, 2011 bclement Initial creation
* May 30, 2013 753 dhladky reverted to original
* Jul 15, 2014 3373 bclement jaxb manager api changes
*
* </pre>
*
@ -173,8 +177,14 @@ public class WfsRegistryImpl implements IWfsRegistry {
write.lock();
try {
jaxbContextVersion = currentVersion;
jaxbManager = new OgcJaxbManager(jaxbClasses);
jaxbManager.setPrefixMap(NS_MAP);
NamespacePrefixMapper mapper = new NamespacePrefixMapper() {
@Override
public String getPreferredPrefix(String uri,
String suggestion, boolean requirePrefix) {
return NS_MAP.get(uri);
}
};
jaxbManager = new OgcJaxbManager(mapper, jaxbClasses);
} finally {
write.unlock();
}
@ -188,7 +198,7 @@ public class WfsRegistryImpl implements IWfsRegistry {
* @throws JAXBException
*/
public Object unmarshal(String xml) throws JAXBException {
return getManager().unmarshal(xml);
return getManager().unmarshalFromXml(xml);
}
public Object unmarshal(Node node) throws JAXBException {
@ -199,9 +209,11 @@ public class WfsRegistryImpl implements IWfsRegistry {
* @param in
* @return
* @throws JAXBException
* @throws SerializationException
*/
public Object unmarshal(InputStream in) throws JAXBException {
return getManager().unmarshal(in);
public Object unmarshal(InputStream in) throws JAXBException,
SerializationException {
return getManager().unmarshalFromInputStream(in);
}
/**
@ -210,30 +222,32 @@ public class WfsRegistryImpl implements IWfsRegistry {
* @throws JAXBException
*/
public String marshal(Object obj) throws JAXBException {
return getManager().marshal(obj, false);
return getManager().marshalToXml(obj, MarshalOptions.UNFORMATTED);
}
public String marshal(Object obj, boolean fragment) throws JAXBException {
MarshalOptions options = new MarshalOptions(false, fragment);
return getManager().marshalToXml(obj, options);
}
public Node marshalToNode(Object obj) throws JAXBException,
ParserConfigurationException {
return getManager().marshalToNode(obj);
}
public String marshal(Object obj, boolean fragment) throws JAXBException {
return getManager().marshal(obj, false, fragment);
public String marshal(Object obj, MarshalOptions options) throws JAXBException {
return getManager().marshalToXml(obj, options);
}
/**
* @param obj
* @param out
* @throws JAXBException
* @throws SerializationException
*/
public void marshal(Object obj, OutputStream out) throws JAXBException {
getManager().marshal(obj, out, null, false, false);
}
public void marshal(Object obj, OutputStream out, boolean fragment)
throws JAXBException {
getManager().marshal(obj, out, null, false, fragment);
public void marshal(Object obj, OutputStream out) throws JAXBException,
SerializationException {
getManager().marshalToStream(obj, out, MarshalOptions.UNFORMATTED);
}
/**

View file

@ -116,8 +116,9 @@ import com.raytheon.uf.edex.wfs.util.XMLGregorianCalendarConverter;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 17, 2012 bclement Initial creation
* Sep 18, 2013 #411 skorolev Added required RESPONSE METADATA
* Nov 11, 2013 2539 bclement moved registry/marshal to parent
* Sep 18, 2013 #411 skorolev Added required RESPONSE METADATA
* Nov 11, 2013 2539 bclement moved registry/marshal to parent
* Jul 15, 2014 3373 bclement jaxb manager api changes
*
* </pre>
*
@ -1063,7 +1064,7 @@ public class Wfs2_0_0Provider extends AbstractWfsProvider implements
try {
String xml = registry.marshal(object, true);
rval.put(key, xml);
} catch (JAXBException e) {
} catch (Exception e) {
log.error("Problem marshalling parameter value", e);
// is it possible that this isn't our fault?
throw new WfsException(Code.OperationProcessingFailed);

View file

@ -1,33 +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.
##
# File auto-generated against equivalent DynamicSerialize Java class
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import GetGridDataRequest
class GetPythonGridDataRequest(GetGridDataRequest):
def __init__(self):
super(GetPythonGridDataRequest, self).__init__()
## nothing to implement here that isn't already covered by GetGridDataRequest ##
## Just need the separate class for de-serialization. ##

View file

@ -35,7 +35,6 @@ __all__ = [
'GetLockTablesRequest',
'GetOfficialDbNameRequest',
'GetParmListRequest',
'GetPythonGridDataRequest',
'GetSelectTimeRangeRequest',
'GetSingletonDbIdsRequest',
'GetSiteTimeZoneInfoRequest',
@ -64,7 +63,6 @@ from GetLatestModelDbIdRequest import GetLatestModelDbIdRequest
from GetLockTablesRequest import GetLockTablesRequest
from GetOfficialDbNameRequest import GetOfficialDbNameRequest
from GetParmListRequest import GetParmListRequest
from GetPythonGridDataRequest import GetPythonGridDataRequest
from GetSelectTimeRangeRequest import GetSelectTimeRangeRequest
from GetSingletonDbIdsRequest import GetSingletonDbIdsRequest
from GetSiteTimeZoneInfoRequest import GetSiteTimeZoneInfoRequest