12.9.1-12 baseline

Former-commit-id: 150bc967a5 [formerly 09035ea929c2e926b2dce13429c29d3fd3707880]
Former-commit-id: 948766c387
This commit is contained in:
Steve Harris 2012-09-04 11:47:38 -05:00
parent d07c18918d
commit 4bf4f0043a
14 changed files with 187 additions and 97 deletions

View file

@ -40,11 +40,6 @@ import Exceptions
from java.lang.System import getProperty
from com.raytheon.uf.common.dataplugin.gfe.reference import ReferenceID
from com.raytheon.viz.gfe.core import DataManager
from com.raytheon.uf.common.localization import PathManagerFactory
from com.raytheon.uf.viz.core.localization import LocalizationManager
from com.raytheon.uf.common.localization import LocalizationContext_LocalizationLevel as LocalizationLevel
from com.raytheon.uf.common.localization import LocalizationContext_LocalizationType as LocalizationType
from com.raytheon.uf.common.dataplugin.gfe.python import GfePyIncludeUtil
CLASS_NAME = 'Procedure'

View file

@ -38,9 +38,6 @@ import FormatterRunner
import loadConfig
from com.raytheon.viz.gfe.core import DataManager
from com.raytheon.uf.common.localization import PathManagerFactory
from com.raytheon.uf.common.localization import LocalizationContext_LocalizationLevel as LocalizationLevel
from com.raytheon.uf.common.localization import LocalizationContext_LocalizationType as LocalizationType
LOGGER = None

View file

@ -17,11 +17,23 @@
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 08/20/2012 #1077 randerso Fixed backgroundColor setting
# 08/20/2012 #1082 randerso fixed 1 image per grid
#
#
#
import string, LogStream, getopt, sys, os, time
import time, TimeRange, AbsTime
import GFEPainter
import loadConfig
from operator import attrgetter
from java.util import ArrayList
from com.raytheon.uf.common.time import DataTime
from com.raytheon.uf.viz.core import RGBColors
from com.raytheon.viz.gfe.core.parm import ParmDisplayAttributes_VisMode as VisMode
@ -244,7 +256,10 @@ class PngWriter:
maskBasedOnHistory = self.getConfig('Png_historyMask', 0, int)
wholeDomain = self.getConfig('Png_wholeDomain', 0, int)
viz = GFEPainter.GFEPainter(width, height, leftExpand, rightExpand, topExpand, bottomExpand, mask, wholeDomain)
#TODO handle transparent background
bgColor, trans = self.getBG()
viz = GFEPainter.GFEPainter(width, height, leftExpand, rightExpand, topExpand, bottomExpand, mask, wholeDomain, bgColor)
if not omitColorbar:
viz.enableColorbar()
@ -253,8 +268,17 @@ class PngWriter:
# allow user to specify precise interval for creation of images
# rather than the automatically generated set
try:
paintInterval = self.getConfig('Png_interval', 6, int)
paintInterval = self.getConfig('Png_interval', None, int)
if paintInterval is None:
parmList = ArrayList();
for p in prms:
parmList.add(p)
jtimes = self.dm.getParmManager().calcStepTimes(parmList,
self.dm.getParmManager().getSystemTimeRange())
times = []
for i in xrange(jtimes.size()):
times.append(AbsTime.AbsTime(jtimes.get(i)))
else:
paintIntervalOffset = self.getConfig('Png_intervalOffset', 0, int)
if paintInterval < 0:
paintInterval = 1
@ -274,9 +298,7 @@ class PngWriter:
if t >= firstTime:
times.append(t)
t = t + paintInterval
except KeyError:
times = Graphics.calcStepTimes(prms,
self.dm.parmMgr().systemTimeRange())
if len(times) == 0:
LogStream.logEvent("No grids to generate")
@ -306,9 +328,6 @@ class PngWriter:
lang = self.getConfig('Png_legendLanguage', '');
viz.setupLegend(localTime, snapshotTime, snapshotFmt, descName, durFmt, startFmt, endFmt, overrideColors, lang)
#TODO handle transparent background
bgColor, trans = self.getBG()
xOffset = self.getConfig("MapLabelXOffset", None, int)
yOffset = self.getConfig("MapLabelYOffset", None, int)
for map in maps:
@ -351,7 +370,7 @@ class PngWriter:
# paint once to get map retrieval started
if len(times) > 0:
viz.paint(times[0], backgroundColor=bgColor)
viz.paint(times[0])
for t in times:
paintTime = t
@ -381,7 +400,7 @@ class PngWriter:
RGBColors.getColorName(p.getDisplayAttributes().getBaseColor()), p.getDisplayAttributes().getVisMode().toString() == 'Image')
visualInfo.append(info)
viz.paint(paintTime, backgroundColor=bgColor)
viz.paint(paintTime)
fname = self.getFileName(dir, t) + '.' + fexten
viz.outputFiles(fname, showLogo, logoString)
self.writeInfo(dir, paintTime, visualInfo)

View file

@ -45,6 +45,7 @@ from java.util import HashSet
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 04/01/09 njensen Initial Creation.
# 08/20/2012 #1077 randerso Fixed backgroundColor setting
#
#
#
@ -53,7 +54,7 @@ import VizPainter
class GFEPainter(VizPainter.VizPainter):
def __init__(self, imageWidth=None, imageHeight=None, expandLeft=25.0, expandRight=25.0, expandTop=25.0, expandBottom=25.0, mask=None, wholeDomain=0):
def __init__(self, imageWidth=None, imageHeight=None, expandLeft=25.0, expandRight=25.0, expandTop=25.0, expandBottom=25.0, mask=None, wholeDomain=0, bgColor=None):
self.dataMgr = DataManager.getInstance(None)
self.refId = None
envelope = None
@ -72,7 +73,7 @@ class GFEPainter(VizPainter.VizPainter):
display.setDataManager(self.dataMgr)
desc = display.getDescriptor()
self.dataMgr.getSpatialDisplayManager().setDescriptor(desc)
VizPainter.VizPainter.__init__(self, display)
VizPainter.VizPainter.__init__(self, display, backgroundColor=bgColor)
gfeSystem = GFESystemResource(self.dataMgr)
self.addVizResource(gfeSystem)

View file

@ -1,19 +1,19 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
@ -31,6 +31,7 @@ from com.raytheon.viz.core.gl import GLTargetProxy
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 04/01/09 njensen Initial Creation.
# 08/20/2012 #1077 randerso Fixed backgroundColor setting
#
#
#
@ -40,13 +41,18 @@ SUPPORTED_FORMATS = ('.png', '.jpg', '.gif')
class VizPainter():
def __init__(self, renderableDisplay, imageWidth=None, imageHeight=None):
def __init__(self, renderableDisplay, imageWidth=None, imageHeight=None, backgroundColor=None):
self.display = renderableDisplay
width = float(self.display.getWorldWidth())
height = float(self.display.getWorldHeight())
extent = GraphicsFactory.getGraphicsAdapter().constructExtent(0.0, width, 0.0, height)
self.display.setExtent(extent)
if backgroundColor is not None and type(backgroundColor) is str:
from com.raytheon.uf.viz.core import RGBColors
backgroundColor = RGBColors.getRGBColor(backgroundColor)
self.display.setBackgroundColor(backgroundColor)
if imageWidth is None:
imageWidth = width
if imageHeight is None:
@ -79,7 +85,7 @@ class VizPainter():
vizResource.init(self.target)
desc.getResourceList().add(vizResource)
def paint(self, time, canvas=None, backgroundColor=None):
def paint(self, time, canvas=None):
if type(time) is str:
from com.raytheon.uf.common.time import DataTime
time = DataTime(time)
@ -94,16 +100,10 @@ class VizPainter():
framesInfo = self.display.getDescriptor().getFramesInfo()
props = PaintProperties(alpha, zoom, view, canvas, False, framesInfo)
if backgroundColor is not None and type(backgroundColor) is str:
from com.raytheon.uf.viz.core import RGBColors
backgroundColor = RGBColors.getRGBColor(backgroundColor)
# requires multiple passes to paint everything
paint = True
while paint:
self.target.beginFrame(self.display.getView(), True)
if backgroundColor is not None:
self.target.setBackgroundColor(backgroundColor)
self.display.paint(self.target, props)
self.target.endFrame()
paint = self.target.isNeedsRefresh()

