Omaha #3949 Add lightning source to SCAN site run config and filter on it.
Change-Id: Ic8a13effa112f6858a34b07c65ddae5a592d9be5 Former-commit-id: 4817945b7eadadca996dd1e3d037a2b2de297ec4
This commit is contained in:
parent
504fe69507
commit
4dd5b6999c
7 changed files with 214 additions and 122 deletions
|
@ -91,6 +91,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* replaced addStrike() with List constructor, added pulses
|
||||
* Jun 10, 2014 3226 bclement collections instead of lists, made data source logic public
|
||||
* Jun 19, 2014 3214 bclement populated pulse index array with -1 when missing pulse data
|
||||
* Jan 22, 2014 3949 nabowle refactor out default and unknown source constants.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -303,9 +304,9 @@ public class BinLightningRecord extends PersistablePluginDataObject implements
|
|||
*/
|
||||
public static String getDataSource(LightningStrikePoint strike) {
|
||||
if (strike.getLightSource() == null) {
|
||||
return "NLDN";
|
||||
return LightningConstants.DEFAULT_SOURCE;
|
||||
} else if (strike.getLightSource().isEmpty()) {
|
||||
return "UNKN";
|
||||
return LightningConstants.UNKNOWN_SOURCE;
|
||||
} else {
|
||||
return strike.getLightSource();
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ package com.raytheon.uf.common.dataplugin.binlightning;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* May 30, 2014 3226 bclement Initial creation
|
||||
* Jul 07, 2014 3333 bclement added SOURCE
|
||||
* Jan 22, 2014 2949 nabowle Add default and unknown source values.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -68,4 +69,10 @@ public class LightningConstants {
|
|||
|
||||
public static final String SENSOR_COUNT_DATASET = "sensorCount";
|
||||
|
||||
// Field values
|
||||
|
||||
public static final String DEFAULT_SOURCE = "NLDN";
|
||||
|
||||
public static final String UNKNOWN_SOURCE = "UNKN";
|
||||
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* 02/25/13 1660 dhladky Fixed configuration bug in scan.
|
||||
* Aug 13, 2013 1742 dhladky Concurrent mod exception on update fixed
|
||||
* Oct 02, 2013 2361 njensen Use JAXBManager for XML
|
||||
* Jan 20, 2015 3949 nabowle Add lightning source.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -245,6 +246,18 @@ public class SCANRunSiteConfigurationManager implements
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the lightning source.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getLightningSource() {
|
||||
if (configXml != null) {
|
||||
return configXml.getLightningSource();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Site you are seeking
|
||||
*
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/**
|
||||
* 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.monitor.xml;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -8,12 +27,32 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.LightningConstants;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarsInUseUtil;
|
||||
|
||||
/**
|
||||
* Scan site run config
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 20, 2015 3949 nabowle Add lightning source.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author nabowle
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlRootElement(name = "SCANSiteRunConfig")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class SCANSiteRunConfigXML {
|
||||
|
||||
@XmlElement(name = "lightningSource")
|
||||
private String lightningSource = LightningConstants.DEFAULT_SOURCE;
|
||||
|
||||
@XmlElements({ @XmlElement(name = "site") })
|
||||
private ArrayList<SCANSiteXML> sites;
|
||||
|
||||
|
@ -72,4 +111,12 @@ public class SCANSiteRunConfigXML {
|
|||
sites.add(site);
|
||||
}
|
||||
|
||||
public String getLightningSource() {
|
||||
return this.lightningSource;
|
||||
}
|
||||
|
||||
public void setLightningSource(String lightningSource) {
|
||||
this.lightningSource = lightningSource;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.uf.common.dataplugin.scan.data.SoundingData;
|
|||
import com.raytheon.uf.common.dataplugin.scan.data.TVSTableData;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.monitor.config.SCANRunSiteConfigurationManager;
|
||||
import com.raytheon.uf.common.monitor.scan.ScanUtils;
|
||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||
import com.raytheon.uf.common.monitor.scan.xml.ScanAlarmXML;
|
||||
|
@ -92,6 +93,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Oct 15, 2013 2361 njensen Use JAXBManager for XML
|
||||
* Apr 24, 2014 2060 njensen Updates for removal of grid dataURI column
|
||||
* May 12, 2014 3133 njensen Remove unused field
|
||||
* Jan 20, 2014 3949 nabowle Only match binlightning uris with the proper
|
||||
* lightning source.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -496,9 +499,11 @@ public class ScanURIFilter extends URIFilter {
|
|||
patternKeys.put(CompositeReflectivityProduct.cz,
|
||||
CompositeReflectivityProduct.getPattern(site.getScanSite(),
|
||||
getCellTilt()));
|
||||
getMatchURIs().put(LightningProduct.getPattern(), 0l);
|
||||
patternKeys.put(LightningProduct.BINLIGHTNING,
|
||||
LightningProduct.getPattern());
|
||||
Pattern lightningPattern = LightningProduct
|
||||
.getPattern(SCANRunSiteConfigurationManager.getInstance()
|
||||
.getLightningSource());
|
||||
getMatchURIs().put(lightningPattern, 0l);
|
||||
patternKeys.put(LightningProduct.BINLIGHTNING, lightningPattern);
|
||||
getMatchURIs().put(
|
||||
VILProduct.getPattern(site.getScanSite(), getCellTilt()), 0l);
|
||||
patternKeys.put(VILProduct.vil,
|
||||
|
@ -1095,7 +1100,7 @@ public class ScanURIFilter extends URIFilter {
|
|||
long time2 = System.currentTimeMillis();
|
||||
logger.debug("SCAN took: " + (time2 - time) + " ms");
|
||||
} catch (Exception e) {
|
||||
logger.error("ProcessProduct: did not complete....." + e);
|
||||
logger.error("ProcessProduct: did not complete.....", e);
|
||||
} finally {
|
||||
synchronized (processes) {
|
||||
processes.remove(scanProduct);
|
||||
|
|
|
@ -40,6 +40,7 @@ import com.raytheon.uf.edex.plugin.scan.lightning.LightningRetriever;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 05/05/2009 2037 dhladky Initial Creation.
|
||||
* 05/14/2014 3133 njensen Use LightingRetriever instead of ScanUtils
|
||||
* 01/20/2014 3949 nabowle Add lightning source to URI pattern.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,6 +58,11 @@ public class LightningProduct extends ScanProduct {
|
|||
// special one with brackets for lightning
|
||||
private static String wildCard = "[\\w\\[\\]\\-_:.]+";
|
||||
|
||||
/** Maximum size of the URI pattern. */
|
||||
// The wild card length is 9 chars longer than LightningRecord#source length
|
||||
private static final int URI_PATTERN_SIZE = wildCard.length() * 4
|
||||
+ BINLIGHTNING.length() + 6;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param uri
|
||||
|
@ -114,12 +120,23 @@ public class LightningProduct extends ScanProduct {
|
|||
/**
|
||||
* Lightning URI Pattern
|
||||
*
|
||||
* @return
|
||||
* @param source
|
||||
* The lightning source. If null or blank, a wildcard will be
|
||||
* matched instead.
|
||||
*
|
||||
* @return The compiled pattern.
|
||||
*/
|
||||
public static Pattern getPattern() {
|
||||
return Pattern.compile("^" + uriSeparator + BINLIGHTNING + uriSeparator
|
||||
+ wildCard + uriSeparator + wildCard + uriSeparator + wildCard);
|
||||
|
||||
public static Pattern getPattern(String source) {
|
||||
StringBuilder pattern = new StringBuilder(URI_PATTERN_SIZE).append("^")
|
||||
.append(uriSeparator).append(BINLIGHTNING).append(uriSeparator)
|
||||
.append(wildCard).append(uriSeparator).append(wildCard)
|
||||
.append(uriSeparator).append(wildCard).append(uriSeparator);
|
||||
if (source == null || source.trim().isEmpty()) {
|
||||
pattern.append(wildCard);
|
||||
} else {
|
||||
pattern.append(source);
|
||||
}
|
||||
return Pattern.compile(pattern.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.List;
|
|||
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.BinLightningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgStrikeType;
|
||||
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
|
||||
|
@ -59,6 +60,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
|||
* 05/07/2009 2037 dhladky Initial Creation.
|
||||
* Apr 30, 2014 2060 njensen Updates for removal of grid dataURI column
|
||||
* Jun 05, 2014 3226 bclement compare lightning strike type by id instead of ordinal
|
||||
* Jan 22, 2015 3949 nabowle Use DataURI.SEPARATOR.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -108,7 +110,7 @@ public abstract class ScanProduct implements Serializable {
|
|||
protected static String wildCard = "[\\w\\(\\)\\-_:.]+";
|
||||
|
||||
/** Separator for URI's */
|
||||
public static String uriSeparator = "/";
|
||||
public static final String uriSeparator = DataURI.SEPARATOR;
|
||||
|
||||
protected static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ScanProduct.class);
|
||||
|
|
Loading…
Add table
Reference in a new issue