Merge "Omaha #4709 Style rules for SAR winds." into omaha_16.2.1

Former-commit-id: 6330f484f5bc273a2cd6a574cdc73e173e439b1d
This commit is contained in:
Ben Steffensmeier 2015-09-01 11:20:39 -05:00 committed by Gerrit Code Review
commit cb05181b01
4 changed files with 79 additions and 11 deletions

View file

@ -85,7 +85,13 @@ public class PointSetFrame {
}
public String inspect(double x, double y) {
return image.getDataValue(x, y) + record.getParameter().getUnitString();
double data_value = image.getDataValue(x, y);
if (Double.isNaN(data_value)) {
return "No Data";
} else {
return String.format("%4.2f %s", image.getDataValue(x, y), record
.getParameter().getUnitString());
}
}
public boolean paint(PaintProperties paintProps, IGraphicsTarget target)

View file

@ -47,6 +47,7 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.pointset.PointSetRecord;
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
import com.raytheon.uf.common.numeric.UnsignedNumbers;
import com.raytheon.uf.common.style.AbstractStylePreferences;
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
import com.raytheon.uf.common.style.StyleException;
import com.raytheon.uf.common.style.StyleManager;
@ -88,6 +89,8 @@ public class PointSetResource extends
private final PointSetStageJob stageJob = new PointSetStageJob();
private StyleRule styleRule;
private Map<DataTime, PointSetFrame> frames = new HashMap<>();
protected PointSetResource(PointSetResourceData resourceData,
@ -116,7 +119,7 @@ public class PointSetResource extends
matchCriteria.setCreatingEntityNames(Arrays.asList(record
.getDatasetId()));
try {
StyleRule styleRule = StyleManager.getInstance().getStyleRule(
styleRule = StyleManager.getInstance().getStyleRule(
StyleType.IMAGERY, matchCriteria);
if (styleRule != null) {
return ColorMapParameterFactory.build(styleRule, record
@ -251,17 +254,34 @@ public class PointSetResource extends
} else {
PointSetRecord record = frame.getRecord();
String unitStr = record.getParameter().getUnitString();
ColorMapParameters parameters = getCapability(
ColorMapCapability.class).getColorMapParameters();
if (parameters != null) {
Unit<?> unit = parameters.getDisplayUnit();
if (unit != null) {
unitStr = UnitFormat.getUCUMInstance().format(unit);
boolean includeLevel = true;
if (styleRule != null) {
AbstractStylePreferences prefs = styleRule.getPreferences();
includeLevel = !prefs.getDisplayFlags()
.hasFlag("NoPlane");
String prefsUnitStr = prefs.getDisplayUnitLabel();
if (prefsUnitStr != null) {
unitStr = prefs.getDisplayUnitLabel();
}
} else {
ColorMapParameters parameters = getCapability(
ColorMapCapability.class).getColorMapParameters();
if (parameters != null) {
Unit<?> unit = parameters.getDisplayUnit();
if (unit != null) {
unitStr = UnitFormat.getUCUMInstance().format(unit);
}
}
}
return frame.getRecord().getDatasetId() + " " + record.getLevel()
+ " " + record.getParameter().getName() + " (" + unitStr
String datasetIdPart = frame.getRecord().getDatasetId();
String levelPart = "";
if (includeLevel) {
levelPart = " " + record.getLevel();
}
String paramPart = " " + record.getParameter().getName() + " ("
+ unitStr
+ ")";
return datasetIdPart + levelPart + paramPart;
}
}

View file

@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
.,\
utility/

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
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
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
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<styleRuleset>
<styleRule>
<paramLevelMatches>
<creatingEntity>RADARSAT-2</creatingEntity>
<creatingEntity>SENTINEL-1A</creatingEntity>
<parameter>WS</parameter>
</paramLevelMatches>
<imageStyle>
<displayUnits>m/s</displayUnits>
<displayFlags>NoPlane</displayFlags>
<range scale="LINEAR">
<minValue>0</minValue>
<maxValue>75</maxValue>
</range>
<defaultColormap>Grid/gridded data</defaultColormap>
<colorbarLabeling>
<increment>10</increment>
</colorbarLabeling>
</imageStyle>
</styleRule>
</styleRuleset>