View file

@ -19,6 +19,10 @@
**/
package com.raytheon.viz.gfe;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import jep.Jep;
import jep.JepException;
@ -46,6 +50,8 @@ import com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 25, 2010 mschenke Initial creation
* Aug 20, 2012 #1081 dgilling Don't pass -server and -site args
* to python script.
*
* </pre>
*
@ -127,9 +133,17 @@ public class GfeClient extends AbstractCAVEComponent {
jep.eval("import JavaImporter");
jep.eval("import sys");
jep.eval("sys.argv = []");
boolean skipNextArg = false;
Collection<String> ignoredParams = getIgnoredParameters();
for (int i = gfeClientArgStartIndex; i < args.length; i++) {
jep.eval("sys.argv.append('" + args[i].replaceAll("'", "\\\\'")
+ "')");
if (ignoredParams.contains(args[i])) {
skipNextArg = true;
} else if (skipNextArg) {
skipNextArg = false;
} else {
jep.eval("sys.argv.append('"
+ args[i].replaceAll("'", "\\\\'") + "')");
}
}
jep.runScript(args[gfeClientArgStartIndex]);
// jep.eval("main()");
@ -156,4 +170,8 @@ public class GfeClient extends AbstractCAVEComponent {
return (NON_UI | ALERT_VIZ);
}
private Collection<String> getIgnoredParameters() {
return new HashSet<String>(Arrays.asList("-site", "-server", "-mode",
"-time"));
}
}

View file

@ -19,6 +19,7 @@
**/
package com.raytheon.viz.gfe.core;
import java.util.Date;
import java.util.List;
import com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID;
@ -49,6 +50,8 @@ import com.raytheon.viz.gfe.core.parm.vcparm.VCModuleJobPool;
* ------------ ---------- ----------- --------------------------
* 01/28/2008 chammack Initial creation of skeleton.
* 06/25/2012 #766 dgilling Added getVCModulePool().
* 08/20/2012 #1082 randerso Moved calcStepTimes to AbstractParmManager for
* use in PngWriter
*
* </pre>
*
@ -548,4 +551,6 @@ public interface IParmManager extends IParmInventoryChangedListener,
public JobPool getNotificationPool();
public VCModuleJobPool getVCModulePool();
public abstract List<Date> calcStepTimes(List<Parm> parms, TimeRange dspTR);
}

View file

@ -32,7 +32,9 @@ import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
import java.util.SortedSet;
import java.util.TimeZone;
import java.util.TreeSet;
import org.eclipse.core.runtime.ListenerList;
@ -63,6 +65,7 @@ import com.raytheon.viz.gfe.GFEServerException;
import com.raytheon.viz.gfe.PythonPreferenceStore;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.IParmManager;
import com.raytheon.viz.gfe.core.griddata.IGridData;
import com.raytheon.viz.gfe.core.internal.NotificationRouter.AbstractGFENotificationObserver;
import com.raytheon.viz.gfe.core.msgs.IAvailableSourcesChangedListener;
import com.raytheon.viz.gfe.core.msgs.IDisplayedParmListChangedListener;
@ -96,6 +99,8 @@ import com.raytheon.viz.gfe.core.parm.vcparm.VCModuleJobPool;
* correspond to a visible mutable parm.
* 06/25/2012 #766 dgilling Move to a shared thread pool for VCModule
* execution.
* 08/20/2012 #1082 randerso Moved calcStepTimes to AbstractParmManager for
* use in PngWriter
*
* </pre>
*
@ -2097,4 +2102,32 @@ public abstract class AbstractParmManager implements IParmManager {
public VCModuleJobPool getVCModulePool() {
return vcModulePool;
}
// Now construct the step times.
// All startTimes are included.
// EndTimes which are contained in another TR are included.
@Override
public List<Date> calcStepTimes(List<Parm> parms, TimeRange dspTR) {
SortedSet<Date> dateSet = new TreeSet<Date>();
for (Parm pi : parms) {
IGridData[] inv = pi.getGridInventory();
for (IGridData grid : inv) {
dateSet.add(grid.getGridTime().getStart());
if (!dateSet.contains(grid.getGridTime().getEnd())) {
for (Parm pk : parms) {
if (pi != pk
&& pi.overlappingGrid(grid.getGridTime()
.getEnd()) != null) {
dateSet.add(grid.getGridTime().getEnd());
break;
}
}
}
}
}
return new ArrayList<Date>(dateSet);
}
}

