Merge "Omaha #3002 Moved common taf code to com.raytheon.uf.common.dataplugin.taf." into omaha_14.4.1

Former-commit-id: ab3a7a2804 [formerly 13ac6e8337] [formerly 2d4d89b3f0 [formerly 62674d17c73d8fdbbe26916aba7ecac572eca2eb]]
Former-commit-id: 2d4d89b3f0
Former-commit-id: 0b8c3e67a1
This commit is contained in:
Richard Peter 2014-05-20 14:56:44 -05:00 committed by Gerrit Code Review
commit 3264e7bd93
49 changed files with 325 additions and 299 deletions

View file

@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.dataplugin.ccfp, com.raytheon.uf.common.dataplugin.ccfp,
com.raytheon.uf.common.pointdata;bundle-version="1.11.7", com.raytheon.uf.common.pointdata;bundle-version="1.11.7",
com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization,
com.raytheon.edex.plugin.taf;bundle-version="1.12.1174",
com.raytheon.viz.pointdata;bundle-version="1.11.7", com.raytheon.viz.pointdata;bundle-version="1.11.7",
com.raytheon.uf.common.python;bundle-version="1.11.7", com.raytheon.uf.common.python;bundle-version="1.11.7",
org.jep;bundle-version="1.0.0", org.jep;bundle-version="1.0.0",
@ -27,7 +26,8 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.tafqueue;bundle-version="1.0.0", com.raytheon.uf.common.tafqueue;bundle-version="1.0.0",
org.apache.commons.lang;bundle-version="2.3.0", org.apache.commons.lang;bundle-version="2.3.0",
com.raytheon.uf.common.auth;bundle-version="1.12.1174", com.raytheon.uf.common.auth;bundle-version="1.12.1174",
com.raytheon.uf.viz.datacube com.raytheon.uf.viz.datacube,
com.raytheon.uf.common.dataplugin.taf
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Export-Package: com.raytheon.viz.aviation, Export-Package: com.raytheon.viz.aviation,

View file

@ -34,7 +34,7 @@ import javax.xml.bind.JAXB;
import jep.JepException; import jep.JepException;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.PathManagerFactory;
@ -70,6 +70,7 @@ import com.raytheon.viz.aviation.xml.WxPlotCfg;
* Apr 28, 2011 8065 rferrel Use cache data * Apr 28, 2011 8065 rferrel Use cache data
* Nov 26, 2012 1298 rferrel Non-blocking dialog cleanup now use * Nov 26, 2012 1298 rferrel Non-blocking dialog cleanup now use
* IUFStatusHandler for error messages. * IUFStatusHandler for error messages.
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -44,7 +44,7 @@ import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.localization.LocalizationFile; import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.viz.aviation.monitor.TafUtil; import com.raytheon.viz.aviation.monitor.TafUtil;
import com.raytheon.viz.aviation.resource.ResourceConfigMgr; import com.raytheon.viz.aviation.resource.ResourceConfigMgr;
@ -72,6 +72,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* 9/9/2010 5468 rferrel Check for no TAF loaded for a site * 9/9/2010 5468 rferrel Check for no TAF loaded for a site
* 10/1/2010 4345 rferrel Made products display the same as AWIPS I * 10/1/2010 4345 rferrel Made products display the same as AWIPS I
* 10/04/2012 1229 rferrel Made non-blocking. * 10/04/2012 1229 rferrel Made non-blocking.
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -91,7 +91,7 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem; import org.eclipse.swt.widgets.TabItem;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext; import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@ -235,6 +235,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* 02/19/2014 16980 zhao add code to ensure the Alt flag is false after the Alt kay is released * 02/19/2014 16980 zhao add code to ensure the Alt flag is false after the Alt kay is released
* 21Mar2014 #2925 lvenable Fixed NPE error found during testing. * 21Mar2014 #2925 lvenable Fixed NPE error found during testing.
* 06May2014 3091 rferrel Use OUP authorization to bring up send dialog. * 06May2014 3091 rferrel Use OUP authorization to bring up send dialog.
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener; import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener;
import com.raytheon.viz.aviation.cachedata.CacheGuidanceRequest; import com.raytheon.viz.aviation.cachedata.CacheGuidanceRequest;
import com.raytheon.viz.aviation.cachedata.TampCacheGuidanceRequest; import com.raytheon.viz.aviation.cachedata.TampCacheGuidanceRequest;
@ -54,6 +54,7 @@ import com.raytheon.viz.aviation.resource.ResourceConfigMgr.ResourceTag;
* and routine button's values. * and routine button's values.
* 14 APR 2011 8065 rferrel Add flag to indicate display is current * 14 APR 2011 8065 rferrel Add flag to indicate display is current
* and implement data caching * and implement data caching
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -20,13 +20,6 @@
package com.raytheon.viz.aviation.model; package com.raytheon.viz.aviation.model;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_BECMG;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_FM;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_INITIAL;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB_TEMPO;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_TEMPO;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
@ -34,6 +27,7 @@ import java.util.TimeZone;
import com.raytheon.uf.common.dataplugin.obs.metar.MetarRecord; import com.raytheon.uf.common.dataplugin.obs.metar.MetarRecord;
import com.raytheon.uf.common.dataplugin.obs.metar.util.SkyCover; import com.raytheon.uf.common.dataplugin.obs.metar.util.SkyCover;
import com.raytheon.uf.common.dataplugin.taf.TafConstants;
import com.raytheon.viz.aviation.model.CloudGroup.CloudCategory; import com.raytheon.viz.aviation.model.CloudGroup.CloudCategory;
/** /**
@ -62,6 +56,7 @@ import com.raytheon.viz.aviation.model.CloudGroup.CloudCategory;
* 1/15/2009 1816 grichard Correct TAF to conform to 10-813 NWSI. * 1/15/2009 1816 grichard Correct TAF to conform to 10-813 NWSI.
* 4/29/2009 1982 grichard Correct TAF to conform to 10-813 NWSI. * 4/29/2009 1982 grichard Correct TAF to conform to 10-813 NWSI.
* 5/11/2009 1816 grichard Corrected visibility for metar change. * 5/11/2009 1816 grichard Corrected visibility for metar change.
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *
@ -810,8 +805,9 @@ public class TimeGroup implements Comparable<TimeGroup> {
/* Becoming (BECMG) */ /* Becoming (BECMG) */
/* Tempo (TEMPO) */ /* Tempo (TEMPO) */
/* Probability (PROB) */ /* Probability (PROB) */
FM(CG_FM), BECMG(CG_BECMG), INITIAL(CG_INITIAL), TEMPO(CG_TEMPO), PROB( FM(TafConstants.CG_FM), BECMG(TafConstants.CG_BECMG), INITIAL(
CG_PROB), PROB_TEMPO(CG_PROB_TEMPO); TafConstants.CG_INITIAL), TEMPO(TafConstants.CG_TEMPO), PROB(
TafConstants.CG_PROB), PROB_TEMPO(TafConstants.CG_PROB_TEMPO);
/* /*
* See: NWS Operations Manual W/OM12 Part D-31 for more information. * See: NWS Operations Manual W/OM12 Part D-31 for more information.
*/ */

View file

@ -34,7 +34,7 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.util.StringUtil; import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener; import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener;
@ -65,6 +65,7 @@ import com.raytheon.viz.aviation.xml.MonitorCfg;
* 20JUL2012 14570 gzhang/zhao Modified for highlighting correct time groups in TAF Viewer * 20JUL2012 14570 gzhang/zhao Modified for highlighting correct time groups in TAF Viewer
* 11AUG2012 14570 zhao Added 'cat' to alert_key_map * 11AUG2012 14570 zhao Added 'cat' to alert_key_map
* 02Jan2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI * 02Jan2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -22,7 +22,7 @@ package com.raytheon.viz.aviation.monitor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.viz.core.alerts.AlertMessage; import com.raytheon.uf.viz.core.alerts.AlertMessage;
import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener; import com.raytheon.uf.viz.core.jobs.IRequestCompleteListener;
import com.raytheon.viz.aviation.guidance.GuidanceRequest; import com.raytheon.viz.aviation.guidance.GuidanceRequest;
@ -42,6 +42,7 @@ import com.raytheon.viz.aviation.observer.TafMonitorDlg;
* Sep 2, 2009 njensen Initial creation * Sep 2, 2009 njensen Initial creation
* Nov 12, 2010 6195 rferrel Clear guidance's TAF cache when * Nov 12, 2010 6195 rferrel Clear guidance's TAF cache when
* an alert received. * an alert received.
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -48,7 +48,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.RGBColors; import com.raytheon.uf.viz.core.RGBColors;
import com.raytheon.uf.viz.core.VizApp; import com.raytheon.uf.viz.core.VizApp;
@ -94,6 +94,7 @@ import com.raytheon.viz.avnconfig.IStatusSettable;
* 01/02/2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI * 01/02/2013 15606 gzhang Remove GridData widthHint so button/label size change with GUI
* 03/07/2013 1735 rferrel Flag to indicate grid data is needed. * 03/07/2013 1735 rferrel Flag to indicate grid data is needed.
* 19Mar2014 #2925 lvenable Added dispose checks for runAsync. * 19Mar2014 #2925 lvenable Added dispose checks for runAsync.
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author lvenable * @author lvenable

View file

@ -27,10 +27,10 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.TimeZone; import java.util.TimeZone;
import com.raytheon.edex.plugin.taf.common.TafRecord;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
@ -53,6 +53,7 @@ import com.raytheon.uf.viz.datacube.DataCubeContainer;
* Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references * Sep 11, 2013 2277 mschenke Got rid of ScriptCreator references
* Feb 24, 2014 2830 njensen Sort dataTimes in getLatestTafs() * Feb 24, 2014 2830 njensen Sort dataTimes in getLatestTafs()
* so it works correctly * so it works correctly
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -42,7 +42,7 @@
version="0.0.0"/> version="0.0.0"/>
<plugin <plugin
id="com.raytheon.edex.plugin.taf" id="com.raytheon.uf.common.dataplugin.taf"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"

View file

@ -1,23 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
/**
* Contains common classes implementing the TAF data structure.
*/
package com.raytheon.edex.plugin.taf.common;

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.raytheon.uf.common.dataplugin.taf</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,20 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 1
Bundle-Name: Taf Plug-in
Bundle-SymbolicName: com.raytheon.uf.common.dataplugin.taf
Bundle-Version: 1.14.0.qualifier
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
Bundle-Vendor: RAYTHEON
Export-Package: com.raytheon.uf.common.dataplugin.taf
Require-Bundle: org.apache.commons.lang,
javax.persistence
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.dataplugin.annotations,
com.raytheon.uf.common.dataplugin.persist,
com.raytheon.uf.common.geospatial,
com.raytheon.uf.common.pointdata.spatial,
com.raytheon.uf.common.serialization.annotations,
com.raytheon.uf.common.time.util,
com.raytheon.uf.common.wmo,
org.hibernate.annotations

View file

@ -0,0 +1,4 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.

View file

