Merge "Issue #2278 Allow radar interrogation to work without ColorMapParameters." into development

Former-commit-id: 47a7241f60 [formerly 98033fe160] [formerly 2f6f82ed33] [formerly 47a7241f60 [formerly 98033fe160] [formerly 2f6f82ed33] [formerly 581a8e6be2 [formerly 2f6f82ed33 [formerly 201467b743951483ed64a681c07bb2478d9251ef]]]]
Former-commit-id: 581a8e6be2
Former-commit-id: bf3d336723 [formerly dbb33a650f] [formerly defa85854df69770654faa395f67543d04558d53 [formerly 1af3a19977]]
Former-commit-id: 40e8e7148b3d57f227d8c8d444b54ecbbf8e3420 [formerly b291180695]
Former-commit-id: 545bf35a67
This commit is contained in:
Nate Jensen 2013-08-23 12:45:43 -05:00 committed by Gerrit Code Review
commit 24c9386d70

View file

@ -54,8 +54,10 @@ import com.vividsolutions.jts.geom.Coordinate;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 4, 2010 mnash Initial creation
* 05/02/2013 DR 14587 D. Friedman Refactor to store multiple types.
* Aug 04, 2010 mnash Initial creation
* May 02, 2013 14587 D. Friedman Refactor to store multiple types.
* Aug 22, 2013 2278 bsteffen Allow radar interrogation to work
* without ColorMapParameters.
*
* </pre>
*
@ -220,7 +222,7 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
UnitConverter converter = getConverter(params, radarRecord);
double dispVal = converter.convert(dataValue);
dataMap.put(baseName + "numericValue", String.valueOf(dispVal));
if (params.getDataMapping() != null) {
if (params != null && params.getDataMapping() != null) {
for (DataMappingEntry entry : params.getDataMapping().getEntries()) {
if (entry.getSample() == null) {
continue;
@ -239,7 +241,7 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
}
}
String unitString = "";
if (params.getDisplayUnit() != Unit.ONE) {
if (params != null && params.getDisplayUnit() != Unit.ONE) {
unitString = UnitFormat.getUCUMInstance().format(
params.getDisplayUnit());
}
@ -277,7 +279,9 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
RadarRecord radarRecord) {
UnitConverter converter = null;
Unit<?> dataUnit = radarRecord.getDataUnit();
if (dataUnit != null && !dataUnit.equals(params.getDataUnit())) {
if (params == null) {
converter = UnitConverter.IDENTITY;
} else if (dataUnit != null && !dataUnit.equals(params.getDataUnit())) {
Unit<?> displayUnit = params.getDisplayUnit();
if (dataUnit.isCompatible(displayUnit)) {
converter = dataUnit.getConverterTo(displayUnit);
@ -285,6 +289,7 @@ public class RadarDefaultInterrogator implements IRadarInterrogator {
} else {
converter = params.getDataToDisplayConverter();
}
return converter;
}
}