Issue #189 a few fixes to grid resources for FFG Mosaic
Former-commit-id:dc0e75eb29
[formerly64d4a1add7
] [formerlydc0e75eb29
[formerly64d4a1add7
] [formerly4b121fd7b3
[formerly f8420e7052145c856b12310776e6acd7362dc9cb]]] Former-commit-id:4b121fd7b3
Former-commit-id:ec68d0445e
[formerlybde106e70d
] Former-commit-id:b830e7c9c2
This commit is contained in:
parent
0d1b4baba6
commit
518644cc2f
2 changed files with 34 additions and 18 deletions
|
@ -18,6 +18,7 @@
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.viz.grid.rsc;
|
package com.raytheon.viz.grid.rsc;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -116,11 +117,14 @@ public class FFGVizGroupResource extends
|
||||||
public String inspect(ReferencedCoordinate coord) throws VizException {
|
public String inspect(ReferencedCoordinate coord) throws VizException {
|
||||||
ResourceList rl = resourceData.getResourceList();
|
ResourceList rl = resourceData.getResourceList();
|
||||||
String value = "No Data";
|
String value = "No Data";
|
||||||
|
Map<AbstractVizResource<?, ?>, DataTime[]> timeMap = descriptor
|
||||||
|
.getTimeMatchingMap();
|
||||||
for (ResourcePair pair : rl) {
|
for (ResourcePair pair : rl) {
|
||||||
if (pair.getResource() != null) {
|
if (pair.getResource() != null) {
|
||||||
AbstractVizResource<?,?> rsc = pair.getResource();
|
AbstractVizResource<?, ?> rsc = pair.getResource();
|
||||||
|
timeMap.put(rsc, timeMap.get(this));
|
||||||
value = rsc.inspect(coord);
|
value = rsc.inspect(coord);
|
||||||
if (!value.equals(NO_DATA)) {
|
if (!NO_DATA.equalsIgnoreCase(value)) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -584,8 +584,20 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
|
||||||
&& !criteria.getCreatingEntityNames().isEmpty()) {
|
&& !criteria.getCreatingEntityNames().isEmpty()) {
|
||||||
creatingEntity = criteria.getCreatingEntityNames().get(0);
|
creatingEntity = criteria.getCreatingEntityNames().get(0);
|
||||||
}
|
}
|
||||||
return ColorMapParameterFactory.build(data.getScalarData().array(),
|
ColorMapParameters newParameters = ColorMapParameterFactory.build(data
|
||||||
parameter, parameterUnits, level, creatingEntity);
|
.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