@ -18,33 +18,13 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import static com.raytheon.edex.plugin.taf.common.TafConstants.ALTIMETER_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_BECMG;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_FM;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB_TEMPO;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_TEMPO;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CHANGE_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.ICING_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.SKY_COVER_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.TEMP_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.TURBULENCE_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.VISIBILITY_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.VS_6PLUS_M;
import static com.raytheon.edex.plugin.taf.common.TafConstants.VS_6PLUS_SM;
import static com.raytheon.edex.plugin.taf.common.TafConstants.WIND_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.WIND_SHEAR_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.WX_CAVOK;
import static com.raytheon.edex.plugin.taf.common.TafConstants.WX_NSW;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.persistence.CascadeType; import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
@ -62,7 +42,7 @@ import javax.persistence.Transient;
import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject; import com.raytheon.uf.common.dataplugin.persist.PersistableDataObject;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.edex.decodertools.time.TimeTools; import com.raytheon.uf.common.time.util.TimeUtil;
/** /**
* This class represents a forecast group found in a taf message. * This class represents a forecast group found in a taf message.
@ -81,8 +61,11 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
* Oct 21, 2008 1515 jkorman Added 30 Hour capability changes. * Oct 21, 2008 1515 jkorman Added 30 Hour capability changes.
* Jun 28, 2012 #827 dgilling Annotate id field for * Jun 28, 2012 #827 dgilling Annotate id field for
* serialization. * serialization.
* Nov 01, 2013 2361 njensen Remove XML annotations * Nov 01, 2013 2361 njensen Remove XML annotations
* Feb 10, 2014 2777 rferrel set the parentId when assinging sets. * Feb 10, 2014 2777 rferrel set the parentId when assinging sets.
* May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* Changed groupPattern to static field.
* Refactored Strings to Patterns in TafConstants.
* *
* </pre> * </pre>
* *
@ -247,8 +230,8 @@ public class ChangeGroup extends PersistableDataObject {
changeGroup = group; changeGroup = group;
tafValidPeriod = tafIssuePeriod; tafValidPeriod = tafIssuePeriod;
tafChangePeriod = new TafPeriod(TimeTools.copy(tafValidPeriod tafChangePeriod = new TafPeriod(TimeUtil.newCalendar(tafValidPeriod
.getStartDate()), TimeTools.copy(tafValidPeriod.getEndDate())); .getStartDate()), TimeUtil.newCalendar(tafValidPeriod.getEndDate()));
decode(extractTime(group)); decode(extractTime(group));
} }
@ -297,8 +280,7 @@ public class ChangeGroup extends PersistableDataObject {
private String extractTime(String groupData) { private String extractTime(String groupData) {
StringBuilder grpData = new StringBuilder(groupData); StringBuilder grpData = new StringBuilder(groupData);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
Pattern groupPattern = Pattern.compile(CHANGE_GROUP_EXP); Matcher matcher = TafConstants.CHANGE_GROUP_EXP.matcher(grpData);
Matcher matcher = groupPattern.matcher(grpData);
int stopPos = -1; int stopPos = -1;
if (matcher.find()) { if (matcher.find()) {
@ -312,10 +294,10 @@ public class ChangeGroup extends PersistableDataObject {
probability = Integer.parseInt(prob.substring(4, 6)); probability = Integer.parseInt(prob.substring(4, 6));
s = (matcher.group(7) != null) ? matcher.group(7).trim() : null; s = (matcher.group(7) != null) ? matcher.group(7).trim() : null;
if (CG_TEMPO.equals(s)) { if (TafConstants.CG_TEMPO.equals(s)) {
chgGrp = CG_PROB_TEMPO; chgGrp = TafConstants.CG_PROB_TEMPO;
} else { } else {
chgGrp = CG_PROB; chgGrp = TafConstants.CG_PROB;
} }
} }
@ -328,14 +310,14 @@ public class ChangeGroup extends PersistableDataObject {
int t2 = Integer.parseInt(s.substring(2, 4)); int t2 = Integer.parseInt(s.substring(2, 4));
// FM group is hour/minute // FM group is hour/minute
if (CG_FM.equals(chgGrp)) { if (TafConstants.CG_FM.equals(chgGrp)) {
tafChangePeriod = TafPeriod.determineChangeGroupPeriodSSss( tafChangePeriod = TafPeriod.determineChangeGroupPeriodSSss(
t1, t2, tafValidPeriod); t1, t2, tafValidPeriod);
} else { } else {
// All the rest are hour/hour // All the rest are hour/hour
tafChangePeriod = TafPeriod.determineChangeGroupPeriodSSEE( tafChangePeriod = TafPeriod.determineChangeGroupPeriodSSEE(
t1, t2, tafValidPeriod, t1, t2, tafValidPeriod,
CG_BECMG.equals(change_indicator)); TafConstants.CG_BECMG.equals(change_indicator));
} }
} }
} }
@ -359,10 +341,9 @@ public class ChangeGroup extends PersistableDataObject {
icing_layers = new HashSet<IcingLayer>(); icing_layers = new HashSet<IcingLayer>();
temp_forecasts = new HashSet<TemperatureForecast>(); temp_forecasts = new HashSet<TemperatureForecast>();
Pattern groupPattern = Pattern.compile(WIND_GROUP_EXP);
// Extracting the wind group // Extracting the wind group
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
Matcher matcher = groupPattern.matcher(grpData); Matcher matcher = TafConstants.WIND_GROUP_EXP.matcher(grpData);
int stopPos = -1; int stopPos = -1;
if (matcher.find()) { if (matcher.find()) {
@ -395,11 +376,10 @@ public class ChangeGroup extends PersistableDataObject {
} }
// Extracting icing information // Extracting icing information
groupPattern = Pattern.compile(ICING_GROUP_EXP);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
int start = grpData.length(); int start = grpData.length();
int stop = -1; int stop = -1;
matcher = groupPattern.matcher(grpData); matcher = TafConstants.ICING_GROUP_EXP.matcher(grpData);
while (matcher.find()) { while (matcher.find()) {
icing_layers.add(new IcingLayer(this, matcher.group(1), matcher icing_layers.add(new IcingLayer(this, matcher.group(1), matcher
.group(2), matcher.group(3))); .group(2), matcher.group(3)));
@ -411,11 +391,10 @@ public class ChangeGroup extends PersistableDataObject {
} }
// Extracting turbulence information // Extracting turbulence information
groupPattern = Pattern.compile(TURBULENCE_GROUP_EXP);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
start = grpData.length(); start = grpData.length();
stop = -1; stop = -1;
matcher = groupPattern.matcher(grpData); matcher = TafConstants.TURBULENCE_GROUP_EXP.matcher(grpData);
while (matcher.find()) { while (matcher.find()) {
turbulence_layers.add(new TurbulenceLayer(this, matcher.group(1), turbulence_layers.add(new TurbulenceLayer(this, matcher.group(1),
matcher.group(2), matcher.group(3))); matcher.group(2), matcher.group(3)));
@ -426,11 +405,10 @@ public class ChangeGroup extends PersistableDataObject {
grpData.delete(start, stop); grpData.delete(start, stop);
} }
groupPattern = Pattern.compile(TEMP_GROUP_EXP);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
start = grpData.length(); start = grpData.length();
stop = -1; stop = -1;
matcher = groupPattern.matcher(grpData); matcher = TafConstants.TEMP_GROUP_EXP.matcher(grpData);
while (matcher.find()) { while (matcher.find()) {
temp_forecasts.add(new TemperatureForecast(this, matcher.group(1), temp_forecasts.add(new TemperatureForecast(this, matcher.group(1),
matcher.group(2), matcher.group(3))); matcher.group(2), matcher.group(3)));
@ -442,9 +420,8 @@ public class ChangeGroup extends PersistableDataObject {
} }
// Extracting altimeter information // Extracting altimeter information
groupPattern = Pattern.compile(ALTIMETER_GROUP_EXP);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
matcher = groupPattern.matcher(grpData); matcher = TafConstants.ALTIMETER_GROUP_EXP.matcher(grpData);
if (matcher.find()) { if (matcher.find()) {
altim_in_hg = Double altim_in_hg = Double
.toString(Double.parseDouble(matcher.group(1)) / 100); .toString(Double.parseDouble(matcher.group(1)) / 100);
@ -452,9 +429,8 @@ public class ChangeGroup extends PersistableDataObject {
} }
// Extracting wind shear information // Extracting wind shear information
groupPattern = Pattern.compile(WIND_SHEAR_GROUP_EXP);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
matcher = groupPattern.matcher(grpData); matcher = TafConstants.WIND_SHEAR_GROUP_EXP.matcher(grpData);
if (matcher.find()) { if (matcher.find()) {
this.wind_shear_hgt_ft_agl = Integer.parseInt(matcher.group(1)) * 100; this.wind_shear_hgt_ft_agl = Integer.parseInt(matcher.group(1)) * 100;
@ -464,30 +440,27 @@ public class ChangeGroup extends PersistableDataObject {
} }
// Extracting the visibility // Extracting the visibility
groupPattern = Pattern.compile(WX_CAVOK);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
matcher = groupPattern.matcher(grpData); matcher = TafConstants.WX_CAVOK.matcher(grpData);
if (matcher.find()) { if (matcher.find()) {
// CAVOK implies 6+ visibility and no cloud or weather groups! // CAVOK implies 6+ visibility and no cloud or weather groups!
visibility_mi = VS_6PLUS_SM; visibility_mi = TafConstants.VS_6PLUS_SM;
grpData.delete(matcher.start(), matcher.end()); grpData.delete(matcher.start(), matcher.end());
} else { } else {
// Extracting the visibility // Extracting the visibility
groupPattern = Pattern.compile(VISIBILITY_GROUP_EXP); matcher = TafConstants.VISIBILITY_GROUP_EXP.matcher(grpData);
matcher = groupPattern.matcher(grpData);
if (matcher.find()) { if (matcher.find()) {
visibility_mi = matcher.group(1); visibility_mi = matcher.group(1);
grpData.delete(matcher.start(), matcher.end()); grpData.delete(matcher.start(), matcher.end());
} else { } else {
// Statue miles vis didn't work so check metric // Statue miles vis didn't work so check metric
groupPattern = Pattern.compile("\\d{4}"); matcher = TafConstants.FourDigitMetric.matcher(grpData);
matcher = groupPattern.matcher(grpData);
if (matcher.find()) { if (matcher.find()) {
if (matcher.end() < 6) { if (matcher.end() < 6) {
visibility_mi = matcher.group(); visibility_mi = matcher.group();
if (VS_6PLUS_M.equals(visibility_mi)) { if (TafConstants.VS_6PLUS_M.equals(visibility_mi)) {
visibility_mi = VS_6PLUS_SM; visibility_mi = TafConstants.VS_6PLUS_SM;
} }
grpData.delete(matcher.start(), matcher.end()); grpData.delete(matcher.start(), matcher.end());
} }
@ -495,13 +468,12 @@ public class ChangeGroup extends PersistableDataObject {
} }
// Extracting the weather // Extracting the weather
groupPattern = Pattern.compile(WX_NSW);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
matcher = groupPattern.matcher(grpData); matcher = TafConstants.WX_NSW.matcher(grpData);
if (matcher.find()) { if (matcher.find()) {
TafWeatherCondition wxCon = new TafWeatherCondition(); TafWeatherCondition wxCon = new TafWeatherCondition();
wxCon.setSequenceId(1); wxCon.setSequenceId(1);
wxCon.setOther(WX_NSW); wxCon.setOther(TafConstants.WX_NSW.pattern());
weather.add(wxCon); weather.add(wxCon);
wxCon.setParentID(this); wxCon.setParentID(this);
grpData.delete(matcher.start(), matcher.end()); grpData.delete(matcher.start(), matcher.end());
@ -519,9 +491,8 @@ public class ChangeGroup extends PersistableDataObject {
} }
// Extracting the sky cover // Extracting the sky cover
groupPattern = Pattern.compile(SKY_COVER_GROUP_EXP);
checkGroupDataEnd(grpData); checkGroupDataEnd(grpData);
matcher = groupPattern.matcher(grpData); matcher = TafConstants.SKY_COVER_GROUP_EXP.matcher(grpData);
start = grpData.length(); start = grpData.length();
stop = -1; stop = -1;

View file

@ -18,7 +18,7 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -45,6 +45,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* 8/30/06 bphillip Initial Creation * 8/30/06 bphillip Initial Creation
* 6/21/07 180 bphillip Updated for use with plugin persistance pattern * 6/21/07 180 bphillip Updated for use with plugin persistance pattern
* Nov 01, 2013 2361 njensen Remove XML annotations * Nov 01, 2013 2361 njensen Remove XML annotations
* May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.decoder; package com.raytheon.uf.common.dataplugin.taf;
/**TODO Add Description /**TODO Add Description
* *
@ -28,6 +28,7 @@ package com.raytheon.edex.plugin.taf.decoder;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 20080424 1001 jkorman Initial implementation. * 20080424 1001 jkorman Initial implementation.
* May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -37,6 +37,7 @@ import java.util.Set;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 20080605 1001 jkorman Initial implementation. * 20080605 1001 jkorman Initial implementation.
* May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
/** /**
* Intermediate data element used to parse weather data elements. It differs from * Intermediate data element used to parse weather data elements. It differs from
@ -32,7 +32,7 @@ package com.raytheon.edex.plugin.taf.common;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 20080605 1001 jkorman Initial implementation. * 20080605 1001 jkorman Initial implementation.
* * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author jkorman * @author jkorman

View file

@ -17,7 +17,9 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import java.util.regex.Pattern;
/** /**
* String constants used in the TAF Plugin. * String constants used in the TAF Plugin.
@ -27,6 +29,9 @@ package com.raytheon.edex.plugin.taf.common;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Sep 4, 2008 1444 grichard Initial creation. * Sep 4, 2008 1444 grichard Initial creation.
* May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* Changed String patterns to Patterns.
* Refactored Strings to Patterns in TafConstants.
* </pre> * </pre>
* *
* @author grichard * @author grichard
@ -36,28 +41,36 @@ package com.raytheon.edex.plugin.taf.common;
public final class TafConstants { public final class TafConstants {
/** Regular expression for extracting wind information */ /** Regular expression for extracting wind information */
public static final String WIND_GROUP_EXP = "(\\d{3}|VRB)(\\d{2,3})((G)(\\d{2,3}))?(KT|MPS|KMH)()"; public static final Pattern WIND_GROUP_EXP = Pattern
.compile("(\\d{3}|VRB)(\\d{2,3})((G)(\\d{2,3}))?(KT|MPS|KMH)()");
/** Regular expression for extracting visibility information */ /** Regular expression for extracting visibility information */
public static final String VISIBILITY_GROUP_EXP = "(P?[0-6]|[0-6] [13]/[24]|[13]/[24])SM"; public static final Pattern VISIBILITY_GROUP_EXP = Pattern
.compile("(P?[0-6]|[0-6] [13]/[24]|[13]/[24])SM");
/** Regular expression for extracting sky coverage information */ /** Regular expression for extracting sky coverage information */
public static final String SKY_COVER_GROUP_EXP = "(((FEW|SCT|BKN|OVC|VV)((\\d{3}|///)((CB|TCU)?)))|((SKC|CLR|NSC)))"; public static final Pattern SKY_COVER_GROUP_EXP = Pattern
.compile("(((FEW|SCT|BKN|OVC|VV)((\\d{3}|///)((CB|TCU)?)))|((SKC|CLR|NSC)))");
/** Regular expression for extracting wind shear information */ /** Regular expression for extracting wind shear information */
public static final String WIND_SHEAR_GROUP_EXP = "WS([0-9]{3})/([0-9]{3})([0-9]{2})KT"; public static final Pattern WIND_SHEAR_GROUP_EXP = Pattern
.compile("WS([0-9]{3})/([0-9]{3})([0-9]{2})KT");
/** Regular expression for extracting icing information */ /** Regular expression for extracting icing information */
public static final String ICING_GROUP_EXP = "6([0-9])([0-9]{3})([0-9])"; public static final Pattern ICING_GROUP_EXP = Pattern
.compile("6([0-9])([0-9]{3})([0-9])");
/** Regular expression for extracting turbulence information */ /** Regular expression for extracting turbulence information */
public static final String TURBULENCE_GROUP_EXP = "5([0-9])([0-9]{3})([0-9])"; public static final Pattern TURBULENCE_GROUP_EXP = Pattern
.compile("5([0-9])([0-9]{3})([0-9])");
/** Regular expression for extracting temperature information */ /** Regular expression for extracting temperature information */
public static final String TEMP_GROUP_EXP = "T(M)?([0-9]{2})/([0-9]{2})Z"; public static final Pattern TEMP_GROUP_EXP = Pattern
.compile("T(M)?([0-9]{2})/([0-9]{2})Z");
/** Regular expression for extracting altimeter information */ /** Regular expression for extracting altimeter information */
public static final String ALTIMETER_GROUP_EXP = "QNH([23]\\d{3})INS"; public static final Pattern ALTIMETER_GROUP_EXP = Pattern
.compile("QNH([23]\\d{3})INS");
/** /**
* Pattern used for extracting change groups * Pattern used for extracting change groups
@ -77,7 +90,8 @@ public final class TafConstants {
* </pre> * </pre>
*/ */
public static final String CHANGE_GROUP_EXP = "((FM|((BECMG )|((PROB[34]0) +(TEMPO )?)|(TEMPO )))((\\d{6})|(([0-3]\\d{3})/([0-3]\\d{3})))( ))"; public static final Pattern CHANGE_GROUP_EXP = Pattern
.compile("((FM|((BECMG )|((PROB[34]0) +(TEMPO )?)|(TEMPO )))((\\d{6})|(([0-3]\\d{3})/([0-3]\\d{3})))( ))");
public static final String CG_FM = "FM"; public static final String CG_FM = "FM";
@ -95,9 +109,9 @@ public final class TafConstants {
public static final String VS_6PLUS_M = "9999"; public static final String VS_6PLUS_M = "9999";
public static final String WX_NSW = "NSW"; public static final Pattern WX_NSW = Pattern.compile("NSW");
public static final String WX_CAVOK = "CAVOK"; public static final Pattern WX_CAVOK = Pattern.compile("CAVOK");
public static final String CLD_SKC = "SKC"; public static final String CLD_SKC = "SKC";
@ -109,20 +123,20 @@ public final class TafConstants {
public static final String COR_IND = "COR"; public static final String COR_IND = "COR";
public static final String REPORT_HEADER = "(TAF )?((AMD|COR) )*?" public static final Pattern REPORT_HEADER = Pattern
+ "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?([0-3]\\d{5})( )"; .compile("(TAF )?((AMD|COR) )*?"
+ "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?([0-3]\\d{5})( )");
public static final String REPORT_HEADER30 = "(TAF )?((AMD|COR) )*?" public static final Pattern REPORT_HEADER30 = Pattern
+ "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?(\\d{4}/\\d{4})( )"; .compile("(TAF )?((AMD|COR) )*?"
+ "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?(\\d{4}/\\d{4})( )");
public static final String RPT_HDR_TAF = "(TAF((\\s)+(AMD|COR))?)"; public static final Pattern RPT_HDR_TAF = Pattern
.compile("(TAF((\\s)+(AMD|COR))?)");
public static final String RPT_HDR_CCCC = "([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?([0-3]\\d{3})/([0-3]\\d{3})( )"; public static final Pattern RPT_HDR_CCCC = Pattern
.compile("([A-Z][A-Z,0-9]{3}) ([0-3]\\d{5}Z )?([0-3]\\d{3})/([0-3]\\d{3})( )");
/** public static final Pattern FourDigitMetric = Pattern.compile("\\d{4}");
* Constructor.
*/
private TafConstants() {
}
} }

View file

@ -18,7 +18,7 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import java.io.Serializable; import java.io.Serializable;
import java.util.Calendar; import java.util.Calendar;
@ -48,6 +48,7 @@ import com.raytheon.uf.common.wmo.WMOHeader;
* 30Aug2006 B. Phillippe Modified for use to decode TAFs for AWIPS * 30Aug2006 B. Phillippe Modified for use to decode TAFs for AWIPS
* Nov 01, 2013 2361 njensen Remove XML annotations * Nov 01, 2013 2361 njensen Remove XML annotations
* May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage
* May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -18,7 +18,7 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
@ -67,7 +67,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Nov 01, 2013 2361 njensen Remove XML annotations * Nov 01, 2013 2361 njensen Remove XML annotations
* Feb 10, 2014 2777 rferrel Assign parent id when setting ChangeGroup. * Feb 10, 2014 2777 rferrel Assign parent id when setting ChangeGroup.
* Feb 11, 2014 2784 rferrel Remove override of setIdentifier. * Feb 11, 2014 2784 rferrel Remove override of setIdentifier.
* * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author bphillip * @author bphillip

View file

@ -18,7 +18,7 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -46,6 +46,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* 6/21/2007 180 Phillippe initial creation. * 6/21/2007 180 Phillippe initial creation.
* 4/16/2008 934 grichard Added toString overridden method. * 4/16/2008 934 grichard Added toString overridden method.
* Nov 01, 2013 2361 njensen Remove XML annotations * Nov 01, 2013 2361 njensen Remove XML annotations
* May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* *
* </pre> * </pre>
* *

View file

@ -18,7 +18,7 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* 6/21/2007 180 Phillippe Initial creation * 6/21/2007 180 Phillippe Initial creation
* 20081106 1515 jkorman Changed length of &quot;other&quot; attribute. * 20081106 1515 jkorman Changed length of &quot;other&quot; attribute.
* Nov 01, 2013 2361 njensen Remove XML annotations * Nov 01, 2013 2361 njensen Remove XML annotations
* * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author bphillip * @author bphillip

View file

@ -18,7 +18,7 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -47,7 +47,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* 8/30/2006 bphillip Initial Creation * 8/30/2006 bphillip Initial Creation
* 6/21/2007 180 bphillip Updated for use with plugin persistence pattern * 6/21/2007 180 bphillip Updated for use with plugin persistence pattern
* Nov 01, 2013 2361 njensen Remove XML annotations * Nov 01, 2013 2361 njensen Remove XML annotations
* * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author bphillip * @author bphillip

View file

@ -18,7 +18,7 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.common; package com.raytheon.uf.common.dataplugin.taf;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
@ -45,7 +45,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* 8/30/2006 bphillip Initial Creation * 8/30/2006 bphillip Initial Creation
* 6/21/2007 bphillip Updated for use with plugin persistance pattern * 6/21/2007 bphillip Updated for use with plugin persistance pattern
* Nov 01, 2013 2361 njensen Remove XML annotations * Nov 01, 2013 2361 njensen Remove XML annotations
* * May 15, 2014 3002 bgonzale Moved to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author bphillip * @author bphillip

View file

@ -242,7 +242,14 @@
unpack="false"/> unpack="false"/>
<plugin <plugin
id="com.raytheon.edex.plugin.taf" id="com.raytheon.uf.edex.plugin.taf"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.dataplugin.taf"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>com.raytheon.edex.plugin.taf</name> <name>com.raytheon.uf.edex.plugin.taf</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>

