Omaha #3333 removed redundant field from viz lightning
Change-Id: I3821f7991757f97b976bac8cde502da977ea0978 Former-commit-id: 2e701ade395cb2ec81d86af714fad825e146dc25
This commit is contained in:
parent
42ec8874c8
commit
572d95e78a
6 changed files with 55 additions and 104 deletions
|
@ -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
|
|
@ -2,7 +2,7 @@ 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.0.qualifier
|
||||
Bundle-Vendor: Raytheon
|
||||
Require-Bundle: com.raytheon.uf.common.dataplugin.binlightning;bundle-version="1.0.0",
|
||||
com.raytheon.viz.core,
|
||||
|
|
|
@ -39,6 +39,7 @@ 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.dataquery.requests.RequestConstraint;
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
|
@ -101,7 +102,8 @@ 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
|
||||
* Jun 19, 2014 3214 bclement added pulse and cloud flash support
|
||||
* Jul 07, 2014 3333 bclement removed lightSource field
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -136,16 +138,13 @@ public class LightningResource extends
|
|||
|
||||
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) {
|
||||
public LightningFrameMetadata(DataTime frameTime, BinOffset offset) {
|
||||
this.frameTime = frameTime;
|
||||
this.offset = offset;
|
||||
this.lightSource = ls;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -178,11 +177,6 @@ public class LightningResource extends
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -246,8 +240,6 @@ public class LightningResource extends
|
|||
|
||||
private String resourceName;
|
||||
|
||||
private String lightSource;
|
||||
|
||||
private int posAdj;
|
||||
|
||||
private IFont font;
|
||||
|
@ -261,13 +253,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;
|
||||
}
|
||||
|
||||
|
@ -334,26 +325,30 @@ public class LightningResource extends
|
|||
if (this.resourceData.isExclusiveForType()) {
|
||||
String modifier;
|
||||
if (this.resourceData.isHandlingCloudFlashes()) {
|
||||
modifier = "Cloud Flash";
|
||||
modifier = "Cloud Flash ";
|
||||
} else if (this.resourceData.isHandlingNegativeStrikes()) {
|
||||
modifier = "Negative";
|
||||
modifier = "Negative ";
|
||||
} else if (this.resourceData.isHandlingPositiveStrikes()) {
|
||||
modifier = "Positive";
|
||||
modifier = "Positive ";
|
||||
} else if (this.resourceData.isHandlingPulses()) {
|
||||
modifier = "Pulse";
|
||||
modifier = "Pulse ";
|
||||
} else {
|
||||
modifier = "";
|
||||
/* space to preserve formatting */
|
||||
modifier = " ";
|
||||
}
|
||||
this.resourceName = timeString + modifier;
|
||||
} else {
|
||||
this.resourceName = timeString;
|
||||
}
|
||||
|
||||
String lightType = " ";
|
||||
if (!this.lightSource.isEmpty()) {
|
||||
lightType += this.lightSource + " ";
|
||||
HashMap<String, RequestConstraint> metadata = this.resourceData
|
||||
.getMetadataMap();
|
||||
if (metadata != null && metadata.containsKey(LightningConstants.SOURCE)) {
|
||||
this.resourceName += metadata.get(LightningConstants.SOURCE)
|
||||
.getConstraintValue() + " ";
|
||||
}
|
||||
this.resourceName += lightType + "Lightning Plot ";
|
||||
|
||||
this.resourceName += "Lightning Plot ";
|
||||
}
|
||||
|
||||
private String convertTimeIntervalToString(int time) {
|
||||
|
@ -575,30 +570,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
|
||||
|
@ -617,7 +610,7 @@ public class LightningResource extends
|
|||
if (co == null) {
|
||||
// New frame
|
||||
LightningFrameMetadata key = new LightningFrameMetadata(dt,
|
||||
resourceData.getBinOffset(), this.lightSource);
|
||||
resourceData.getBinOffset());
|
||||
co = CacheObject.newCacheObject(key, resourceBuilder);
|
||||
cacheObjectMap.put(dt, co);
|
||||
dataTimes.add(dt);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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 };
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue