Merge "ASM #632 -Filter erroneous RPG alert messages." into asm_14.4.1

Former-commit-id: 206a985f23 [formerly d0072cd181] [formerly 2efa96316e [formerly 503e8a59c9608c3094d817e3e2d5e07250c0e0e5]]
Former-commit-id: 2efa96316e
Former-commit-id: 2ab78c21f2
This commit is contained in:
Juliya Dynina 2015-01-07 09:02:32 -05:00 committed by Gerrit Code Review
commit 6c868a9c74
2 changed files with 79 additions and 6 deletions

View file

@ -99,6 +99,7 @@ import com.raytheon.uf.edex.database.cluster.ClusterTask;
* Oct 09, 2013 2457 bsteffen Improve error message for missing icao.
* Jan 21, 2014 2627 njensen Removed decode()'s try/catch, camel route will do try/catch
* May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage
* Dec 26, 2014 ASM#632 dhuffman Added AlertMessageSanityCheck() for this DR.
*
* </pre>
*
@ -313,11 +314,20 @@ public class RadarDecoder extends AbstractDecoder {
details += "Alert Category : " + category + "\n";
details += "Threshold : " + msg.getThresholdValue() + "\n";
details += "Exceeding : " + msg.getExceedingValue() + "\n";
details += "Storm Cell ID :" + msg.getStormId() + "\n";
details += "Storm Cell ID : " + msg.getStormId() + "\n";
record.setAlertMessage(msg);
EDEXUtil.sendMessageAlertViz(Priority.SIGNIFICANT,
RadarConstants.PLUGIN_ID, EDEX, RADAR, record.getIcao()
+ ": Alert Message Received", details, null);
if (AlertMessageSanityCheck(msg)) {
EDEXUtil.sendMessageAlertViz(Priority.SIGNIFICANT,
RadarConstants.PLUGIN_ID, EDEX, RADAR,
record.getIcao() + ": Alert Message Received",
details, null);
} else {
details += "Alert Category # : " + msg.getAlertCategory() + "\n";
EDEXUtil.sendMessageAlertViz(Priority.DEBUG,
RadarConstants.PLUGIN_ID, EDEX, RADAR,
record.getIcao() + ": Alert Received & Obviated",
details, null);
}
} else {
record.setLatitude((float) l3Radar.getLatitude());
record.setLongitude((float) l3Radar.getLongitude());
@ -759,4 +769,24 @@ public class RadarDecoder extends AbstractDecoder {
public void setRadarStationDao(RadarStationDao radarStationDao) {
this.radarStationDao = radarStationDao;
}
/**
* Filter these erroneous messages; pursuant to ASM DR #632.
*
* @param AlertMessage
* @return boolean
*/
private static boolean AlertMessageSanityCheck(final AlertMessage alertMessage) {
if (alertMessage.getExceedingValue() < alertMessage.getThresholdValue())
return false;
if (alertMessage.getGridBoxAz() == 0
&& alertMessage.getGridBoxRange() == 0
&& alertMessage.getThresholdValue() == 0
&& alertMessage.getExceedingValue() == 0
&& (alertMessage.getAlertCategory() == 16 || alertMessage.getAlertCategory() == 25))
return false;
return true;
}
}

View file

@ -35,6 +35,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* ------------- -------- ----------- --------------------------
* Aug 04, 2011 mnash Initial creation
* Jun 04, 2014 3232 bsteffen Remove ISerializableObject
* Dec 26, 2014 ASM#632 dhuffman Edited AlertCategory to conform with
* Table IV of the "ICD for the RPG to Class 1 User"
*
* </pre>
*
@ -44,9 +46,50 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
@DynamicSerialize
public class AlertMessage {
// Table IV in document: Interface Control Document for the RPG to Class 1 User
public enum AlertCategory {
Empty, GRID_Velocity, GRID_Composite_Reflectivity, GRID_Echo_Tops, GRID_Severe_Weather_Probability, GRID_Spare, GRID_Vertically_Integrated_Liquid, VOLUME_Velocity_Azimuth_Display, VOLUME_Minimum_Size_Hail, VOLUME_Spare, VOLUME_Tornado_Vortex_Signature, VOLUME_Maximum_Storm_Reflectivity, VOLUME_Probability_of_Hail, VOLUME_Storm_Top, VOLUME_Maximum_1_Hour_Rainfall_Accumulation, VOLUME_MDA_Strength_Rank, VOLUME_Spare1, FORECAST_Maximum_Hail_Size, FORECAST_Spare, FORECAST_Tornado_Vortex_Signature, FORECAST_Maximum_Storm_Reflectivity, FORECAST_Probability_of_Hail, FORECAST_Probability_of_Severe_Hail, FORECAST_Storm_Top, FORECAST_MDA_Strength_Rank, FORECAST_Spare1
UNUSED_Zero,
GRID_Velocity,
GRID_Composite_Reflectivity,
GRID_Echo_Tops,
GRID_Severe_Weather_Probability,
GRID_Spare,
GRID_Vertically_Integrated_Liquid,
VOLUME_Velocity_Azimuth_Display,
VOLUME_Maximum_Size_Hail,
VOLUME_Spare,
VOLUME_Tornado_Vortex_Signature,
VOLUME_Maximum_Storm_Reflectivity,
VOLUME_Probability_of_Hail,
VOLUME_Probability_of_Severe_Hail,
VOLUME_Storm_Top,
VOLUME_Maximum_1_Hour_Rainfall_Accumulation,
VOLUME_MDA_Strength_Rank,
UNUSED_Spare17,
UNUSED_Spare18,
UNUSED_Spare19,
UNUSED_Spare20,
UNUSED_Spare21,
UNUSED_Spare22,
UNUSED_Spare23,
UNUSED_Spare24,
FORECAST_Maximum_Hail_Size,
FORECAST_Spare,
FORECAST_Tornado_Vortex_Signature,
FORECAST_Maximum_Storm_Reflectivity,
FORECAST_Probability_of_Hail,
FORECAST_Probability_of_Severe_Hail,
FORECAST_Storm_Top,
FORECAST_MDA_Strength_Rank,
UNUSED_Spare33,
UNUSED_Spare34,
UNUSED_Spare35,
UNUSED_Spare36,
UNUSED_Spare37,
UNUSED_Spare38,
UNUSED_Spare39,
UNUSED_Spare40,
UNUSED_Spare41
}
@DynamicSerializeElement