View file

@ -0,0 +1,7 @@
#Thu Mar 26 10:25:50 CDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,18 +1,16 @@
Manifest-Version: 1.0 Manifest-Version: 1.0
Bundle-ManifestVersion: 2 Bundle-ManifestVersion: 2
Bundle-Name: Taf Plug-in Bundle-Name: Taf Plug-in
Bundle-SymbolicName: com.raytheon.edex.plugin.taf Bundle-SymbolicName: com.raytheon.uf.edex.plugin.taf
Bundle-Version: 1.12.1174.qualifier Bundle-Version: 1.14.0
Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serialization
Bundle-Vendor: RAYTHEON Bundle-Vendor: RAYTHEON
Export-Package: com.raytheon.edex.plugin.taf, Export-Package: com.raytheon.uf.edex.plugin.taf,
com.raytheon.edex.plugin.taf.common, com.raytheon.uf.edex.plugin.taf.decoder
com.raytheon.edex.plugin.taf.decoder
Require-Bundle: com.raytheon.edex.common, Require-Bundle: com.raytheon.edex.common,
com.raytheon.uf.edex.pointdata, com.raytheon.uf.edex.pointdata,
com.raytheon.uf.edex.decodertools;bundle-version="1.0.0", com.raytheon.uf.edex.decodertools;bundle-version="1.0.0",
org.apache.commons.lang, com.raytheon.uf.common.dataplugin.taf
javax.persistence
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.uf.common.wmo, Import-Package: com.raytheon.uf.common.wmo,
org.apache.commons.logging org.apache.commons.logging

View file

@ -4,9 +4,9 @@
<bean id="tafProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties"> <bean id="tafProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
<property name="pluginName" value="taf" /> <property name="pluginName" value="taf" />
<property name="pluginFQN" value="com.raytheon.edex.plugin.taf" /> <property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.taf" />
<property name="dao" value="com.raytheon.edex.plugin.taf.dao.TafDao" /> <property name="dao" value="com.raytheon.uf.edex.plugin.taf.dao.TafDao" />
<property name="record" value="com.raytheon.edex.plugin.taf.common.TafRecord" /> <property name="record" value="com.raytheon.uf.common.dataplugin.taf.TafRecord" />
<property name="dependencyFQNs"> <property name="dependencyFQNs">
<list> <list>
<value>com.raytheon.uf.common.pointdata</value> <value>com.raytheon.uf.common.pointdata</value>

View file

@ -3,8 +3,8 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="tafDecoder" class="com.raytheon.edex.plugin.taf.TafDecoder" /> <bean id="tafDecoder" class="com.raytheon.uf.edex.plugin.taf.TafDecoder" />
<bean id="tafSeparator" class="com.raytheon.edex.plugin.taf.decoder.TafSeparator" /> <bean id="tafSeparator" class="com.raytheon.uf.edex.plugin.taf.decoder.TafSeparator" />
<bean id="tafDistRegistry" factory-bean="distributionSrv" <bean id="tafDistRegistry" factory-bean="distributionSrv"
factory-method="register"> factory-method="register">

View file

@ -18,15 +18,15 @@
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf; package com.raytheon.uf.edex.plugin.taf;
import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.AbstractDecoder; import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.edex.plugin.taf.decoder.TAFParser; import com.raytheon.uf.common.dataplugin.taf.TAFParts;
import com.raytheon.edex.plugin.taf.decoder.TAFParts;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.wmo.WMOHeader; import com.raytheon.uf.common.wmo.WMOHeader;
import com.raytheon.uf.edex.plugin.taf.decoder.TAFParser;
/** /**
* *
@ -43,6 +43,7 @@ import com.raytheon.uf.common.wmo.WMOHeader;
* Apr 25, 2008 1001 jkorman Extracted decoder code into TAFParser. * Apr 25, 2008 1001 jkorman Extracted decoder code into TAFParser.
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* May 14, 2014 2536 bclement moved WMO Header to common, removed constrcutDataURI() call * May 14, 2014 2536 bclement moved WMO Header to common, removed constrcutDataURI() call
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author bphillip * @author bphillip

View file

@ -17,12 +17,12 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.dao; package com.raytheon.uf.edex.plugin.taf.dao;
import java.util.List; import java.util.List;
import com.raytheon.edex.db.dao.DefaultPluginDao; import com.raytheon.edex.db.dao.DefaultPluginDao;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.edex.database.DataAccessLayerException; import com.raytheon.uf.edex.database.DataAccessLayerException;
@ -36,6 +36,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* 20080103 384 jkorman Initial Coding. * 20080103 384 jkorman Initial Coding.
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author jkorman * @author jkorman

View file

@ -17,13 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.decoder; package com.raytheon.uf.edex.plugin.taf.decoder;
import static com.raytheon.edex.plugin.taf.common.TafConstants.AMD_IND;
import static com.raytheon.edex.plugin.taf.common.TafConstants.COR_IND;
import static com.raytheon.edex.plugin.taf.common.TafConstants.REPORT_HEADER30;
import static com.raytheon.edex.plugin.taf.decoder.TAFParser.cvtInt;
import static com.raytheon.edex.plugin.taf.decoder.TafSeparator.STATION_ID;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
@ -35,9 +29,11 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.taf.common.ChangeGroup; import com.raytheon.uf.common.dataplugin.taf.ChangeGroup;
import com.raytheon.edex.plugin.taf.common.TafPeriod; import com.raytheon.uf.common.dataplugin.taf.TAFParts;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafConstants;
import com.raytheon.uf.common.dataplugin.taf.TafPeriod;
import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.time.util.TimeUtil;
@ -54,6 +50,7 @@ import com.raytheon.uf.common.wmo.WMOHeader;
* add 30 Hour tafs. * add 30 Hour tafs.
* Nov 12, 2013 2546 bclement added check for legacy valid time * Nov 12, 2013 2546 bclement added check for legacy valid time
* May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author jkorman * @author jkorman
@ -402,11 +399,10 @@ public class TAFChangeGroupFactory {
StringBuilder sb = new StringBuilder(tafHeader.getExtension()); StringBuilder sb = new StringBuilder(tafHeader.getExtension());
// The pattern regex needs a terminating space. // The pattern regex needs a terminating space.
sb.append(" "); sb.append(" ");
Pattern headerPattern = Pattern.compile(REPORT_HEADER30);
Matcher matcher = headerPattern.matcher(sb); Matcher matcher = TafConstants.REPORT_HEADER30.matcher(sb);
if (matcher.find()) { if (matcher.find()) {
stationId = matcher.group(STATION_ID); stationId = matcher.group(TafSeparator.STATION_ID);
} }
Matcher m = PAT_VALID_TIME.matcher(sb); Matcher m = PAT_VALID_TIME.matcher(sb);
@ -419,9 +415,9 @@ public class TAFChangeGroupFactory {
issueTm = sb.substring(m.start(), m.end()); issueTm = sb.substring(m.start(), m.end());
issueTimeString = issueTm; issueTimeString = issueTm;
int iDay = cvtInt(issueTm.substring(0, 2)); int iDay = TAFParser.cvtInt(issueTm.substring(0, 2));
int iHour = cvtInt(issueTm.substring(2, 4)); int iHour = TAFParser.cvtInt(issueTm.substring(2, 4));
int iMin = cvtInt(issueTm.substring(4, 6)); int iMin = TAFParser.cvtInt(issueTm.substring(4, 6));
issueTime = TimeUtil.newGmtCalendar(wmoHeader.getYear(), issueTime = TimeUtil.newGmtCalendar(wmoHeader.getYear(),
wmoHeader.getMonth(), wmoHeader.getDay()); wmoHeader.getMonth(), wmoHeader.getDay());
@ -562,10 +558,12 @@ public class TAFChangeGroupFactory {
record.setStationId(stationId); record.setStationId(stationId);
if (isCOR || (tafParts.getTafHeader().indexOf(COR_IND) >= 0)) { if (isCOR
|| (tafParts.getTafHeader().indexOf(TafConstants.COR_IND) >= 0)) {
record.setCorIndicator("COR"); record.setCorIndicator("COR");
} }
if (isAMD || (tafParts.getTafHeader().indexOf(AMD_IND) >= 0)) { if (isAMD
|| (tafParts.getTafHeader().indexOf(TafConstants.AMD_IND) >= 0)) {
record.setAmdIndicator("AMD"); record.setAmdIndicator("AMD");
} }

View file

@ -17,21 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.decoder; package com.raytheon.uf.edex.plugin.taf.decoder;
import static com.raytheon.edex.plugin.taf.common.TafConstants.AMD_IND;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_BECMG;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_FM;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_INITIAL;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB_TEMPO;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_TEMPO;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CHANGE_GROUP_EXP;
import static com.raytheon.edex.plugin.taf.common.TafConstants.COR_IND;
import static com.raytheon.edex.plugin.taf.common.TafConstants.REPORT_HEADER;
import static com.raytheon.edex.plugin.taf.decoder.TafSeparator.ISSUE_TIME;
import static com.raytheon.edex.plugin.taf.decoder.TafSeparator.STATION_ID;
import static com.raytheon.edex.plugin.taf.decoder.TafSeparator.VALID_TIME;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
@ -45,9 +31,11 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.exception.DecoderException;
import com.raytheon.edex.plugin.taf.common.ChangeGroup; import com.raytheon.uf.common.dataplugin.taf.ChangeGroup;
import com.raytheon.edex.plugin.taf.common.TafPeriod; import com.raytheon.uf.common.dataplugin.taf.TAFParts;
import com.raytheon.edex.plugin.taf.common.TafRecord; import com.raytheon.uf.common.dataplugin.taf.TafConstants;
import com.raytheon.uf.common.dataplugin.taf.TafPeriod;
import com.raytheon.uf.common.dataplugin.taf.TafRecord;
import com.raytheon.uf.common.pointdata.spatial.ObStation; import com.raytheon.uf.common.pointdata.spatial.ObStation;
import com.raytheon.uf.common.time.DataTime; import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.TimeRange;
@ -70,6 +58,8 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
* Oct 21, 2008 1515 jkorman Added 30 Hour capability changes. * Oct 21, 2008 1515 jkorman Added 30 Hour capability changes.
* Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin * Feb 27, 2013 1638 mschenke Moved ObStationDao to edex pointdata plugin
* May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage * May 14, 2014 2536 bclement moved WMO Header to common, removed TimeTools usage
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* Refactored Strings to Patterns in TafConstants.
* </pre> * </pre>
* *
* @author jkorman * @author jkorman
@ -83,7 +73,8 @@ public class TAFParser {
// COR hhmm // COR hhmm
// AMD hhmm // AMD hhmm
// 01234567 // 01234567
private static final String AMD_COR_TIME = "(" + AMD_IND + "|" + COR_IND private static final String AMD_COR_TIME = "(" + TafConstants.AMD_IND + "|"
+ TafConstants.COR_IND
+ ") \\d{4}"; + ") \\d{4}";
private static final int HOUR_START = 4; private static final int HOUR_START = 4;
@ -218,10 +209,10 @@ public class TAFParser {
record.setWmoHeader(header.getWmoHeader()); record.setWmoHeader(header.getWmoHeader());
if (isAMD) { if (isAMD) {
record.setAmdIndicator(AMD_IND); record.setAmdIndicator(TafConstants.AMD_IND);
} }
if (isCOR) { if (isCOR) {
record.setCorIndicator(COR_IND); record.setCorIndicator(TafConstants.COR_IND);
} }
ObStation location = null; ObStation location = null;
@ -251,12 +242,12 @@ public class TAFParser {
record = new TafRecord(); record = new TafRecord();
Pattern headerPattern = Pattern.compile(REPORT_HEADER);
Matcher matcher = headerPattern.matcher(tafParts.getTafHeader()); Matcher matcher = TafConstants.REPORT_HEADER.matcher(tafParts
.getTafHeader());
if (matcher.find()) { if (matcher.find()) {
String s = matcher.group(STATION_ID); String s = matcher.group(TafSeparator.STATION_ID);
if (s != null) { if (s != null) {
record.setStationId(s); record.setStationId(s);
} else { } else {
@ -264,7 +255,7 @@ public class TAFParser {
return; return;
} }
s = matcher.group(ISSUE_TIME); s = matcher.group(TafSeparator.ISSUE_TIME);
if (s != null) { if (s != null) {
issueDate = transformDate(s, header); issueDate = transformDate(s, header);
issueDate.set(Calendar.MILLISECOND, 0); issueDate.set(Calendar.MILLISECOND, 0);
@ -273,8 +264,10 @@ public class TAFParser {
// date-time. So we need to create one. // date-time. So we need to create one.
// Create an issue time from the valid period data. // Create an issue time from the valid period data.
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(matcher.group(VALID_TIME).substring(0, 2)); sb.append(matcher.group(TafSeparator.VALID_TIME)
sb.append(matcher.group(VALID_TIME).substring(2, 4)); .substring(0, 2));
sb.append(matcher.group(TafSeparator.VALID_TIME)
.substring(2, 4));
sb.append("00Z"); sb.append("00Z");
issueDate = transformDate(sb.toString(), header); issueDate = transformDate(sb.toString(), header);
issueDate.set(Calendar.MILLISECOND, 0); issueDate.set(Calendar.MILLISECOND, 0);
@ -285,10 +278,10 @@ public class TAFParser {
checkAMDCOR(issueDate, tafParts.getTafBody()); checkAMDCOR(issueDate, tafParts.getTafBody());
s = tafParts.getTafHeader(); s = tafParts.getTafHeader();
if (!isCOR) { if (!isCOR) {
isCOR = s.indexOf(COR_IND) >= 0; isCOR = s.indexOf(TafConstants.COR_IND) >= 0;
} }
if (!isAMD) { if (!isAMD) {
isAMD = s.indexOf(AMD_IND) >= 0; isAMD = s.indexOf(TafConstants.AMD_IND) >= 0;
} }
record.setIssue_time(issueDate.getTime()); record.setIssue_time(issueDate.getTime());
@ -402,8 +395,8 @@ public class TAFParser {
issueDate = null; issueDate = null;
} }
} }
isCOR = s.indexOf(COR_IND) >= 0; isCOR = s.indexOf(TafConstants.COR_IND) >= 0;
isAMD = s.indexOf(AMD_IND) >= 0; isAMD = s.indexOf(TafConstants.AMD_IND) >= 0;
} }
return issueDate; return issueDate;
} }
@ -438,8 +431,7 @@ public class TAFParser {
String reportBody = sb.toString(); String reportBody = sb.toString();
Pattern p = Pattern.compile(CHANGE_GROUP_EXP); Matcher m = TafConstants.CHANGE_GROUP_EXP.matcher(reportBody);
Matcher m = p.matcher(reportBody);
// Collect all of the start positions // Collect all of the start positions
ArrayList<Integer> positions = new ArrayList<Integer>(); ArrayList<Integer> positions = new ArrayList<Integer>();
@ -484,9 +476,9 @@ public class TAFParser {
*/ */
public static boolean isChangeGroup(String groupValue) { public static boolean isChangeGroup(String groupValue) {
boolean isTemp = CG_FM.equals(groupValue); boolean isTemp = TafConstants.CG_FM.equals(groupValue);
isTemp = isTemp || CG_BECMG.equals(groupValue); isTemp = isTemp || TafConstants.CG_BECMG.equals(groupValue);
isTemp = isTemp || CG_INITIAL.equals(groupValue); isTemp = isTemp || TafConstants.CG_INITIAL.equals(groupValue);
return isTemp; return isTemp;
} }
@ -497,9 +489,9 @@ public class TAFParser {
*/ */
public static boolean isTempGroup(String groupValue) { public static boolean isTempGroup(String groupValue) {
boolean isTemp = CG_TEMPO.equals(groupValue); boolean isTemp = TafConstants.CG_TEMPO.equals(groupValue);
isTemp = isTemp || CG_PROB_TEMPO.equals(groupValue); isTemp = isTemp || TafConstants.CG_PROB_TEMPO.equals(groupValue);
isTemp = isTemp || CG_PROB.equals(groupValue); isTemp = isTemp || TafConstants.CG_PROB.equals(groupValue);
return isTemp; return isTemp;
} }
@ -521,10 +513,13 @@ public class TAFParser {
private static String formatTAF(String taf) { private static String formatTAF(String taf) {
StringBuilder sb = new StringBuilder(taf); StringBuilder sb = new StringBuilder(taf);
int n = 0; int n = 0;
String[] find = { "\r " + CG_FM, "\r " + CG_BECMG, "\r " + CG_TEMPO, String[] find = { "\r " + TafConstants.CG_FM,
"\r " + CG_PROB, }; "\r " + TafConstants.CG_BECMG, "\r " + TafConstants.CG_TEMPO,
String[] replace = { "\r " + CG_FM, "\r " + CG_BECMG, "\r " + TafConstants.CG_PROB, };
"\r " + CG_TEMPO, "\r " + CG_PROB, }; String[] replace = { "\r " + TafConstants.CG_FM,
"\r " + TafConstants.CG_BECMG,
"\r " + TafConstants.CG_TEMPO,
"\r " + TafConstants.CG_PROB, };
for (int i = 0; i < find.length; i++) { for (int i = 0; i < find.length; i++) {
while ((n = sb.indexOf(find[i])) >= 0) { while ((n = sb.indexOf(find[i])) >= 0) {
sb.replace(n, n + find[i].length(), replace[i]); sb.replace(n, n + find[i].length(), replace[i]);

View file

@ -17,15 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.decoder; package com.raytheon.uf.edex.plugin.taf.decoder;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_BECMG;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_FM;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_INITIAL;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_PROB_TEMPO;
import static com.raytheon.edex.plugin.taf.common.TafConstants.CG_TEMPO;
import static com.raytheon.edex.plugin.taf.decoder.TAFParser.cvtInt;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -33,8 +25,9 @@ import java.util.regex.Pattern;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.plugin.taf.common.ChangeGroup; import com.raytheon.uf.common.dataplugin.taf.ChangeGroup;
import com.raytheon.edex.plugin.taf.common.TafPeriod; import com.raytheon.uf.common.dataplugin.taf.TafConstants;
import com.raytheon.uf.common.dataplugin.taf.TafPeriod;
/** /**
* TODO Add Description * TODO Add Description
@ -45,6 +38,7 @@ import com.raytheon.edex.plugin.taf.common.TafPeriod;
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Oct 20, 2008 1515 jkorman Initial implementation to * Oct 20, 2008 1515 jkorman Initial implementation to
* add 30 Hour tafs. * add 30 Hour tafs.
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* </pre> * </pre>
* *
* @author jkorman * @author jkorman
@ -110,73 +104,73 @@ class TAFSubGroup {
Matcher m = PAT_PROBTEMPO.matcher(changeGroupHdr); Matcher m = PAT_PROBTEMPO.matcher(changeGroupHdr);
if (m.find()) { if (m.find()) {
changeGroupHeader = CG_PROB_TEMPO; changeGroupHeader = TafConstants.CG_PROB_TEMPO;
prob = Integer.decode(changeGroupHdr.substring(4, 5)); prob = Integer.decode(changeGroupHdr.substring(4, 5));
startDay = cvtInt(changeGroupHdr.substring(13, 15)); startDay = TAFParser.cvtInt(changeGroupHdr.substring(13, 15));
startHour = cvtInt(changeGroupHdr.substring(15, 17)); startHour = TAFParser.cvtInt(changeGroupHdr.substring(15, 17));
stopDay = cvtInt(changeGroupHdr.substring(18, 20)); stopDay = TAFParser.cvtInt(changeGroupHdr.substring(18, 20));
stopHour = cvtInt(changeGroupHdr.substring(20, 22)); stopHour = TAFParser.cvtInt(changeGroupHdr.substring(20, 22));
return; return;
} }
m = PAT_PROB.matcher(changeGroupHdr); m = PAT_PROB.matcher(changeGroupHdr);
if (m.find()) { if (m.find()) {
changeGroupHeader = CG_PROB; changeGroupHeader = TafConstants.CG_PROB;
prob = Integer.decode(changeGroupHdr.substring(4, 5)); prob = Integer.decode(changeGroupHdr.substring(4, 5));
startDay = cvtInt(changeGroupHdr.substring(7, 9)); startDay = TAFParser.cvtInt(changeGroupHdr.substring(7, 9));
startHour = cvtInt(changeGroupHdr.substring(9, 11)); startHour = TAFParser.cvtInt(changeGroupHdr.substring(9, 11));
stopDay = cvtInt(changeGroupHdr.substring(12, 14)); stopDay = TAFParser.cvtInt(changeGroupHdr.substring(12, 14));
stopHour = cvtInt(changeGroupHdr.substring(14, 16)); stopHour = TAFParser.cvtInt(changeGroupHdr.substring(14, 16));
return; return;
} }
m = PAT_TEMPO.matcher(changeGroupHdr); m = PAT_TEMPO.matcher(changeGroupHdr);
if (m.find()) { if (m.find()) {
changeGroupHeader = CG_TEMPO; changeGroupHeader = TafConstants.CG_TEMPO;
startDay = cvtInt(changeGroupHdr.substring(6, 8)); startDay = TAFParser.cvtInt(changeGroupHdr.substring(6, 8));
startHour = cvtInt(changeGroupHdr.substring(8, 10)); startHour = TAFParser.cvtInt(changeGroupHdr.substring(8, 10));
stopDay = cvtInt(changeGroupHdr.substring(11, 13)); stopDay = TAFParser.cvtInt(changeGroupHdr.substring(11, 13));
stopHour = cvtInt(changeGroupHdr.substring(13, 15)); stopHour = TAFParser.cvtInt(changeGroupHdr.substring(13, 15));
return; return;
} }
m = PAT_BECMG.matcher(changeGroupHdr); m = PAT_BECMG.matcher(changeGroupHdr);
if (m.find()) { if (m.find()) {
changeGroupHeader = CG_BECMG; changeGroupHeader = TafConstants.CG_BECMG;
startDay = cvtInt(changeGroupHdr.substring(6, 8)); startDay = TAFParser.cvtInt(changeGroupHdr.substring(6, 8));
startHour = cvtInt(changeGroupHdr.substring(8, 10)); startHour = TAFParser.cvtInt(changeGroupHdr.substring(8, 10));
stopDay = cvtInt(changeGroupHdr.substring(11, 13)); stopDay = TAFParser.cvtInt(changeGroupHdr.substring(11, 13));
stopHour = cvtInt(changeGroupHdr.substring(13, 15)); stopHour = TAFParser.cvtInt(changeGroupHdr.substring(13, 15));
return; return;
} }
m = PAT_FM.matcher(changeGroupHdr); m = PAT_FM.matcher(changeGroupHdr);
if (m.find()) { if (m.find()) {
changeGroupHeader = CG_FM; changeGroupHeader = TafConstants.CG_FM;
startDay = cvtInt(changeGroupHdr.substring(2, 4)); startDay = TAFParser.cvtInt(changeGroupHdr.substring(2, 4));
startHour = cvtInt(changeGroupHdr.substring(4, 6)); startHour = TAFParser.cvtInt(changeGroupHdr.substring(4, 6));
startMin = cvtInt(changeGroupHdr.substring(6, 8)); startMin = TAFParser.cvtInt(changeGroupHdr.substring(6, 8));
return; return;
} }
changeGroupHeader = CG_INITIAL; changeGroupHeader = TafConstants.CG_INITIAL;
extension = changeGroupHdr; extension = changeGroupHdr;
int pos = changeGroupHdr.length() - "DDMM/DDMM".length(); int pos = changeGroupHdr.length() - "DDMM/DDMM".length();
startDay = cvtInt(changeGroupHdr.substring(pos, pos + 2)); startDay = TAFParser.cvtInt(changeGroupHdr.substring(pos, pos + 2));
pos += 2; pos += 2;
startHour = cvtInt(changeGroupHdr.substring(pos, pos + 2)); startHour = TAFParser.cvtInt(changeGroupHdr.substring(pos, pos + 2));
pos += 3; pos += 3;
stopDay = cvtInt(changeGroupHdr.substring(pos, pos + 2)); stopDay = TAFParser.cvtInt(changeGroupHdr.substring(pos, pos + 2));
pos += 2; pos += 2;
stopHour = cvtInt(changeGroupHdr.substring(pos, pos + 2)); stopHour = TAFParser.cvtInt(changeGroupHdr.substring(pos, pos + 2));
} }
/** /**
@ -219,23 +213,23 @@ class TAFSubGroup {
ChangeGroup chgGroup = null; ChangeGroup chgGroup = null;
TafPeriod period = null; TafPeriod period = null;
if (CG_FM.equals(changeGroupHeader)) { if (TafConstants.CG_FM.equals(changeGroupHeader)) {
period = TafPeriod.determineChangeGroupPeriodDDhhmm(startDay period = TafPeriod.determineChangeGroupPeriodDDhhmm(startDay
.intValue(), startHour.intValue(), startMin.intValue(), .intValue(), startHour.intValue(), startMin.intValue(),
issueTime); issueTime);
} else if (CG_BECMG.equals(changeGroupHeader)) { } else if (TafConstants.CG_BECMG.equals(changeGroupHeader)) {
period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay
.intValue(), startHour.intValue(), stopDay.intValue(), .intValue(), startHour.intValue(), stopDay.intValue(),
stopHour.intValue(), issueTime, true); stopHour.intValue(), issueTime, true);
} else if (CG_PROB.equals(changeGroupHeader)) { } else if (TafConstants.CG_PROB.equals(changeGroupHeader)) {
period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay
.intValue(), startHour.intValue(), stopDay.intValue(), .intValue(), startHour.intValue(), stopDay.intValue(),
stopHour.intValue(), issueTime, false); stopHour.intValue(), issueTime, false);
} else if (CG_PROB_TEMPO.equals(changeGroupHeader)) { } else if (TafConstants.CG_PROB_TEMPO.equals(changeGroupHeader)) {
period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay
.intValue(), startHour.intValue(), stopDay.intValue(), .intValue(), startHour.intValue(), stopDay.intValue(),
stopHour.intValue(), issueTime, false); stopHour.intValue(), issueTime, false);
} else if (CG_TEMPO.equals(changeGroupHeader)) { } else if (TafConstants.CG_TEMPO.equals(changeGroupHeader)) {
period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay period = TafPeriod.determineChangeGroupPeriodDDhhDDhh(startDay
.intValue(), startHour.intValue(), stopDay.intValue(), .intValue(), startHour.intValue(), stopDay.intValue(),
stopHour.intValue(), issueTime, false); stopHour.intValue(), issueTime, false);

View file

@ -17,13 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information. * further licensing information.
**/ **/
package com.raytheon.edex.plugin.taf.decoder; package com.raytheon.uf.edex.plugin.taf.decoder;
import static com.raytheon.edex.plugin.taf.common.TafConstants.AMD_IND;
import static com.raytheon.edex.plugin.taf.common.TafConstants.COR_IND;
import static com.raytheon.edex.plugin.taf.common.TafConstants.REPORT_HEADER;
import static com.raytheon.edex.plugin.taf.common.TafConstants.REPORT_HEADER30;
import static com.raytheon.edex.plugin.taf.common.TafConstants.TAF_IND;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -35,9 +29,11 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.esb.Headers; import com.raytheon.edex.esb.Headers;
import com.raytheon.edex.plugin.AbstractRecordSeparator; import com.raytheon.edex.plugin.AbstractRecordSeparator;
import com.raytheon.edex.plugin.taf.TafDecoder; import com.raytheon.uf.common.dataplugin.taf.TAFParts;
import com.raytheon.uf.common.dataplugin.taf.TafConstants;
import com.raytheon.uf.common.wmo.WMOHeader; import com.raytheon.uf.common.wmo.WMOHeader;
import com.raytheon.uf.edex.decodertools.core.DecoderTools; import com.raytheon.uf.edex.decodertools.core.DecoderTools;
import com.raytheon.uf.edex.plugin.taf.TafDecoder;
/** /**
* *
@ -53,6 +49,7 @@ import com.raytheon.uf.edex.decodertools.core.DecoderTools;
* and amended records * and amended records
* 9/4/2008 1444 grichard Move constants to TafConstants class. * 9/4/2008 1444 grichard Move constants to TafConstants class.
* May 14, 2014 2536 bclement moved WMO Header to common * May 14, 2014 2536 bclement moved WMO Header to common
* May 15, 2014 3002 bgonzale Moved common taf code to com.raytheon.uf.common.dataplugin.taf.
* *
* *
* </pre> * </pre>
@ -65,11 +62,14 @@ public class TafSeparator extends AbstractRecordSeparator {
private final Log logger = LogFactory.getLog(getClass()); private final Log logger = LogFactory.getLog(getClass());
private static final String TEMPO_EXC = "EMPO (\\d{4}/\\d{4})"; private static final Pattern TEMPO_EXC = Pattern
.compile("EMPO (\\d{4}/\\d{4})");
private static final String BECMG_EXC = "ECMG (\\d{4}/\\d{4})"; private static final Pattern BECMG_EXC = Pattern
.compile("ECMG (\\d{4}/\\d{4})");
private static final String PROB_EXC = "OB[34]0 (\\d{4}/\\d{4})"; private static final Pattern PROB_EXC = Pattern
.compile("OB[34]0 (\\d{4}/\\d{4})");
public static final int STATION_ID = 4; public static final int STATION_ID = 4;
@ -178,20 +178,18 @@ public class TafSeparator extends AbstractRecordSeparator {
if (m.find()) { if (m.find()) {
int pos = 0; int pos = 0;
if (!isAmd) { if (!isAmd) {
pos = s.indexOf(AMD_IND); pos = s.indexOf(TafConstants.AMD_IND);
isAmd = ((pos >= 0) && (pos <= m.end())); isAmd = ((pos >= 0) && (pos <= m.end()));
} }
if (!isCor) { if (!isCor) {
pos = s.indexOf(COR_IND); pos = s.indexOf(TafConstants.COR_IND);
isCor = ((pos >= 0) && (pos <= m.end())); isCor = ((pos >= 0) && (pos <= m.end()));
} }
} }
ArrayList<Integer> partPos = new ArrayList<Integer>(); ArrayList<Integer> partPos = new ArrayList<Integer>();
Pattern p = Pattern.compile(REPORT_HEADER); m = TafConstants.REPORT_HEADER.matcher(s);
m = p.matcher(s);
if (m.find()) { if (m.find()) {
partPos.add(m.start()); partPos.add(m.start());
@ -210,14 +208,9 @@ public class TafSeparator extends AbstractRecordSeparator {
} }
partPos.add(s.length()); partPos.add(s.length());
} else { } else {
p = Pattern.compile(REPORT_HEADER30);
Pattern pT = Pattern.compile(TEMPO_EXC);
Pattern pB = Pattern.compile(BECMG_EXC);
Pattern pP = Pattern.compile(PROB_EXC);
Matcher m1 = null; Matcher m1 = null;
m = p.matcher(s); m = TafConstants.REPORT_HEADER30.matcher(s);
if (m.find()) { if (m.find()) {
int start = m.start(); int start = m.start();
int stop = m.end(); int stop = m.end();
@ -233,15 +226,15 @@ public class TafSeparator extends AbstractRecordSeparator {
// The TEMPO, BECMG, and PROB patterns can match the // The TEMPO, BECMG, and PROB patterns can match the
// start // start
// of a taf so skip if there's a match. // of a taf so skip if there's a match.
m1 = pT.matcher(s.substring(start, stop)); m1 = TEMPO_EXC.matcher(s.substring(start, stop));
if (m1.find()) { if (m1.find()) {
continue; continue;
} }
m1 = pB.matcher(s.substring(start, stop)); m1 = BECMG_EXC.matcher(s.substring(start, stop));
if (m1.find()) { if (m1.find()) {
continue; continue;
} }
m1 = pP.matcher(s.substring(start, stop)); m1 = PROB_EXC.matcher(s.substring(start, stop));
if (m1.find()) { if (m1.find()) {
continue; continue;
} }
@ -264,19 +257,21 @@ public class TafSeparator extends AbstractRecordSeparator {
StringBuilder tafHdr = new StringBuilder(s.substring( StringBuilder tafHdr = new StringBuilder(s.substring(
partPos.get(i), partPos.get(i + 1))); partPos.get(i), partPos.get(i + 1)));
if ((isCor) && (tafHdr.indexOf(COR_IND) < 0)) { if ((isCor)
&& (tafHdr.indexOf(TafConstants.COR_IND) < 0)) {
tafHdr.insert(0, ' '); tafHdr.insert(0, ' ');
tafHdr.insert(0, COR_IND); tafHdr.insert(0, TafConstants.COR_IND);
} }
if ((isAmd) && (tafHdr.indexOf(AMD_IND) < 0)) { if ((isAmd)
&& (tafHdr.indexOf(TafConstants.AMD_IND) < 0)) {
tafHdr.insert(0, ' '); tafHdr.insert(0, ' ');
tafHdr.insert(0, AMD_IND); tafHdr.insert(0, TafConstants.AMD_IND);
} }
if (tafHdr.indexOf(TAF_IND) < 0) { if (tafHdr.indexOf(TafConstants.TAF_IND) < 0) {
tafHdr.insert(0, ' '); tafHdr.insert(0, ' ');
tafHdr.insert(0, TAF_IND); tafHdr.insert(0, TafConstants.TAF_IND);
} }
parts.setTafHeader(tafHdr.toString()); parts.setTafHeader(tafHdr.toString());

View file

@ -20,4 +20,4 @@
/** /**
* Contains TAF decoder implementation detail classes. * Contains TAF decoder implementation detail classes.
*/ */
package com.raytheon.edex.plugin.taf.decoder; package com.raytheon.uf.edex.plugin.taf.decoder;

View file

@ -24,4 +24,4 @@
* and common packages. * and common packages.
* *
*/ */
package com.raytheon.edex.plugin.taf; package com.raytheon.uf.edex.plugin.taf;