Omaha #3303 make FFMPResource interrogatable

Change-Id: I59d0603f581034adc1607d69828c3c05c4051540

Former-commit-id: baf64e4a41 [formerly 8f71be817f] [formerly 2be9c89722] [formerly baf64e4a41 [formerly 8f71be817f] [formerly 2be9c89722] [formerly 58a9434254 [formerly 2be9c89722 [formerly 848a7c7428a42fe164312363c4eb3e4080d90d66]]]]
Former-commit-id: 58a9434254
Former-commit-id: afdac2bafd [formerly d4b6c9803e] [formerly a3d17e4f46d08b2176b5ac7766da43408244c04f [formerly a82e71702a]]
Former-commit-id: bf26c0317b05796c264b1626da690d41db48f07c [formerly 0bfa8347a4]
Former-commit-id: adc1a6df6d
This commit is contained in:
Matt Nash 2014-06-26 17:30:22 -05:00
parent 13d625500c
commit b6e460a97a
4 changed files with 77 additions and 17 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>

View file

@ -1,7 +0,0 @@
#Fri Jan 30 10:34:44 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

@ -28,8 +28,9 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.dataaccess;bundle-version="1.0.0", com.raytheon.uf.common.dataaccess;bundle-version="1.0.0",
com.raytheon.uf.common.colormap;bundle-version="1.12.1174", com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
com.raytheon.uf.common.style;bundle-version="1.0.0", com.raytheon.uf.common.style;bundle-version="1.0.0",
com.raytheon.uf.common.plugin.hpe;bundle-version="1.0.0" com.raytheon.uf.common.plugin.hpe;bundle-version="1.0.0",
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 com.raytheon.uf.viz.core.rsc;bundle-version="1.14.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Import-Package: com.raytheon.uf.common.pointdata Import-Package: com.raytheon.uf.common.pointdata
Export-Package: com.raytheon.uf.viz.monitor.ffmp, Export-Package: com.raytheon.uf.viz.monitor.ffmp,

View file

@ -36,6 +36,8 @@ import java.util.TreeSet;
import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import javax.measure.Measure;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
@ -52,6 +54,7 @@ import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem; import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.TransformException; import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin; import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasin;
import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinMetaData; import com.raytheon.uf.common.dataplugin.ffmp.FFMPBasinMetaData;
@ -120,6 +123,11 @@ import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability; import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability; import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability; import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
import com.raytheon.uf.viz.core.rsc.interrogation.ClassInterrogationKey;
import com.raytheon.uf.viz.core.rsc.interrogation.Interrogatable;
import com.raytheon.uf.viz.core.rsc.interrogation.InterrogateMap;
import com.raytheon.uf.viz.core.rsc.interrogation.InterrogationKey;
import com.raytheon.uf.viz.core.rsc.interrogation.Interrogator;
import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor; import com.raytheon.uf.viz.monitor.ffmp.FFMPMonitor;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FFMPConfig;
import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg; import com.raytheon.uf.viz.monitor.ffmp.ui.dialogs.FfmpBasinTableDlg;
@ -184,6 +192,7 @@ import com.vividsolutions.jts.geom.Point;
* Apr 30, 2014 DR 16148 gzhang Filter Basin Dates for Trend and Table Gap. * Apr 30, 2014 DR 16148 gzhang Filter Basin Dates for Trend and Table Gap.
* May 05, 2014 3026 mpduff Display Hpe bias source. * May 05, 2014 3026 mpduff Display Hpe bias source.
* May 19, 2014 DR 16096 gzhang Make getBasin() protected for FFMPDataGenerator. * May 19, 2014 DR 16096 gzhang Make getBasin() protected for FFMPDataGenerator.
* 06/24/2016 mnash Make FFMPResource implement Interrogatable
* </pre> * </pre>
* *
* @author dhladky * @author dhladky
@ -192,7 +201,8 @@ import com.vividsolutions.jts.geom.Point;
public class FFMPResource extends public class FFMPResource extends
AbstractVizResource<FFMPResourceData, MapDescriptor> implements AbstractVizResource<FFMPResourceData, MapDescriptor> implements
IResourceDataChanged, IFFMPResourceListener, FFMPListener { IResourceDataChanged, IFFMPResourceListener, FFMPListener,
Interrogatable {
/** Status handler */ /** Status handler */
private final IUFStatusHandler statusHandler = UFStatus private final IUFStatusHandler statusHandler = UFStatus
@ -3152,7 +3162,7 @@ public class FFMPResource extends
boolean guid = false; boolean guid = false;
Date oldestRefTime = getOldestTime(); Date oldestRefTime = getOldestTime();
Date mostRecentRefTime = getPaintTime().getRefTime(); Date mostRecentRefTime = getPaintTime().getRefTime();
Date barrierTime = getTableTime();// DR 16148 Date barrierTime = getTableTime();// DR 16148
Date minUriTime = getTimeOrderedKeys().get(0);// DR 16148 Date minUriTime = getTimeOrderedKeys().get(0);// DR 16148
@ -3167,10 +3177,11 @@ public class FFMPResource extends
if (rateBasin != null) { if (rateBasin != null) {
for (Date date : rateBasin.getValues().keySet()) { for (Date date : rateBasin.getValues().keySet()) {
if (date.before(minUriTime) || date.before(barrierTime) || date.after(mostRecentRefTime)) if (date.before(minUriTime) || date.before(barrierTime)
|| date.after(mostRecentRefTime))
continue;// DR 16148 continue;// DR 16148
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime, double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
date); date);
fgd.setRate(dtime, (double) rateBasin.getValue(date)); fgd.setRate(dtime, (double) rateBasin.getValue(date));
@ -3195,8 +3206,9 @@ public class FFMPResource extends
if (qpeBasin != null) { if (qpeBasin != null) {
for (Date date : qpeBasin.getValues().keySet()) { for (Date date : qpeBasin.getValues().keySet()) {
if (date.before(minUriTime) || date.before(barrierTime) || date.after(mostRecentRefTime)) if (date.before(minUriTime) || date.before(barrierTime)
|| date.after(mostRecentRefTime))
continue;// DR 16148 continue;// DR 16148
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime, double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
@ -4188,4 +4200,58 @@ public class FFMPResource extends
return Status.OK_STATUS; return Status.OK_STATUS;
} }
} }
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.core.rsc.interrogation.Interrogatable#
* getInterrogationKeys()
*/
@Override
public Set<InterrogationKey<?>> getInterrogationKeys() {
Set<InterrogationKey<?>> set = new HashSet<InterrogationKey<?>>();
set.add(Interrogator.GEOMETRY);
set.add(Interrogator.VALUE);
set.add(new ClassInterrogationKey<Double>(Double.class));
return set;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.rsc.interrogation.Interrogatable#interrogate
* (com.raytheon.uf.common.geospatial.ReferencedCoordinate,
* com.raytheon.uf.common.time.DataTime,
* com.raytheon.uf.viz.core.rsc.interrogation.InterrogationKey<?>[])
*/
@Override
public InterrogateMap interrogate(ReferencedCoordinate coordinate,
DataTime time, InterrogationKey<?>... keys) {
InterrogateMap map = new InterrogateMap();
try {
FFMPBasinMetaData metaBasin = monitor.getTemplates(getSiteKey())
.findBasinByLatLon(getSiteKey(), coordinate.asLatLon());
if (metaBasin != null) {
Float value = getBasinValue(metaBasin.getPfaf(), getPaintTime()
.getRefTime(), true);
if (value != null) {
ColorMapParameters parameters = getCapability(
ColorMapCapability.class).getColorMapParameters();
map.put(Interrogator.VALUE,
Measure.valueOf(value, parameters.getDisplayUnit()));
}
Geometry geom = monitor.getTemplates(getSiteKey())
.getRawGeometries(getSiteKey(), metaBasin.getCwa())
.get(metaBasin.getPfaf());
if (geom != null) {
map.put(Interrogator.GEOMETRY, geom);
}
}
} catch (TransformException | FactoryException e) {
statusHandler.handle(Priority.PROBLEM,
"Unable to transform coordinate to lat/lon value", e);
}
return map;
}
} }