View file

@ -107,6 +107,8 @@ import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
* Apr 7, 2009 randerso Initial creation
* Jun 3, 2011 8919 rferrel Determine grid's VisMode based
* on imageOnEdit
* 08/20/2012 #1082 randerso Moved calcStepTimes to AbstractParmManager for
* use in PngWriter
*
* </pre>
*
@ -992,36 +994,8 @@ public class GridCanvas extends Canvas implements IMessageClient {
// }
}
}
stepTimes = calcStepTimes(parms, new TimeRange());
}
// Now construct the step times.
// All startTimes are included.
// EndTimes which are contained in another TR are included.
private List<Date> calcStepTimes(List<Parm> parms, TimeRange dspTR) {
ArrayList<Date> rval = new ArrayList<Date>();
for (int i = 0; i < parms.size(); i++) {
IGridData[] inv = parms.get(i).getGridInventory();
for (int j = 0; j < inv.length; j++) {
if (!rval.contains(inv[j].getGridTime().getStart())) {
rval.add(inv[j].getGridTime().getStart());
}
if (!rval.contains(inv[j].getGridTime().getEnd())) {
for (int k = 0; k < parms.size(); k++) {
if (parms.get(i) != parms.get(k)
&& parms.get(i).overlappingGrid(
inv[j].getGridTime().getEnd()) != null) {
rval.add(inv[j].getGridTime().getEnd());
break;
}
}
}
}
}
Collections.sort(rval);
return rval;
stepTimes = dataMgr.getParmManager().calcStepTimes(parms,
new TimeRange());
}
/**

View file

@ -36,29 +36,34 @@ import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
import com.raytheon.viz.core.ColorUtil;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.gfe.core.griddata.IGridData;
import com.raytheon.viz.gfe.core.parm.Parm;
import com.raytheon.viz.gfe.core.parm.ParmDisplayAttributes.VisMode;
import com.raytheon.viz.gfe.rsc.GFELegendResource;
import com.raytheon.viz.gfe.rsc.GFEResource;
/**
* Image legend resource used by GFEPainter.py
*
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 24, 2011 mschenke Initial creation
* Jun 25, 2012 15080 ryu Ron's local time fix
* Jul 10, 2012 15186 ryu Set legend font
*
* Aug 20, 2012 #1078 dgilling Fix handling of ImageLegend_color
* setting.
*
* </pre>
*
*
* @author mschenke
* @version 1.0
*/
@ -114,28 +119,29 @@ public class ImageLegendResource extends GFELegendResource {
private LegendData[] makeLegend(Parm[] parms, DataTime curTime) {
// loop through the grids
List<LegendData> legendData = new ArrayList<LegendData>();
Parm activeParm = dataManager.getSpatialDisplayManager()
.getActivatedParm();
for (int i = parms.length - 1; i >= 0; i--) {
Parm parm = parms[i];
String parmName = parm.getParmID().getParmName();
ResourcePair rp = this.parmToRscMap.get(parm);
GFEResource rsc = (GFEResource) rp.getResource();
ResourceProperties props = rp.getProperties();
LegendData data = new LegendData();
data.resource = rp;
// color for the text
RGB color;
if (colorOverrides != null
&& (color = colorOverrides.get(parmName)) != null) {
data.color = color;
if ((props.isVisible())
&& (parm.getDisplayAttributes().getVisMode() == VisMode.IMAGE)) {
data.color = imageLegendColor;
} else if (!props.isVisible()) {
data.color = ColorUtil.GREY;
} else if ((colorOverrides != null)
&& (colorOverrides.get(parmName) != null)) {
// GFEPainter.py populates the colorOverrides map based on the
// "<parmName>_Legend_color" values from the gfe config file
data.color = colorOverrides.get(parmName);
} else {
if (rsc.getParm().equals(activeParm)) {
data.color = this.imageLegendColor;
} else {
data.color = rsc.getCapability(ColorableCapability.class)
.getColor();
}
data.color = rsc.getCapability(ColorableCapability.class)
.getColor();
}
String timeString = "";
@ -341,7 +347,7 @@ public class ImageLegendResource extends GFELegendResource {
/**
* Specifies the color for a legend entry, overrides the default
*
*
* @param parmName
* @param colorName
*/

View file

@ -49,6 +49,7 @@ import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
@ -86,6 +87,7 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
* Jun 11, 2009 #1947 rjpeter Moved parm save hook to GridManagerView.
* Apr 27, 2010 mschenke refactor for common perspective switching
* Jul 7, 2011 #9897 ryu close formatters on perspective close/reset
* Aug 20,2012 #1077 randerso Added support for bgColor setting
* </pre>
*
* @author randerso
@ -120,6 +122,13 @@ public class GFEPerspectiveManager extends AbstractCAVEPerspectiveManager {
PythonPreferenceStore prefs = Activator.getDefault()
.getPreferenceStore();
if (prefs.contains("bgColor")) {
String bgColor = prefs.getString("bgColor");
pane.getRenderableDisplay().setBackgroundColor(
RGBColors.getRGBColor(bgColor));
}
String[] maps = prefs.getStringArray("MapBackgrounds_default");
MapManager mapMgr = MapManager.getInstance((IMapDescriptor) pane
@ -238,8 +247,9 @@ public class GFEPerspectiveManager extends AbstractCAVEPerspectiveManager {
SmartToolJob.shutdown();
}
}).start();
if (FormatterlauncherAction.getFormatterLauncher() != null)
if (FormatterlauncherAction.getFormatterLauncher() != null) {
FormatterlauncherAction.getFormatterLauncher().closeFormatters();
}
}
@Override
@ -248,9 +258,10 @@ public class GFEPerspectiveManager extends AbstractCAVEPerspectiveManager {
if (IWorkbenchPage.CHANGE_RESET.equals(VizPerspectiveListener
.getInstance().getPerspectiveChangeId(
GFEPerspective.ID_PERSPECTIVE))) {
if (FormatterlauncherAction.getFormatterLauncher() != null)
if (FormatterlauncherAction.getFormatterLauncher() != null) {
FormatterlauncherAction.getFormatterLauncher()
.closeFormatters();
}
}
}

View file

@ -26,6 +26,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.DrawableColorMap;
import com.raytheon.uf.viz.core.DrawableLine;
import com.raytheon.uf.viz.core.DrawableString;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
@ -57,6 +58,7 @@ import com.raytheon.viz.gfe.rsc.GFEResource;
* ------------ ---------- ----------- --------------------------
* 03/26/2008 chammack Initial Creation.
* 04/13/2009 2092 njensen Support for custom labels
* 08/20/2012 #1083 randerso Fixed user defined labels
*
* </pre>
*
@ -175,6 +177,10 @@ public class ContinuousColorbar implements IColorBarDisplay {
dstring.horizontalAlignment = HorizontalAlignment.CENTER;
dstring.verticallAlignment = VerticalAlignment.MIDDLE;
DrawableLine dline = new DrawableLine();
dline.basics.color = seColorBarTickColor;
dline.width = 1.0f;
if ((labels == null) || (labels.length < 1)) {
float[] val = computeIntervalAndPrecision(minParm, maxParm,
paintProps.getCanvasBounds().width, target);
@ -201,8 +207,10 @@ public class ContinuousColorbar implements IColorBarDisplay {
if (GFEColorbarResource.isLabelWithin(pe.getMinX(),
pe.getMaxX(), labelLoc, 0)) {
target.drawLine(labelLoc, pe.getMinY(), 0.0, labelLoc,
pe.getMaxY(), 0.0, seColorBarTickColor, 1.0f);
dline.setCoordinates(labelLoc, pe.getMinY(), 0.0);
dline.addPoint(labelLoc, pe.getMaxY(), 0.0);
target.drawLine(dline);
dstring.setCoordinates(labelLoc, center);
dstring.setText(labelText, seColorBarTextColor);
target.drawStrings(dstring);
@ -224,11 +232,14 @@ public class ContinuousColorbar implements IColorBarDisplay {
}
if (GFEColorbarResource.isLabelWithin(pe.getMinX(),
pe.getMaxX(), labelLoc, 0)) {
target.drawLine(labelLoc, pe.getMinY(), 0.0, labelLoc,
pe.getMaxY(), 0.0, seColorBarTickColor, 1.0f);
dline.setCoordinates(labelLoc, pe.getMinY(), 0.0);
dline.addPoint(labelLoc, pe.getMaxY(), 0.0);
target.drawLine(dline);
String s = GFEColorbarResource.formatString(labelValue,
precision);
dstring.font = colorbarResource.getColorbarScaleFont();
dstring.setCoordinates(labelLoc, center);
dstring.setText(s, seColorBarTextColor);
target.drawStrings(dstring);
}
}

View file

@ -82,6 +82,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- --------------------------
* 05/23/2008 dfitch Initial Creation.
* Aug 20, 2008 dglazesk Updated for the new ColorMap interface
* Aug 20, 2012 1079 randerso Changed to display all discrete values for
* non-overlapping discretes
*
* </pre>
*
@ -148,6 +150,7 @@ public class DiscreteColorbar implements IColorBarDisplay,
*
* @see com.raytheon.viz.gfe.rsc.colorbar.IColorBarDisplay#dispose()
*/
@Override
public void dispose() {
parm.getListeners().removeGridChangedListener(this);
}
@ -264,13 +267,30 @@ public class DiscreteColorbar implements IColorBarDisplay,
}
private List<ColorEntry> calcGridColorTable(IGridData gridData) {
List<ColorEntry> cEntries = new ArrayList<ColorEntry>();
if (gridData == null) {
return new ArrayList<ColorEntry>();
return cEntries;
}
GridType gridType = parm.getGridInfo().getGridType();
ParmID parmId = parm.getParmID();
String siteId = parmId.getDbId().getSiteId();
String compName = parmId.getCompositeName();
// special case: discrete non-overlapping, use all keys
if (gridType.equals(GridType.DISCRETE)
&& !DiscreteKey.discreteDefinition(siteId).overlaps(compName)) {
List<String> dkeys = DiscreteKey.discreteDefinition(siteId)
.symbols(compName);
for (String key : dkeys) {
DiscreteKey dk = new DiscreteKey(siteId, key, parmId);
WxValue v = new DiscreteWxValue(dk, parm);
List<ImageAttr> attrs = DiscreteDisplayUtil
.getFillAttributes(v);
cEntries.add(new ColorEntry(v, attrs));
}
return cEntries;
}
// get the grid slice for the grid data
IGridSlice gs = gridData.getGridSlice();
@ -322,7 +342,6 @@ public class DiscreteColorbar implements IColorBarDisplay,
}
// map each WxValue and append ColorEntry to list
List<ColorEntry> cEntries = new ArrayList<ColorEntry>();
for (WxValue wxValue : gridWValues) {
List<ImageAttr> attrs = DiscreteDisplayUtil
.getFillAttributes(wxValue);

View file

@ -335,6 +335,7 @@ if [ "${1}" = "-ade" ]; then
fi
if [ "${1}" = "-viz" ]; then
buildRPM "awips2"
buildCAVE
if [ $? -ne 0 ]; then
exit 1