Merge "Omaha #3627 Delete or replace dead or deprecated methods and classes from com.raytheon.uf.edex.decodertools" into omaha_14.4.1

Former-commit-id: 21ad2f0d0229235495edc9319e8493d8a6b4d6b4
This commit is contained in:
Nate Jensen 2014-09-23 12:15:56 -05:00 committed by Gerrit Code Review
commit c9033dc300
3 changed files with 32 additions and 18 deletions

View file

@ -20,13 +20,14 @@
package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
import static com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder.getInt;
import static com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder.matchElement;
import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_3_LEAD;
import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_4_LEAD;
import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_5_LEAD;
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.VAL_ERROR;
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.VAL_MISSING;
import java.util.regex.Pattern;
import javax.measure.converter.UnitConverter;
import javax.measure.unit.SI;
@ -60,8 +61,8 @@ import com.raytheon.uf.edex.decodertools.core.ReportParser;
* 20071010 391 jkorman Initial coding.
* 20071203 410 jkorman JavaDoc complaints.
* 20080116 798 jkorman Changed logging levels.
* Sep 18, 2014 #3627 mapeters Convert units using {@UnitConverter},
* removed unused duration field.
* Sep 18, 2014 #3627 mapeters Convert units using {@link UnitConverter}, removed
* unused duration field, made patterns constant.
*
*
* </pre>
@ -71,6 +72,16 @@ import com.raytheon.uf.edex.decodertools.core.ReportParser;
*/
public class SynopticSec3Decoder extends AbstractSectionDecoder {
private static final Pattern P589 = Pattern.compile("5[89][0-9/]{3}");
private static final Pattern P907 = Pattern.compile("907\\d{2}");
private static final Pattern P910 = Pattern.compile("910\\d{2}");
private static final Pattern P911 = Pattern.compile("911\\d{2}");
private static final Pattern P912 = Pattern.compile("912\\d{2}");
/** The logger */
private Log logger = LogFactory.getLog(getClass());
@ -155,7 +166,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
closeGroup(3);
} else if ("4".equals(element.substring(0, 1)) && doGroup(4)) {
closeGroup(4);
} else if (matchElement(element, "5[89][0-9/]{3}")
} else if (P589.matcher(element).find()
&& doGroup(5)) {
int sign = 0;
if (element.charAt(1) == '8') {
@ -181,20 +192,20 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
// TODO :
// Group 8 doesn't get closed here, there may be more than
// one group.
} else if (matchElement(element, "907\\d{2}")) {
} else if (P907.matcher(element).find()) {
// TODO : Should something be done here?
} else if (matchElement(element, "910\\d{2}")) {
} else if (P910.matcher(element).find()) {
Integer temp = getInt(element, 3, 5);
if ((temp != null) && (temp >= 0)) {
windGust910 = temp * conversion;
}
} else if (matchElement(element, "911\\d{2}")) {
} else if (P911.matcher(element).find()) {
Integer temp = getInt(element, 3, 5);
if ((temp != null) && (temp >= 0)) {
windGust911 = temp * conversion;
}
} else if (matchElement(element, "912\\d{2}")) {
} else if (P912.matcher(element).find()) {
Integer temp = getInt(element, 3, 5);
if ((temp != null) && (temp >= 0)) {
windGust912 = temp * conversion;

View file

@ -34,7 +34,6 @@ import java.util.HashMap;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 20071226 384 jkorman Initial Coding.
* Sep 18, 2014 3627 mapeters Removed unused constructor.
* </pre>
*
* @author jkorman
@ -44,6 +43,14 @@ public class PlatformLocationProxy
{
private static HashMap<String,BasePoint> myLOCATIONS = new HashMap<String,BasePoint>();
/**
* This constructor exists solely to ensure this class isn't instantiated.
* Only the static methods should be used.
*/
private PlatformLocationProxy() {
// nothing
}
public static BasePoint lookup(String navaid,String [] aNetworkTypeList) {
BasePoint retValue = null;
if (myLOCATIONS == null) { // normal operation

View file

@ -37,7 +37,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.decodertools.time.TimeTools;
import com.raytheon.uf.edex.plugin.satellite.mcidas.util.McidasSatelliteLookups;
import com.raytheon.uf.edex.plugin.satellite.mcidas.util.McidasSatelliteLookups.PhysicalElementValue;
@ -71,8 +70,7 @@ import com.raytheon.uf.edex.plugin.satellite.mcidas.util.McidasSatelliteLookups.
* 09/24/2012 1210 jkorman Modified the decode method to create the
* IDataRecord required by the SatelliteDao
* 12/03/2013 DR 16841 D. Friedman Allow record overwrites
* 09/18/2014 3627 mapeters Updated deprecated {@link TimeTools} and
* {@link SatelliteRecord#constructDataURI()} usage.
* 09/18/2014 3627 mapeters Updated deprecated method calls.
* </pre>
*
* @author
@ -249,7 +247,6 @@ public class McidasSatelliteDecoder {
rec.setTraceId(traceId);
rec.setPersistenceTime(TimeUtil.newGmtCalendar().getTime());
rec.getDataURI();
rec.setOverwriteAllowed(true);
// Set the data into the IDataRecord
@ -306,7 +303,6 @@ public class McidasSatelliteDecoder {
double clon = flipLon(unpackDdmmss(nrmlLonDDMMSS), westPositive);
double clat = unpackDdmmss(stdLatDDMMSS);
double dx = spacingAtStdLatInMeters * xImgRes;
double dy = spacingAtStdLatInMeters * yImgRes;
double phi0r = clat * DTR;
double rxp = (((double) (elementOfEquator - ulX) / xImgRes) + 1.);
@ -326,10 +322,10 @@ public class McidasSatelliteDecoder {
la2 = (float) (((2. * Math.atan(arg)) - HALFPI) * RTD);
lo2 = (float) prnlon((clon + (((dx * dxp) / rcos) * RTD)));
lo2 = (float) prnlon(lo2);
result = SatSpatialFactory.getInstance().getMapCoverage(
SatSpatialFactory.PROJ_MERCATOR, nx, ny, (float) dx,
(float) dy, (float) clon, (float) clat, la1, lo1, la2, lo2);
result = SatSpatialFactory.getInstance().getCoverageTwoCorners(
SatSpatialFactory.PROJ_MERCATOR, nx, ny, (float) clon,
(float) clat, la1, lo1, la2, lo2);
} else {
unimplemented(String.format("navigation type \"%s\"", navType));
}