Issue #189 a few fixes to grid resources for FFG Mosaic
Former-commit-id: f8420e7052145c856b12310776e6acd7362dc9cb
This commit is contained in:
parent
3c64544822
commit
4b121fd7b3
2 changed files with 34 additions and 18 deletions
|
@ -18,6 +18,7 @@
|
|||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.grid.rsc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -38,19 +39,19 @@ import com.raytheon.viz.core.rsc.VizGroupResourceData;
|
|||
|
||||
/**
|
||||
* FFG Group Resource class.
|
||||
*
|
||||
*
|
||||
* Based off VizGroupResource.java
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 19, 2012 1162 mpduff Initial creation.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -63,7 +64,7 @@ public class FFGVizGroupResource extends
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param resourceData
|
||||
* @param loadProperties
|
||||
*/
|
||||
|
@ -75,7 +76,7 @@ public class FFGVizGroupResource extends
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.rsc.AbstractVizResource#disposeInternal()
|
||||
*/
|
||||
@Override
|
||||
|
@ -89,7 +90,7 @@ public class FFGVizGroupResource extends
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.rsc.AbstractVizResource#paintInternal(com.raytheon
|
||||
* .uf.viz.core.IGraphicsTarget,
|
||||
|
@ -107,7 +108,7 @@ public class FFGVizGroupResource extends
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.rsc.AbstractVizResource#inspect(com.raytheon
|
||||
* .uf.common.geospatial.ReferencedCoordinate)
|
||||
|
@ -116,11 +117,14 @@ public class FFGVizGroupResource extends
|
|||
public String inspect(ReferencedCoordinate coord) throws VizException {
|
||||
ResourceList rl = resourceData.getResourceList();
|
||||
String value = "No Data";
|
||||
Map<AbstractVizResource<?, ?>, DataTime[]> timeMap = descriptor
|
||||
.getTimeMatchingMap();
|
||||
for (ResourcePair pair : rl) {
|
||||
if (pair.getResource() != null) {
|
||||
AbstractVizResource<?,?> rsc = pair.getResource();
|
||||
AbstractVizResource<?, ?> rsc = pair.getResource();
|
||||
timeMap.put(rsc, timeMap.get(this));
|
||||
value = rsc.inspect(coord);
|
||||
if (!value.equals(NO_DATA)) {
|
||||
if (!NO_DATA.equalsIgnoreCase(value)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +135,7 @@ public class FFGVizGroupResource extends
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.rsc.AbstractVizResource#interrogate(com.raytheon
|
||||
* .uf.common.geospatial.ReferencedCoordinate)
|
||||
|
@ -145,7 +149,7 @@ public class FFGVizGroupResource extends
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.rsc.AbstractVizResource#initInternal(com.raytheon
|
||||
* .uf.viz.core.IGraphicsTarget)
|
||||
|
@ -179,7 +183,7 @@ public class FFGVizGroupResource extends
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see com.raytheon.uf.viz.core.rsc.IRefreshListener#refresh()
|
||||
*/
|
||||
@Override
|
||||
|
@ -190,7 +194,7 @@ public class FFGVizGroupResource extends
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.core.rsc.IResourceDataChanged#resourceChanged(com
|
||||
* .raytheon.uf.viz.core.rsc.IResourceDataChanged.ChangeType,
|
||||
|
|
|
@ -584,8 +584,20 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
|
|||
&& !criteria.getCreatingEntityNames().isEmpty()) {
|
||||
creatingEntity = criteria.getCreatingEntityNames().get(0);
|
||||
}
|
||||
return ColorMapParameterFactory.build(data.getScalarData().array(),
|
||||
parameter, parameterUnits, level, creatingEntity);
|
||||
ColorMapParameters newParameters = ColorMapParameterFactory.build(data
|
||||
.getScalarData().array(), parameter, parameterUnits, level,
|
||||
creatingEntity);
|
||||
ColorMapParameters oldParameters = this.getCapability(
|
||||
ColorMapCapability.class).getColorMapParameters();
|
||||
if (oldParameters != null
|
||||
&& oldParameters.getDataMin() <= newParameters.getDataMin()
|
||||
&& oldParameters.getDataMax() >= newParameters.getDataMax()) {
|
||||
// if the oldParameters have a larger range than the new parameters,
|
||||
// reuse the old parameters. This is useful when the resource is
|
||||
// sharing capabilities, for example in an FFGVizGroupResource.
|
||||
newParameters = oldParameters;
|
||||
}
|
||||
return newParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue