Merge "Issue #185 handle CommunicationExceptions from the LevelFactory in remerged ncep grib decoder." into 4-Thin_Client

Former-commit-id: b07575c5b3 [formerly a914aa38c8] [formerly e3e44707a4] [formerly b07575c5b3 [formerly a914aa38c8] [formerly e3e44707a4] [formerly fef3fcb60c [formerly e3e44707a4 [formerly fd448c2a996aef215802dc501b68d28747f66414]]]]
Former-commit-id: fef3fcb60c
Former-commit-id: 2db5dbe305 [formerly e0e2a82d83] [formerly 834f82bd59e01c6c99532d9991840fdacffe244d [formerly d03ff9824e]]
Former-commit-id: 00d9274cb54bfd12a616a71999f8fb9951113a37 [formerly 57c46aa9e1]
Former-commit-id: a9a165f471
This commit is contained in:
Nate Jensen 2012-02-23 11:50:39 -06:00 committed by Gerrit Code Review
commit cc42feebbd
2 changed files with 10 additions and 1502 deletions

View file

@ -67,6 +67,7 @@ import gov.noaa.nws.ncep.edex.util.grib2vars.Grib2VarsTableLookup;
import gov.noaa.nws.ncep.edex.util.grib2vcrd.Grib2Vcrd;
import com.raytheon.edex.util.Util;
import com.raytheon.uf.common.comm.CommunicationException;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.uf.common.dataplugin.level.Level;
@ -1193,10 +1194,11 @@ public class Ncgrib1Decoder extends AbstractDecoder {
* The level two scale factor
* @param value2
* The level two value
* @throws GribException
*/
private void getLevelInfo(NcgribModel model, int centerID, int subcenterID,
float levelOneNumber, float scaleFactor1, float value1,
float levelTwoNumber, float scaleFactor2, float value2) {
float levelTwoNumber, float scaleFactor2, float value2) throws GribException {
String levelName = null;
String levelUnit = null;
double levelOneValue = Level.getInvalidLevelValue();
@ -1246,9 +1248,13 @@ public class Ncgrib1Decoder extends AbstractDecoder {
* -1));
}
}
try {
Level level = LevelFactory.getInstance().getLevel(levelName,
levelOneValue, levelTwoValue, levelUnit);
model.setLevel(level);
} catch (CommunicationException e) {
throw new GribException("Error loading level.", e);
}
}
/**