Issue #189 a few fixes to grid resources for FFG Mosaic
Former-commit-id:dc0e75eb29
[formerly64d4a1add7
] [formerly4b121fd7b3
[formerly f8420e7052145c856b12310776e6acd7362dc9cb]] Former-commit-id:4b121fd7b3
Former-commit-id:bde106e70d
This commit is contained in:
parent
b289472e49
commit
ec68d0445e
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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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