Omaha #3629 Move datatype specific code from edex.decodertools to the specific datatype edex plugins
Change-Id: I6b66103ef55107df78fdbb047dfb8c743deaf2d4 Former-commit-id: e196f02cf7533498280b252e9c345f9b3c4a3629
This commit is contained in:
parent
1656522716
commit
0c657c2a49
39 changed files with 225 additions and 248 deletions
|
@ -46,6 +46,7 @@ import com.raytheon.edex.exception.DecoderException;
|
|||
import com.raytheon.edex.plugin.AbstractDecoder;
|
||||
import com.raytheon.edex.plugin.binlightning.filter.LightningGeoFilter;
|
||||
import com.raytheon.edex.plugin.binlightning.impl.BinLightningFactory;
|
||||
import com.raytheon.edex.plugin.binlightning.impl.IBinDataSource;
|
||||
import com.raytheon.edex.plugin.binlightning.impl.IBinLightningDecoder;
|
||||
import com.raytheon.edex.plugin.binlightning.impl.LightningDataSource;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
|
@ -60,7 +61,6 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
import com.raytheon.uf.common.wmo.WMOHeader;
|
||||
import com.raytheon.uf.common.wmo.WMOTimeParser;
|
||||
import com.raytheon.uf.edex.decodertools.core.DecoderTools;
|
||||
import com.raytheon.uf.edex.decodertools.core.IBinDataSource;
|
||||
|
||||
/**
|
||||
* AWIPS decoder adapter strategy for binary lightning data.<br/>
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.List;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.impl.LightningStrikePoint;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.edex.decodertools.core.IBinDataSource;
|
||||
|
||||
/**
|
||||
* Provide the base class for the binary lightning decoders. This class
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.binlightning.impl;
|
||||
|
||||
import com.raytheon.uf.edex.decodertools.core.IBinDataSource;
|
||||
|
||||
import static com.raytheon.edex.plugin.binlightning.impl.IBinLightningDecoder.*;
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ import java.util.Calendar;
|
|||
import com.raytheon.uf.common.dataplugin.binlightning.impl.LightningStrikePoint;
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgMsgType;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.edex.decodertools.core.IBinDataSource;
|
||||
|
||||
/**
|
||||
* Decode one or more Flash lightning observations. Decode algorithm is taken
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.decodertools.core;
|
||||
package com.raytheon.edex.plugin.binlightning.impl;
|
||||
|
||||
/**
|
||||
* Implementations of this interface are adapters between some data source and
|
||||
|
@ -33,6 +33,7 @@ package com.raytheon.uf.edex.decodertools.core;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 27 July 2007 411 jkorman Initial Development
|
||||
* 20070912 379 jkorman Code review cleanup.
|
||||
* 26 Sep 2014 3629 mapeters Moved from uf.edex.decodertools.core.
|
||||
*
|
||||
* </pre>
|
||||
*
|
|
@ -21,7 +21,6 @@ package com.raytheon.edex.plugin.binlightning.impl;
|
|||
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
||||
import com.raytheon.uf.edex.decodertools.core.IBinDataSource;
|
||||
|
||||
/**
|
||||
* Wraps a ByteArrayInputStream with access methods specific to binary
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.Calendar;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.impl.LightningStrikePoint;
|
||||
import com.raytheon.uf.common.dataplugin.binlightning.impl.LtgMsgType;
|
||||
import com.raytheon.uf.edex.decodertools.core.IBinDataSource;
|
||||
|
||||
/**
|
||||
* Decode one or more Real Time Flash lightning observations. Decode algorithm
|
||||
|
|
|
@ -63,6 +63,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
|||
* added breaks/default to switch
|
||||
* Jul 23, 2014 3410 bclement location changed to floats
|
||||
* Sep 16, 2014 3628 mapeters Replaced static imports.
|
||||
* Sep 26, 2014 3629 mapeters Added PROFILER_DATA constant.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -74,6 +75,8 @@ public class ProfilerDataAdapter {
|
|||
private static final IUFStatusHandler logger = UFStatus
|
||||
.getHandler(ProfilerDataAdapter.class);
|
||||
|
||||
private static final int PROFILER_DATA = 3000;
|
||||
|
||||
private static final String PROFILER_SITES = "profilerSites.xml";
|
||||
|
||||
private static Profilers profilers = populateProfilerData();
|
||||
|
@ -191,7 +194,7 @@ public class ProfilerDataAdapter {
|
|||
if (dataList != null) {
|
||||
|
||||
obsData = new ProfilerObs();
|
||||
obsData.setReportType(IDecoderConstants.PROFILER_DATA);
|
||||
obsData.setReportType(PROFILER_DATA);
|
||||
SurfaceObsLocation location = new SurfaceObsLocation();
|
||||
|
||||
lat = getDouble(dataList.get(2), IDecoderConstants.VAL_MISSING);
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
|||
import com.raytheon.uf.common.pointdata.spatial.AircraftObsLocation;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.wmo.WMOHeader;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderInput;
|
||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||
|
||||
|
@ -58,6 +57,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
|
||||
* May 14, 2014 2536 bclement moved WMO Header to common, removed PLUGIN_NAME
|
||||
* Jul 23, 2014 3410 bclement location changed to floats
|
||||
* Sep 26, 2014 3629 mapeters Added RECCO_MANOBS, RECCO_INTEROBS constants.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -65,6 +65,10 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
*/
|
||||
public class RECCODecoder extends AbstractDecoder {
|
||||
|
||||
private static final int RECCO_MANOBS = 4500;
|
||||
|
||||
private static final int RECCO_INTEROBS = 4510;
|
||||
|
||||
private boolean removeNILs = true;
|
||||
|
||||
/**
|
||||
|
@ -154,11 +158,11 @@ public class RECCODecoder extends AbstractDecoder {
|
|||
record.setReportData(parser.getReportData());
|
||||
|
||||
if ("222".equals(parser.getObsType())) {
|
||||
record.setReportType(IDecoderConstants.RECCO_MANOBS);
|
||||
record.setReportType(RECCO_MANOBS);
|
||||
} else if ("555".equals(parser.getObsType())) {
|
||||
record.setReportType(IDecoderConstants.RECCO_INTEROBS);
|
||||
record.setReportType(RECCO_INTEROBS);
|
||||
} else if ("777".equals(parser.getObsType())) {
|
||||
record.setReportType(IDecoderConstants.RECCO_MANOBS);
|
||||
record.setReportType(RECCO_MANOBS);
|
||||
}
|
||||
|
||||
location.setLatitude(parser.getLatitude());
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.sfcobs;
|
||||
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.ETX;
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.SOM;
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.WMO_HEADER;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
|
@ -38,6 +34,7 @@ import com.raytheon.edex.plugin.sfcobs.common.SfcObsPart;
|
|||
import com.raytheon.edex.plugin.sfcobs.common.SfcObsSubMessage;
|
||||
import com.raytheon.uf.common.wmo.WMOHeader;
|
||||
import com.raytheon.uf.edex.decodertools.core.DecoderTools;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
|
||||
/**
|
||||
* The SfcObsSeparator takes a potential weather message and attempts to
|
||||
|
@ -58,6 +55,7 @@ import com.raytheon.uf.edex.decodertools.core.DecoderTools;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 20070925 391 jkorman Initial Coding.
|
||||
* May 14, 2014 2536 bclement moved WMO Header to common
|
||||
* Sep 26, 2014 3629 mapeters Added SOM constant, replaced static imports.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -67,7 +65,11 @@ public class SfcObsSeparator extends AbstractRecordSeparator {
|
|||
/** The logger */
|
||||
private Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private static final String SPLITCHARS = " \r=;$" + SOM + ETX;
|
||||
private static final String SOM = String
|
||||
.valueOf((char) IDecoderConstants.ASCII_SOM);
|
||||
|
||||
private static final String SPLITCHARS = " \r=;$" + SOM
|
||||
+ IDecoderConstants.ETX;
|
||||
|
||||
// private static final String GGYYiW_GRP =
|
||||
// "((0[1-9])|([1-2]\\d)|3[0-1])(([0-1]\\d)|2[0-3])[1-4]";
|
||||
|
@ -140,7 +142,7 @@ public class SfcObsSeparator extends AbstractRecordSeparator {
|
|||
wmoHeader = new WMOHeader(rawMessage, fileName);
|
||||
if (wmoHeader.isValid()) {
|
||||
messageData = DecoderTools.stripWMOHeader(rawMessage,
|
||||
WMO_HEADER);
|
||||
IDecoderConstants.WMO_HEADER);
|
||||
}
|
||||
}
|
||||
cleanGarbage();
|
||||
|
@ -204,7 +206,7 @@ public class SfcObsSeparator extends AbstractRecordSeparator {
|
|||
parts.add(SfcObsPart.RE_PART);
|
||||
} else if (SOM.equals(s)) {
|
||||
parts.add(SfcObsPart.MS_PART);
|
||||
} else if (ETX.equals(s)) {
|
||||
} else if (IDecoderConstants.ETX.equals(s)) {
|
||||
parts.add(SfcObsPart.ME_PART);
|
||||
} else {
|
||||
SfcObsPart reportPart = SfcObsPart.partFactory(s);
|
||||
|
|
|
@ -19,11 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.sfcobs.common;
|
||||
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.CARRIAGECONTROL;
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.MESSAGE_END;
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.MESSAGE_START;
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.REPORT_END;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -40,6 +35,7 @@ import java.util.Map;
|
|||
* ------------- -------- ----------- --------------------------
|
||||
* Sep 25, 2007 391 jkorman Initial Coding.
|
||||
* Oct 29, 2013 2489 bsteffen Add NAVTEX_END_PART
|
||||
* Sep 26, 2014 3629 mapeters Removed static imports.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -47,13 +43,15 @@ import java.util.Map;
|
|||
* @version 1.0
|
||||
*/
|
||||
public class SfcObsPart {
|
||||
public static final SfcObsPart CR_PART = new SfcObsPart(CARRIAGECONTROL,false);
|
||||
|
||||
public static final SfcObsPart RE_PART = new SfcObsPart(REPORT_END, false);
|
||||
public static final SfcObsPart CR_PART = new SfcObsPart("CARRIAGECONTROL",
|
||||
false);
|
||||
|
||||
public static final SfcObsPart MS_PART = new SfcObsPart(MESSAGE_START,false);
|
||||
public static final SfcObsPart RE_PART = new SfcObsPart("RPT_END", false);
|
||||
|
||||
public static final SfcObsPart ME_PART = new SfcObsPart(MESSAGE_END,false);
|
||||
public static final SfcObsPart MS_PART = new SfcObsPart("MSG_START", false);
|
||||
|
||||
public static final SfcObsPart ME_PART = new SfcObsPart("MSG_END", false);
|
||||
|
||||
public static final SfcObsPart AAXX_PART = new SfcObsPart("AAXX",false);
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import com.raytheon.uf.common.wmo.WMOHeader;
|
||||
import com.raytheon.uf.edex.decodertools.core.DefaultParserStrategy;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
|
||||
/**
|
||||
* AbstractSfcObsDecoder is the base class for all surface observation decoders.
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.decodertools.core;
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder;
|
||||
|
||||
/**
|
||||
* The DataItem class is used to hold intermediate information especially when
|
||||
|
@ -32,6 +32,7 @@ package com.raytheon.uf.edex.decodertools.core;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 20070925 391 jkorman Initial Coding.
|
||||
* Sep 18, 2014 3627 mapeters Removed unused methods/fields.
|
||||
* Sep 26, 2014 3629 mapeters Moved from uf.edex.decodertools.core.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.decodertools.core;
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -34,6 +34,7 @@ import java.util.StringTokenizer;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 20071019 391 jkorman Initial coding.
|
||||
* Sep 26, 2014 3629 mapeters Moved from uf.edex.decodertools.core.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -48,7 +49,7 @@ public class DefaultParserStrategy implements IParserStrategy {
|
|||
* @param dataToParse
|
||||
* The input string to parse.
|
||||
* @return A list of the parsed elements.
|
||||
* @see com.raytheon.uf.edex.decodertools.core.IParserStrategy#parse(java.lang.String)
|
||||
* @see com.raytheon.edex.plugin.sfcobs.decoder.IParserStrategy#parse(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<String> parse(String dataToParse) {
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.decodertools.core;
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -35,6 +35,7 @@ import java.util.List;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 20071019 391 jkorman Initial coding.
|
||||
* Sep 26, 2014 3629 mapeters Moved from uf.edex.decodertools.core.
|
||||
*
|
||||
* </pre>
|
||||
*
|
|
@ -40,6 +40,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 20070928 391 jkorman Initial Coding.
|
||||
* Sep 26, 2014 3629 mapeters Added SYNOPTIC_*, DRIFTING_BUOY constants.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -51,6 +52,16 @@ public interface ISfcObsDecoder {
|
|||
|
||||
public static final Integer VAL_MISSING = IDecoderConstants.VAL_MISSING;
|
||||
|
||||
public static final int SYNOPTIC_SHIP = 1003;
|
||||
|
||||
public static final int SYNOPTIC_CMAN = 1004;
|
||||
|
||||
public static final int SYNOPTIC_MOORED_BUOY = 1005;
|
||||
|
||||
public static final int DRIFTING_BUOY = 1006;
|
||||
|
||||
public static final int SYNOPTIC_MAROB = 1007;
|
||||
|
||||
/**
|
||||
* Get the text report data.
|
||||
*
|
||||
|
|
|
@ -17,12 +17,13 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.decodertools.core;
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
/**
|
||||
* A simple parser element factored from decoder report parsing. This class
|
||||
* wraps a list of elements parsed from a report.
|
||||
|
@ -36,6 +37,7 @@ import java.util.regex.Pattern;
|
|||
* 20071130 410 jkorman Changed bad copyright symbol.
|
||||
* 20071203 410 jkorman JavaDoc complaints.
|
||||
* Sep 18, 2014 3627 mapeters Removed unused methods.
|
||||
* Sep 26, 2014 3629 mapeters Moved from uf.edex.decodertools.core.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -60,7 +62,7 @@ public class ReportParser {
|
|||
* A parser strategy to be used when splitting the reportData. If
|
||||
* a null reference is passed, the an instance of
|
||||
* DefaultParserStrategy is used.
|
||||
* @see com.raytheon.uf.edex.decodertools.core.DefaultParserStrategy#parse(java.lang.String)
|
||||
* @see com.raytheon.edex.plugin.sfcobs.decoder.DefaultParserStrategy#parse(java.lang.String)
|
||||
*/
|
||||
public ReportParser(String reportData, IParserStrategy parser) {
|
||||
|
|
@ -19,8 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder;
|
||||
|
||||
import static com.raytheon.uf.edex.decodertools.core.IDecoderConstants.SPACE_CHAR;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -48,6 +46,7 @@ import com.raytheon.uf.common.wmo.WMOHeader;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 20070925 391 jkorman Initial Coding.
|
||||
* Sep 26, 2014 3629 mapeters Added SPACE_CHAR constant.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -57,6 +56,8 @@ public class SfcObsDecoderFactory {
|
|||
/** The logger */
|
||||
private static Log logger = LogFactory.getLog(SfcObsDecoderFactory.class);
|
||||
|
||||
private static final char SPACE_CHAR = ' ';
|
||||
|
||||
private static final Map<String, Class<? extends ISfcObsDecoder>> DECODER_MAP = new HashMap<String, Class<? extends ISfcObsDecoder>>();
|
||||
static {
|
||||
DECODER_MAP.put("AAXX", LandSynopticDecoder.class);
|
||||
|
|
|
@ -19,24 +19,19 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder.buoy;
|
||||
|
||||
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 com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.DataItem;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSectionDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSynopticDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.SynopticGroups;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.edex.decodertools.core.DataItem;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||
|
||||
/**
|
||||
|
@ -51,6 +46,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 20071010 391 jkorman Initial coding.
|
||||
* Sep 18, 2014 3627 mapeters Updated deprecated {@link TimeTools} usage.
|
||||
* Sep 26, 2014 3629 mapeters Replaced static imports.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -114,23 +110,27 @@ public class DRIBUSec1Decoder extends AbstractSectionDecoder {
|
|||
break;
|
||||
}
|
||||
|
||||
if (matchElement(element, DRIBUSec2Decoder.SEC_2_PATTERN)) {
|
||||
if (AbstractSfcObsDecoder.matchElement(element,
|
||||
DRIBUSec2Decoder.SEC_2_PATTERN)) {
|
||||
break;
|
||||
} else if (matchElement(element, SEC_3_LEAD)) {
|
||||
} else if (AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_3_LEAD)) {
|
||||
break;
|
||||
} else if (matchElement(element, SEC_4_LEAD)) {
|
||||
} else if (AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_4_LEAD)) {
|
||||
break;
|
||||
} else if (matchElement(element, SEC_5_LEAD)) {
|
||||
} else if (AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_5_LEAD)) {
|
||||
break;
|
||||
}
|
||||
|
||||
String s = element.substring(0, 1);
|
||||
if ("0".equals(s) && doGroup(0)) {
|
||||
Integer temp = getInt(element, 1, 3);
|
||||
Integer temp = AbstractSfcObsDecoder.getInt(element, 1, 3);
|
||||
if ((temp != null) && (temp >= 0)) {
|
||||
windDirection = temp * 10;
|
||||
}
|
||||
temp = getInt(element, 3, 5);
|
||||
temp = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
if ((temp != null) && (temp >= 0)) {
|
||||
windSpeed = temp.doubleValue();
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ public class DRIBUSec1Decoder extends AbstractSectionDecoder {
|
|||
element, 1);
|
||||
closeGroup(4);
|
||||
} else if ("5".equals(s) && doGroup(5)) {
|
||||
Integer val = getInt(element, 1, 2);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(element, 1, 2);
|
||||
changeCharacter = new DataItem("changeCharacter");
|
||||
changeCharacter.setDataValue(val.doubleValue());
|
||||
changeCharacter
|
||||
|
@ -189,10 +189,11 @@ public class DRIBUSec1Decoder extends AbstractSectionDecoder {
|
|||
* @return The populated receiver object.
|
||||
*/
|
||||
public ObsCommon getDecodedData(ObsCommon receiver) {
|
||||
final Double[] ignore = { VAL_ERROR.doubleValue(),
|
||||
VAL_MISSING.doubleValue() };
|
||||
|
||||
if (receiver != null) {
|
||||
final Double[] ignore = {
|
||||
IDecoderConstants.VAL_ERROR.doubleValue(),
|
||||
IDecoderConstants.VAL_MISSING.doubleValue() };
|
||||
|
||||
int iSubW = decoderParent.getISubw();
|
||||
double conversion = 1.0;
|
||||
|
|
|
@ -19,23 +19,18 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder.buoy;
|
||||
|
||||
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 com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.DataItem;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSectionDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSynopticDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.SynopticGroups;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.DataItem;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
|
||||
/**
|
||||
* Decode synoptic section 2 data. This section has a single group which
|
||||
|
@ -53,6 +48,7 @@ import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 20071010 391 jkorman Initial coding.
|
||||
* Sep 26, 2014 3629 mapeters Removed unused fields, replaced static imports.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -65,12 +61,6 @@ public class DRIBUSec2Decoder extends AbstractSectionDecoder {
|
|||
|
||||
private DataItem seaTemp = null;
|
||||
|
||||
// high resolution wave period (second)
|
||||
private Integer windWavePeriod_lo = null;
|
||||
|
||||
// low resolution wave period (1 meter)
|
||||
private Integer windWaveHeight_lo = null;
|
||||
|
||||
// high resolution wave period (1/10th second)
|
||||
private Integer windWavePeriod_hi = null;
|
||||
|
||||
|
@ -113,21 +103,22 @@ public class DRIBUSec2Decoder extends AbstractSectionDecoder {
|
|||
break;
|
||||
}
|
||||
|
||||
if (matchElement(element, SEC_3_LEAD)) {
|
||||
if (AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_3_LEAD)) {
|
||||
break;
|
||||
} else if (matchElement(element, SEC_4_LEAD)) {
|
||||
} else if (AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_4_LEAD)) {
|
||||
break;
|
||||
} else if (matchElement(element, SEC_5_LEAD)) {
|
||||
} else if (AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_5_LEAD)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ("0".equals(element.substring(0, 1))) {
|
||||
seaTemp = SynopticGroups.decodeTemperature(element, 2);
|
||||
} else if ("1".equals(element.substring(0, 1))) {
|
||||
windWavePeriod_lo = getInt(element, 1, 3);
|
||||
windWaveHeight_lo = getInt(element, 3, 5);
|
||||
} else if ("20".equals(element.substring(0, 2))) {
|
||||
windWavePeriod_hi = getInt(element, 1, 3);
|
||||
windWavePeriod_hi = AbstractSfcObsDecoder.getInt(element,
|
||||
1, 3);
|
||||
if ((windWavePeriod_hi != null) && (windWavePeriod_hi >= 0)) {
|
||||
// TODO : For now the finest granularity in time is one
|
||||
// second,
|
||||
|
@ -137,7 +128,8 @@ public class DRIBUSec2Decoder extends AbstractSectionDecoder {
|
|||
.round(windWavePeriod_hi / 10.0);
|
||||
}
|
||||
} else if ("21".equals(element.substring(0, 2))) {
|
||||
windWaveHeight_hi = getInt(element, 3, 5);
|
||||
windWaveHeight_hi = AbstractSfcObsDecoder.getInt(element,
|
||||
3, 5);
|
||||
}
|
||||
} // while
|
||||
}
|
||||
|
@ -149,8 +141,6 @@ public class DRIBUSec2Decoder extends AbstractSectionDecoder {
|
|||
*/
|
||||
private void init() {
|
||||
seaTemp = null;
|
||||
windWavePeriod_lo = null;
|
||||
windWaveHeight_lo = null;
|
||||
windWavePeriod_hi = null;
|
||||
windWaveHeight_hi = null;
|
||||
}
|
||||
|
@ -163,10 +153,11 @@ public class DRIBUSec2Decoder extends AbstractSectionDecoder {
|
|||
* @return The populated receiver object.
|
||||
*/
|
||||
public ObsCommon getDecodedData(ObsCommon receiver) {
|
||||
final Double[] ignore = { VAL_ERROR.doubleValue(),
|
||||
VAL_MISSING.doubleValue() };
|
||||
|
||||
if (receiver != null) {
|
||||
final Double[] ignore = {
|
||||
IDecoderConstants.VAL_ERROR.doubleValue(),
|
||||
IDecoderConstants.VAL_MISSING.doubleValue() };
|
||||
receiver.setSeaTemp(DataItem.getValue(seaTemp, ignore));
|
||||
|
||||
if ((windWavePeriod_hi != null) || (windWaveHeight_hi != null)) {
|
||||
|
|
|
@ -25,10 +25,10 @@ import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_4_L
|
|||
import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_5_LEAD;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSectionDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSynopticDecoder;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
|
||||
/**
|
||||
* Decode the Drifting buoy section 3 data. The current decoders skip Buoy
|
||||
|
|
|
@ -25,10 +25,10 @@ import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_4_L
|
|||
import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_5_LEAD;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSectionDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSynopticDecoder;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
|
||||
/**
|
||||
* Decode synoptic section 4 data. This section has a single group which
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
package com.raytheon.edex.plugin.sfcobs.decoder.buoy;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSectionDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSynopticDecoder;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
|
||||
/**
|
||||
* Decode buoy section 5 data. Section 5 data is specific to various regions in
|
||||
|
|
|
@ -24,7 +24,6 @@ import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSynopticDecoder;
|
|||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
|
||||
/**
|
||||
* Decode the FM-18 Buoy observation data.
|
||||
|
@ -124,7 +123,7 @@ public class DRIBUSynopticDecoder extends AbstractSynopticDecoder {
|
|||
}
|
||||
report = (ObsCommon) super.consolidateReport();
|
||||
if (report != null) {
|
||||
report.setReportType(IDecoderConstants.DRIFTING_BUOY);
|
||||
report.setReportType(DRIFTING_BUOY);
|
||||
|
||||
SurfaceObsLocation loc = new SurfaceObsLocation(
|
||||
getReportIdentifier());
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -29,7 +29,6 @@ import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
|||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
|
||||
|
||||
/**
|
||||
|
@ -167,7 +166,7 @@ public class CMANSynopticDecoder extends LandSynopticDecoder {
|
|||
if (report != null) {
|
||||
// If we didn't find this report in the catalog then don't store it.
|
||||
if ((stationInfo != null)) {
|
||||
report.setReportType(IDecoderConstants.SYNOPTIC_CMAN);
|
||||
report.setReportType(SYNOPTIC_CMAN);
|
||||
// Land synoptic needs to add the Fixed Land report
|
||||
SurfaceObsLocation loc = new SurfaceObsLocation(
|
||||
getReportIdentifier());
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.apache.commons.logging.LogFactory;
|
|||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
|
||||
/**
|
||||
* Decode the MAROB (Marine Observation) data. This format is very similar to
|
||||
|
@ -129,7 +128,7 @@ public class MAROBSynopticDecoder extends SHIPSynopticDecoder {
|
|||
ObsCommon report = (ObsCommon) super.consolidateReport();
|
||||
// Need to override the reportType.
|
||||
if (report != null) {
|
||||
report.setReportType(IDecoderConstants.SYNOPTIC_MAROB);
|
||||
report.setReportType(SYNOPTIC_MAROB);
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
|||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.decodertools.core.DecoderTools;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
|
||||
|
||||
/**
|
||||
|
@ -198,9 +197,9 @@ public class SHIPSynopticDecoder extends AbstractSynopticDecoder {
|
|||
if (report != null) {
|
||||
|
||||
if (isFixedBuoy) {
|
||||
report.setReportType(IDecoderConstants.SYNOPTIC_MOORED_BUOY);
|
||||
report.setReportType(SYNOPTIC_MOORED_BUOY);
|
||||
} else {
|
||||
report.setReportType(IDecoderConstants.SYNOPTIC_SHIP);
|
||||
report.setReportType(SYNOPTIC_SHIP);
|
||||
}
|
||||
|
||||
SurfaceObsLocation loc = new SurfaceObsLocation(
|
||||
|
|
|
@ -19,14 +19,12 @@
|
|||
**/
|
||||
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 javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.DataItem;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.edex.decodertools.core.DataItem;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
|
||||
/**
|
||||
|
@ -55,6 +53,7 @@ import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
|||
* 20070925 391 jkorman Initial Coding.
|
||||
* 20071109 391 jkorman Factored out time constants.
|
||||
* Sep 18, 2014 #3627 mapeters Convert units using {@link UnitConverter}.
|
||||
* Sep 26, 2014 #3629 mapeters Replaced static imports.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -89,7 +88,7 @@ public class SynopticGroups {
|
|||
int lookingForSect) {
|
||||
DataItem decodedItem = null;
|
||||
|
||||
if (matchElement(groupData, "2\\d{4}")) {
|
||||
if (AbstractSfcObsDecoder.matchElement(groupData, "2\\d{4}")) {
|
||||
Integer val = Integer.parseInt(groupData.substring(2, 5));
|
||||
if ((val != null) && (val >= 0)) {
|
||||
if (lookingForSect == 1) {
|
||||
|
@ -126,7 +125,7 @@ public class SynopticGroups {
|
|||
if ("///".equals(s)) {
|
||||
return decodedItem;
|
||||
}
|
||||
Integer val = getInt(groupData, 2, 5);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 2, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
String dataItemName = null;
|
||||
int sign = 0;
|
||||
|
@ -205,7 +204,7 @@ public class SynopticGroups {
|
|||
if ((groupData != null) && (groupData.length() == 5)) {
|
||||
if ((groupData.charAt(0) == '3') && (lookingForSect == 1)) {
|
||||
|
||||
Integer val = getInt(groupData, 1, 5);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 1, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem = new DataItem("stationPressure");
|
||||
// RULE : If the value is between 0 and 100, assume the
|
||||
|
@ -239,7 +238,7 @@ public class SynopticGroups {
|
|||
if ((groupData != null) && (groupData.length() == 5)) {
|
||||
if ((groupData.charAt(0) == '4') && (lookingForSect == 1)) {
|
||||
|
||||
Integer val = getInt(groupData, 1, 5);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 1, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem = new DataItem("seaLevelPressure");
|
||||
// RULE : If the value is between 0 and 100, assume the
|
||||
|
@ -273,7 +272,7 @@ public class SynopticGroups {
|
|||
if ((groupData != null) && (groupData.length() == 5)) {
|
||||
if ((groupData.charAt(0) == '5') && (lookingForSect == 1)) {
|
||||
|
||||
Integer val = getInt(groupData, 2, 5);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 2, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem = new DataItem("3HRChange");
|
||||
decodedItem.setDataValue(hPaToPa.convert(val));
|
||||
|
@ -300,7 +299,7 @@ public class SynopticGroups {
|
|||
if ((groupData != null) && (groupData.length() == 5)) {
|
||||
if ((groupData.charAt(0) == '6')) {
|
||||
if ((lookingForSect == 1) || (lookingForSect == 3)) {
|
||||
Integer val = getInt(groupData, 1, 4);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 1, 4);
|
||||
if (val != null) {
|
||||
decodedItem = new DataItem("precip");
|
||||
if ((val >= 0) && (val < 990)) {
|
||||
|
@ -310,7 +309,7 @@ public class SynopticGroups {
|
|||
decodedItem.setDataValue(value);
|
||||
}
|
||||
|
||||
val = getInt(groupData, 4, 5);
|
||||
val = AbstractSfcObsDecoder.getInt(groupData, 4, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem.setDataPeriod(precipHours[val]
|
||||
* TimeUtil.SECONDS_PER_HOUR);
|
||||
|
@ -319,7 +318,7 @@ public class SynopticGroups {
|
|||
}
|
||||
} else if ((groupData.charAt(0) == '7') && (lookingForSect == 3)) {
|
||||
|
||||
Integer val = getInt(groupData, 1, 5);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 1, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem = new DataItem("precip");
|
||||
if (val > 9998) {
|
||||
|
@ -329,7 +328,7 @@ public class SynopticGroups {
|
|||
decodedItem.setDataPeriod(TimeUtil.SECONDS_PER_DAY);
|
||||
}
|
||||
} else if ((groupData.charAt(0) == '2') && (lookingForSect == 5)) {
|
||||
Integer val = getInt(groupData, 1, 5);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(groupData, 1, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedItem = new DataItem("cityPrecip");
|
||||
if (!IDecoderConstants.VAL_MISSING.equals(val)) {
|
||||
|
|
|
@ -19,24 +19,16 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
|
||||
|
||||
import static com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder.checkRange;
|
||||
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_2_LEAD;
|
||||
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.Calendar;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.DataItem;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.AncPrecip;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.edex.decodertools.core.DataItem;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||
|
||||
/**
|
||||
|
@ -55,6 +47,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* the correct day of month.
|
||||
* Sep 18, 2014 #3627 mapeters Updated deprecated {@link TimeTools} usage,
|
||||
* removed unused lowCloudAmount field.
|
||||
* Sep 26, 2014 #3629 mapeters Replaced static imports.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -151,24 +144,27 @@ public class SynopticSec1Decoder extends AbstractSectionDecoder {
|
|||
break;
|
||||
}
|
||||
if (!irix && !winds
|
||||
&& matchElement(element, ISynoptic.SEC_1_IRIXHVV)) {
|
||||
&& AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_1_IRIXHVV)) {
|
||||
// iSubR = getInt(element, 0, 1);
|
||||
getInt(element, 0, 1);
|
||||
AbstractSfcObsDecoder.getInt(element, 0, 1);
|
||||
|
||||
// iSubX = getInt(element, 1, 2);
|
||||
getInt(element, 1, 2);
|
||||
AbstractSfcObsDecoder.getInt(element, 1, 2);
|
||||
|
||||
loCloudHeight = getInt(element, 2, 3);
|
||||
visibility = getInt(element, 3, 5);
|
||||
loCloudHeight = AbstractSfcObsDecoder.getInt(element, 2, 3);
|
||||
visibility = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
irix = true;
|
||||
continue;
|
||||
} else if (!winds && matchElement(element, ISynoptic.SEC_1_NDDFF)) {
|
||||
totalCloud = getInt(element, 0, 1);
|
||||
Integer temp = getInt(element, 1, 3);
|
||||
} else if (!winds
|
||||
&& AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_1_NDDFF)) {
|
||||
totalCloud = AbstractSfcObsDecoder.getInt(element, 0, 1);
|
||||
Integer temp = AbstractSfcObsDecoder.getInt(element, 1, 3);
|
||||
if ((temp != null) && (temp >= 0)) {
|
||||
windDirection = temp * 10;
|
||||
}
|
||||
temp = getInt(element, 3, 5);
|
||||
temp = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
if ((temp != null) && (temp >= 0)) {
|
||||
windSpeed = temp.doubleValue();
|
||||
}
|
||||
|
@ -179,7 +175,8 @@ public class SynopticSec1Decoder extends AbstractSectionDecoder {
|
|||
}
|
||||
element = reportParser.getElement();
|
||||
if ("00".equals(element.substring(0, 2))) {
|
||||
windSpeed = getInt(element, 2, 5).doubleValue();
|
||||
windSpeed = AbstractSfcObsDecoder.getInt(element, 2, 5)
|
||||
.doubleValue();
|
||||
winds = true;
|
||||
} else {
|
||||
// TODO : Need to indicate an error here!
|
||||
|
@ -188,13 +185,15 @@ public class SynopticSec1Decoder extends AbstractSectionDecoder {
|
|||
winds = true;
|
||||
}
|
||||
continue;
|
||||
} else if (winds && matchElement(element, SEC_2_LEAD)) {
|
||||
} else if (winds
|
||||
&& AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_2_LEAD)) {
|
||||
break;
|
||||
} else if (SEC_3_LEAD.equals(element)) {
|
||||
} else if (ISynoptic.SEC_3_LEAD.equals(element)) {
|
||||
break;
|
||||
} else if (SEC_4_LEAD.equals(element)) {
|
||||
} else if (ISynoptic.SEC_4_LEAD.equals(element)) {
|
||||
break;
|
||||
} else if (SEC_5_LEAD.equals(element)) {
|
||||
} else if (ISynoptic.SEC_5_LEAD.equals(element)) {
|
||||
break;
|
||||
} else if ("80000".equals(element)) {
|
||||
break;
|
||||
|
@ -232,7 +231,7 @@ public class SynopticSec1Decoder extends AbstractSectionDecoder {
|
|||
closeGroup(4);
|
||||
winds = true;
|
||||
} else if ("5".equals(element.substring(0, 1)) && doGroup(5)) {
|
||||
Integer val = getInt(element, 1, 2);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(element, 1, 2);
|
||||
changeCharacter = new DataItem("changeCharacter");
|
||||
changeCharacter.setDataValue(val.doubleValue());
|
||||
changeCharacter.setDataPeriod(3 * 3600);
|
||||
|
@ -246,29 +245,34 @@ public class SynopticSec1Decoder extends AbstractSectionDecoder {
|
|||
winds = true;
|
||||
} else if ("7".equals(element.substring(0, 1)) && doGroup(7)) {
|
||||
// TODO :
|
||||
presentWeather = getInt(element, 1, 3);
|
||||
pastWeather1 = getInt(element, 3, 4);
|
||||
pastWeather2 = getInt(element, 4, 5);
|
||||
presentWeather = AbstractSfcObsDecoder.getInt(element, 1, 3);
|
||||
pastWeather1 = AbstractSfcObsDecoder.getInt(element, 3, 4);
|
||||
pastWeather2 = AbstractSfcObsDecoder.getInt(element, 4, 5);
|
||||
|
||||
closeGroup(7);
|
||||
winds = true;
|
||||
} else if ("8".equals(element.substring(0, 1)) && doGroup(8)) {
|
||||
if (!winds && matchElement(element, "8[/0-9]{4}")) {
|
||||
if ((lowCloudType = getInt(element, 2, 3)) < 0) {
|
||||
if (!winds
|
||||
&& AbstractSfcObsDecoder.matchElement(element,
|
||||
"8[/0-9]{4}")) {
|
||||
if ((lowCloudType = AbstractSfcObsDecoder.getInt(element,
|
||||
2, 3)) < 0) {
|
||||
lowCloudType = null;
|
||||
}
|
||||
if ((midCloudType = getInt(element, 3, 4)) < 0) {
|
||||
if ((midCloudType = AbstractSfcObsDecoder.getInt(element,
|
||||
3, 4)) < 0) {
|
||||
midCloudType = null;
|
||||
}
|
||||
if ((hiCloudType = getInt(element, 4, 5)) < 0) {
|
||||
if ((hiCloudType = AbstractSfcObsDecoder.getInt(element, 4,
|
||||
5)) < 0) {
|
||||
hiCloudType = null;
|
||||
}
|
||||
closeGroup(8);
|
||||
}
|
||||
winds = true;
|
||||
} else if ("9".equals(element.substring(0, 1)) && doGroup(9)) {
|
||||
obsTimeHour = getInt(element, 1, 3);
|
||||
obsTimeMinute = getInt(element, 3, 5);
|
||||
obsTimeHour = AbstractSfcObsDecoder.getInt(element, 1, 3);
|
||||
obsTimeMinute = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
break;
|
||||
}
|
||||
} // while()
|
||||
|
@ -282,8 +286,8 @@ public class SynopticSec1Decoder extends AbstractSectionDecoder {
|
|||
* @return The populated receiver object.
|
||||
*/
|
||||
public ObsCommon getDecodedData(ObsCommon receiver) {
|
||||
final Double[] ignore = { VAL_ERROR.doubleValue(),
|
||||
VAL_MISSING.doubleValue() };
|
||||
final Double[] ignore = { IDecoderConstants.VAL_ERROR.doubleValue(),
|
||||
IDecoderConstants.VAL_MISSING.doubleValue() };
|
||||
|
||||
// Check to see if we need to convert knots to mps.
|
||||
int iSubW = decoderParent.getISubw();
|
||||
|
@ -359,8 +363,8 @@ public class SynopticSec1Decoder extends AbstractSectionDecoder {
|
|||
|
||||
// Do we need to override the observation time
|
||||
if ((obsTimeHour != null) && (obsTimeMinute != null)) {
|
||||
if (checkRange(0, obsTimeHour, 23)
|
||||
&& checkRange(0, obsTimeMinute, 59)) {
|
||||
if (AbstractSfcObsDecoder.checkRange(0, obsTimeHour, 23)
|
||||
&& AbstractSfcObsDecoder.checkRange(0, obsTimeMinute, 59)) {
|
||||
Calendar obsT = receiver.getTimeObs();
|
||||
|
||||
Integer month = getParent().getHeader().getMonth();
|
||||
|
|
|
@ -19,20 +19,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.synoptic.ISynoptic.SEC_2_LEAD;
|
||||
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 com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.DataItem;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.DataItem;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
|
||||
/**
|
||||
* Decode synoptic section 2 data. This section has a single group which
|
||||
|
@ -46,7 +40,8 @@ import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 20071010 391 jkorman Initial coding.
|
||||
* 20071109 391 jkorman Added guard for short data.
|
||||
* 2013/8 757 T. Lee Checked missing wave height from ship report
|
||||
* 2013/8 757 T. Lee Checked missing wave height from ship report
|
||||
* Sep 26, 2014 3629 mapeters Replaced static imports.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -113,7 +108,7 @@ public class SynopticSec2Decoder extends AbstractSectionDecoder {
|
|||
* Thrown when an relevant error has occurred.
|
||||
*/
|
||||
public void decode(ReportParser reportParser) throws DecoderException {
|
||||
Pattern pattern = Pattern.compile(SEC_2_LEAD);
|
||||
Pattern pattern = Pattern.compile(ISynoptic.SEC_2_LEAD);
|
||||
init();
|
||||
if (reportParser == null) {
|
||||
// nothing to do.
|
||||
|
@ -122,8 +117,8 @@ public class SynopticSec2Decoder extends AbstractSectionDecoder {
|
|||
if (reportParser.positionTo(pattern)) {
|
||||
String element = reportParser.getElement();
|
||||
// need to decode the Ds vs data
|
||||
shipDirection = getInt(element, 3, 4);
|
||||
shipSpeed = getInt(element, 4, 5);
|
||||
shipDirection = AbstractSfcObsDecoder.getInt(element, 3, 4);
|
||||
shipSpeed = AbstractSfcObsDecoder.getInt(element, 4, 5);
|
||||
while (true) {
|
||||
// if we run out of data, exit.
|
||||
if (reportParser.next()) {
|
||||
|
@ -134,11 +129,11 @@ public class SynopticSec2Decoder extends AbstractSectionDecoder {
|
|||
break;
|
||||
}
|
||||
|
||||
if (SEC_3_LEAD.equals(element)) {
|
||||
if (ISynoptic.SEC_3_LEAD.equals(element)) {
|
||||
break;
|
||||
} else if (SEC_4_LEAD.equals(element)) {
|
||||
} else if (ISynoptic.SEC_4_LEAD.equals(element)) {
|
||||
break;
|
||||
} else if (SEC_5_LEAD.equals(element)) {
|
||||
} else if (ISynoptic.SEC_5_LEAD.equals(element)) {
|
||||
break;
|
||||
} else if ("80000".equals(element)) {
|
||||
break;
|
||||
|
@ -165,30 +160,36 @@ public class SynopticSec2Decoder extends AbstractSectionDecoder {
|
|||
seaTemp = SynopticGroups.decodeTemperature(element, 2);
|
||||
closeGroup(1);
|
||||
} else if (doGroup(1) && "1".equals(element.substring(0, 1))) {
|
||||
wavePeriod = getInt(element, 1, 3);
|
||||
waveHeight = getInt(element, 3, 5);
|
||||
wavePeriod = AbstractSfcObsDecoder.getInt(element, 1, 3);
|
||||
waveHeight = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
closeGroup(1);
|
||||
} else if (doGroup(2) && "2".equals(element.substring(0, 1))) {
|
||||
windWavePeriod = getInt(element, 1, 3);
|
||||
windWaveHeight = getInt(element, 3, 5);
|
||||
windWavePeriod = AbstractSfcObsDecoder
|
||||
.getInt(element, 1, 3);
|
||||
windWaveHeight = AbstractSfcObsDecoder
|
||||
.getInt(element, 3, 5);
|
||||
closeGroup(2);
|
||||
} else if (doGroup(3) && "3".equals(element.substring(0, 1))) {
|
||||
swellWave1Dir = getInt(element, 1, 3);
|
||||
swellWave2Dir = getInt(element, 3, 5);
|
||||
swellWave1Dir = AbstractSfcObsDecoder.getInt(element, 1, 3);
|
||||
swellWave2Dir = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
closeGroup(3);
|
||||
} else if (doGroup(4) && "4".equals(element.substring(0, 1))) {
|
||||
swellWave1Period = getInt(element, 1, 3);
|
||||
swellWave1Height = getInt(element, 3, 5);
|
||||
swellWave1Period = AbstractSfcObsDecoder.getInt(element, 1,
|
||||
3);
|
||||
swellWave1Height = AbstractSfcObsDecoder.getInt(element, 3,
|
||||
5);
|
||||
closeGroup(4);
|
||||
} else if (doGroup(5) && "5".equals(element.substring(0, 1))) {
|
||||
swellWave2Period = getInt(element, 1, 3);
|
||||
swellWave2Height = getInt(element, 3, 5);
|
||||
swellWave2Period = AbstractSfcObsDecoder.getInt(element, 1,
|
||||
3);
|
||||
swellWave2Height = AbstractSfcObsDecoder.getInt(element, 3,
|
||||
5);
|
||||
closeGroup(5);
|
||||
} else if (doGroup(6) && "6".equals(element.substring(0, 1))) {
|
||||
// TODO :
|
||||
closeGroup(6);
|
||||
} else if (doGroup(7) && "70".equals(element.substring(0, 2))) {
|
||||
heightOfWaves = getInt(element, 2, 5);
|
||||
heightOfWaves = AbstractSfcObsDecoder.getInt(element, 2, 5);
|
||||
closeGroup(7);
|
||||
} else if (doGroup(8) && "8".equals(element.substring(0, 1))) {
|
||||
wetBulb = SynopticGroups.decodeTemperature(element, 2);
|
||||
|
@ -227,10 +228,12 @@ public class SynopticSec2Decoder extends AbstractSectionDecoder {
|
|||
* @return The populated receiver object.
|
||||
*/
|
||||
public ObsCommon getDecodedData(ObsCommon receiver) {
|
||||
final Double[] ignore = { VAL_ERROR.doubleValue(),
|
||||
VAL_MISSING.doubleValue() };
|
||||
|
||||
if (receiver != null) {
|
||||
final Double[] ignore = {
|
||||
IDecoderConstants.VAL_ERROR.doubleValue(),
|
||||
IDecoderConstants.VAL_MISSING.doubleValue() };
|
||||
|
||||
receiver.setShipIceData(iceCode);
|
||||
receiver.setSeaTemp(DataItem.getValue(seaTemp, ignore));
|
||||
receiver.setWetBulb(DataItem.getValue(wetBulb, ignore));
|
||||
|
|
|
@ -19,13 +19,6 @@
|
|||
**/
|
||||
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.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;
|
||||
|
@ -35,13 +28,15 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.DataItem;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.AncPrecip;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.AncPressure;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.AncTemp;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.edex.decodertools.core.DataItem;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
import com.raytheon.uf.edex.decodertools.core.IDecoderConstants;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -63,6 +58,7 @@ import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
|||
* 20080116 798 jkorman Changed logging levels.
|
||||
* Sep 18, 2014 #3627 mapeters Convert units using {@link UnitConverter}, removed
|
||||
* unused duration field, made patterns constant.
|
||||
* Sep 26, 2014 #3629 mapeters Replaced static imports.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -133,7 +129,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
return;
|
||||
}
|
||||
String element = null;
|
||||
if (reportParser.positionTo(SEC_3_LEAD)) {
|
||||
if (reportParser.positionTo(ISynoptic.SEC_3_LEAD)) {
|
||||
while (true) {
|
||||
// if we run out of data, exit.
|
||||
if (reportParser.next()) {
|
||||
|
@ -143,9 +139,9 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
} else {
|
||||
break;
|
||||
}
|
||||
if (SEC_4_LEAD.equals(element)) {
|
||||
if (ISynoptic.SEC_4_LEAD.equals(element)) {
|
||||
break;
|
||||
} else if (SEC_5_LEAD.equals(element)) {
|
||||
} else if (ISynoptic.SEC_5_LEAD.equals(element)) {
|
||||
break;
|
||||
} else if ("80000".equals(element)) {
|
||||
break;
|
||||
|
@ -174,7 +170,7 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
} else if (element.charAt(1) == '9') {
|
||||
sign = -1;
|
||||
}
|
||||
Integer val = getInt(element, 2, 5);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(element, 2, 5);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
pressure24 = new DataItem("24HRChange");
|
||||
pressure24.setDataValue(hPaToPa.convert(val
|
||||
|
@ -195,18 +191,18 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
} else if (P907.matcher(element).find()) {
|
||||
// TODO : Should something be done here?
|
||||
} else if (P910.matcher(element).find()) {
|
||||
Integer temp = getInt(element, 3, 5);
|
||||
Integer temp = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
if ((temp != null) && (temp >= 0)) {
|
||||
windGust910 = temp * conversion;
|
||||
}
|
||||
} else if (P911.matcher(element).find()) {
|
||||
Integer temp = getInt(element, 3, 5);
|
||||
Integer temp = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
if ((temp != null) && (temp >= 0)) {
|
||||
|
||||
windGust911 = temp * conversion;
|
||||
}
|
||||
} else if (P912.matcher(element).find()) {
|
||||
Integer temp = getInt(element, 3, 5);
|
||||
Integer temp = AbstractSfcObsDecoder.getInt(element, 3, 5);
|
||||
if ((temp != null) && (temp >= 0)) {
|
||||
windGust912 = temp * conversion;
|
||||
;
|
||||
|
@ -226,8 +222,6 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
* @return The populated receiver object.
|
||||
*/
|
||||
public ObsCommon getDecodedData(ObsCommon receiver) {
|
||||
final Double[] ignore = { VAL_ERROR.doubleValue(),
|
||||
VAL_MISSING.doubleValue() };
|
||||
|
||||
if (maxTemperature != null) {
|
||||
AncTemp temp = new AncTemp();
|
||||
|
@ -266,6 +260,9 @@ public class SynopticSec3Decoder extends AbstractSectionDecoder {
|
|||
}
|
||||
}
|
||||
if (pressure24 != null) {
|
||||
final Double[] ignore = {
|
||||
IDecoderConstants.VAL_ERROR.doubleValue(),
|
||||
IDecoderConstants.VAL_MISSING.doubleValue() };
|
||||
Double v = DataItem.getValue(pressure24, ignore);
|
||||
if ((v != null) && (v >= -9999)) {
|
||||
AncPressure press = new AncPressure();
|
||||
|
|
|
@ -25,9 +25,9 @@ import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.GENERAL
|
|||
import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_4_LEAD;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.AncCloud;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
|
||||
/**
|
||||
* Decode synoptic section 4 data. This section has a single group which
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
package com.raytheon.edex.plugin.sfcobs.decoder.synoptic;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
|
||||
/**
|
||||
* Decode synoptic section 5 data. Section 5 data is specific to various regions
|
||||
|
|
|
@ -19,25 +19,21 @@
|
|||
**/
|
||||
package com.raytheon.edex.plugin.sfcobs.decoder.synoptic.regional;
|
||||
|
||||
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_5_72_CMAXMIN;
|
||||
import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_5_72_CTEMP;
|
||||
import static com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic.SEC_5_LEAD;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.NonSI;
|
||||
import javax.measure.unit.SI;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.AbstractSfcObsDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.DataItem;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSynopticDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.ISynoptic;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.SynopticGroups;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.SynopticSec5Decoder;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.AncPrecip;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.AncTemp;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.edex.decodertools.core.DataItem;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
|
||||
/**
|
||||
* Decode synoptic section 5 regional data for WMO block 72 (United States)
|
||||
|
@ -50,6 +46,7 @@ import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 20071010 391 jkorman Initial coding.
|
||||
* Sep 18, 2014 #3627 mapeters Convert units using {@link UnitConverter}.
|
||||
* Sep 26, 2014 #3629 mapeters Replaced static imports.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -101,7 +98,7 @@ public class Sec5Block72Decoder extends SynopticSec5Decoder {
|
|||
// nothing to do.
|
||||
return;
|
||||
}
|
||||
if (reportParser.positionTo(SEC_5_LEAD)) {
|
||||
if (reportParser.positionTo(ISynoptic.SEC_5_LEAD)) {
|
||||
String element = null;
|
||||
|
||||
while (true) {
|
||||
|
@ -114,7 +111,8 @@ public class Sec5Block72Decoder extends SynopticSec5Decoder {
|
|||
break;
|
||||
}
|
||||
if (isBlock72Data) {
|
||||
if (matchElement(element, SEC_5_72_CTEMP)) {
|
||||
if (AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_5_72_CTEMP)) {
|
||||
// City temperature.
|
||||
Double val = decodeFahrenheit(element.substring(1, 4));
|
||||
if (val != null) {
|
||||
|
@ -122,7 +120,8 @@ public class Sec5Block72Decoder extends SynopticSec5Decoder {
|
|||
cityTemperature.setDataValue(val);
|
||||
cityTemperature.setDataPeriod(0);
|
||||
}
|
||||
} else if (matchElement(element, SEC_5_72_CMAXMIN)) {
|
||||
} else if (AbstractSfcObsDecoder.matchElement(element,
|
||||
ISynoptic.SEC_5_72_CMAXMIN)) {
|
||||
// City maximum/minimum temperature.
|
||||
Double val = decodeFahrenheit(element.substring(0, 3));
|
||||
if (val != null) {
|
||||
|
@ -225,7 +224,7 @@ public class Sec5Block72Decoder extends SynopticSec5Decoder {
|
|||
private static final Double decodeFahrenheit(String element) {
|
||||
Double decodedValue = null;
|
||||
int sign = SynopticGroups.getSign(element.charAt(0));
|
||||
Integer val = getInt(element, 1, 3);
|
||||
Integer val = AbstractSfcObsDecoder.getInt(element, 1, 3);
|
||||
if ((val != null) && (val >= 0)) {
|
||||
decodedValue = fToK.convert((double) val * sign);
|
||||
} else {
|
||||
|
|
|
@ -31,12 +31,12 @@ import javax.measure.unit.NonSI;
|
|||
import javax.measure.unit.SI;
|
||||
|
||||
import com.raytheon.edex.exception.DecoderException;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.ReportParser;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.AbstractSynopticDecoder;
|
||||
import com.raytheon.edex.plugin.sfcobs.decoder.synoptic.SynopticSec5Decoder;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.InterWinds;
|
||||
import com.raytheon.uf.common.dataplugin.sfcobs.ObsCommon;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.edex.decodertools.core.ReportParser;
|
||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||
|
||||
/**
|
||||
|
|
|
@ -347,4 +347,4 @@ com.raytheon.uf.common.dataplugin.shef.tables.Zoneinfo
|
|||
com.raytheon.uf.common.dataplugin.shef.tables.ZoneinfoId
|
||||
com.raytheon.uf.common.dataplugin.shef.tables.Zonenum
|
||||
com.raytheon.uf.common.dataplugin.shef.tables.ZonenumId
|
||||
com.raytheon.edex.transform.shef.MetarToShefFilter
|
||||
com.raytheon.edex.transform.shef.MetarToShefFilter
|
|
@ -1,4 +0,0 @@
|
|||
com.raytheon.uf.edex.decodertools.core.filterimpl.RectFilterElement
|
||||
com.raytheon.uf.edex.decodertools.core.filterimpl.RadiusFilterElement
|
||||
com.raytheon.uf.edex.decodertools.core.filterimpl.StationIdFilterElement
|
||||
com.raytheon.uf.edex.decodertools.core.filterimpl.WMOHeaderFilterElement
|
|
@ -33,6 +33,7 @@ package com.raytheon.uf.edex.decodertools.core;
|
|||
* 20080102 384 jkorman Added additional obs type constants.
|
||||
* 20080114 763 jkorman Added constants for vertical sig values.
|
||||
* Sep 18, 2014 3627 mapeters Removed unused constants.
|
||||
* Sep 26, 2014 3629 mapeters Removed constants specific to particular packages.
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
|
@ -49,18 +50,6 @@ public interface IDecoderConstants {
|
|||
|
||||
public static final byte ASCII_SP = 0x20;
|
||||
|
||||
public static final char SPACE_CHAR = ' ';
|
||||
|
||||
public static final String CARRIAGECONTROL = "CARRIAGECONTROL";
|
||||
|
||||
public static final String REPORT_END = "RPT_END";
|
||||
|
||||
public static final String MESSAGE_START = "MSG_START";
|
||||
|
||||
public static final String MESSAGE_END = "MSG_END";
|
||||
|
||||
public static final String SOM = String.valueOf((char) ASCII_SOM);
|
||||
|
||||
public static final String ETX = String.valueOf((char) ASCII_ETX);
|
||||
|
||||
public static final String WMO_HEADER = "[A-Z]{4}\\d{0,2} [A-Z][A-Z0-9]{3} \\d{6}[^\\r\\n]*[\\r\\n]+";
|
||||
|
@ -73,23 +62,7 @@ public interface IDecoderConstants {
|
|||
|
||||
public static final int SYNOPTIC_MOBILE_LAND = 1002;
|
||||
|
||||
public static final int SYNOPTIC_SHIP = 1003;
|
||||
|
||||
public static final int SYNOPTIC_CMAN = 1004;
|
||||
|
||||
public static final int SYNOPTIC_MOORED_BUOY = 1005;
|
||||
|
||||
public static final int DRIFTING_BUOY = 1006;
|
||||
|
||||
public static final int SYNOPTIC_MAROB = 1007;
|
||||
|
||||
public static final int RECCO_MANOBS = 4500;
|
||||
|
||||
public static final int RECCO_INTEROBS = 4510;
|
||||
|
||||
public static final int AIREP_NORMAL = 4600;
|
||||
|
||||
|
||||
public static final int AIREP_SPECIAL = 4610;
|
||||
|
||||
public static final int PROFILER_DATA = 3000;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue