Issue #2860 - Implement the redbook upper air model graphics and cpc charts for NDM

Change-Id: If01865b85f7ed18edea63757426cb76e44587b0e

Former-commit-id: 4ae763f1f1865d7c16eefb8d3647e3f94c5c1c22
This commit is contained in:
Mike Duff 2014-03-19 16:58:59 -05:00
parent aa689e99c4
commit 418c80640e
9 changed files with 225 additions and 50 deletions

View file

@ -113,54 +113,8 @@
<substitute key="plotModelFile" value="raobLowerDesign"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="Model Graphics">
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="UKMO 500 hgt" id="uaUKMO500hgt">
<substitute key="wmo" value="PHZM50, PHZO50, PHZQ50"/>
</contribute>
<contribute xsi:type="separator" id="MySeparatorId"/>
<contribute xsi:type="titleItem" titleText="------ Trajectories ------" />
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="NGM Sfc Parcel" id="uaNGMSfcParcel">
<dataURI>/redbook/%/PMNE98/%</dataURI>
<substitute key="wmo" value="PMNE98"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="NGM 850 Parcel" id="uaNGM850Parcel">
<dataURI>/redbook/%/PMNE85/%</dataURI>
<substitute key="wmo" value="PMNE85"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="NGM 700 Parcel" id="uaNGM700Parcel">
<dataURI>/redbook/%/PMNE70/%</dataURI>
<substitute key="wmo" value="PMNE70"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="12hr Vert Displacement" id="ua12hrVertDisplacement">
<substitute key="wmo" value="PJME07, PJMG07, PJMI07"/>
</contribute>
</contribute>
<contribute xsi:type="subMenu" menuText="CPC Charts">
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="6-10 day mean 500 Hgt" id="ua610daymean500Hgt">
<dataURI>/redbook/%/PHBV50/%</dataURI>
<substitute key="wmo" value="PHBV50"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="8-14 day Mean 500 Hgt" id="ua814dayMean500Hgt">
<dataURI>/redbook/%/PHTT50/%</dataURI>
<substitute key="wmo" value="PHTT50"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="6-10 day 500 Hgt Anomaly" id="ua610day500HgtAnomaly">
<dataURI>/redbook/%/PHNT50/%</dataURI>
<substitute key="wmo" value="PHNT50"/>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/Redbook.xml"
menuText="8-14 day 500 Anom" id="ua814day500Anom">
<dataURI>/redbook/%/PHTT51/%</dataURI>
<substitute key="wmo" value="PHTT51"/>
</contribute>
</contribute>
<contribute xsi:type="subinclude" fileName="menus/upperair/uaMenus.xml"/>
<contribute xsi:type="separator" id="MySeparatorId"/>
</menuTemplate>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<menuTemplate>
<contribute xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="subMenu" menuText="Model Graphics" id="modelGraphics">
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="UKMO 500 hgt" timeQuery="true" id="uaUKMO500hgt">
<substitute value="PHZM50, PHZO50, PHZQ50" key="wmo"/>
</contribute>
</contribute>
<contribute xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="subMenu" menuText="CPC Charts" id="cpcCharts">
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="6-10 day mean 500 Hgt" timeQuery="true" id="ua610daymean500Hgt">
<substitute value="PHBV50" key="wmo"/>
</contribute>
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="8-14 day Mean 500 Hgt" timeQuery="true" id="ua814dayMean500Hgt">
<substitute value="PHTT50" key="wmo"/>
</contribute>
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="6-10 day 500 Hgt Anomaly" timeQuery="true" id="ua610day500HgtAnomaly">
<substitute value="PHNT50" key="wmo"/>
</contribute>
<contribute xsi:type="bundleItem" useReferenceTime="true" file="bundles/Redbook.xml" menuText="8-14 day 500 Anom" timeQuery="true" id="ua814day500Anom">
<substitute value="PHTT51" key="wmo"/>
</contribute>
</contribute>
</menuTemplate>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
This file is the A2 NDM replacement for redbookUpperAirMenus.txt.
Dropping RedbookUAMenus.xml into the /awips2/edex/data/ndm directory
will generate an override of the Upper Air NDM menu.
RedbookUAMenus.xml as written here will generate the base version
of the Upper Air NDM menus.
-->
<redbookMenu>
<menuEntry type="submenu" text="Model Graphics">
<menuEntry type="productButton"
text="UKMO 500 hgt" id="uaUKMO500hgt">
<menuEntry type="substitute" key="wmo" value="PHZM50, PHZO50, PHZQ50"/>
</menuEntry>
</menuEntry>
<menuEntry type="submenu" text="CPC Charts">
<menuEntry type="productButton"
text="6-10 day mean 500 Hgt" id="ua610daymean500Hgt">
<menuEntry type="dataURI">/redbook/%/PHBV50/%</menuEntry>
<menuEntry type="substitute" key="wmo" value="PHBV50"/>
</menuEntry>
<menuEntry type="productButton"
text="8-14 day Mean 500 Hgt" id="ua814dayMean500Hgt">
<menuEntry type="dataURI">/redbook/%/PHTT50/%</menuEntry>
<menuEntry type="substitute" key="wmo" value="PHTT50"/>
</menuEntry>
<menuEntry type="productButton"
text="6-10 day 500 Hgt Anomaly" id="ua610day500HgtAnomaly">
<menuEntry type="dataURI">/redbook/%/PHNT50/%</menuEntry>
<menuEntry type="substitute" key="wmo" value="PHNT50"/>
</menuEntry>
<menuEntry type="productButton"
text="8-14 day 500 Anom" id="ua814day500Anom">
<menuEntry type="dataURI">/redbook/%/PHTT51/%</menuEntry>
<menuEntry type="substitute" key="wmo" value="PHTT51"/>
</menuEntry>
</menuEntry>
</redbookMenu>

View file

@ -40,6 +40,11 @@
<constructor-arg ref="spcMenuListener" />
</bean>
<bean factory-bean="ndmProc" factory-method="registerListener">
<constructor-arg value="RedbookUAMenus.xml" />
<constructor-arg ref="spcMenuListener" />
</bean>
<!--
<bean id="redbookCamelRegistered" factory-bean="contextManager"
factory-method="register" depends-on="persistCamelRegistered">

View file

@ -26,6 +26,7 @@ import com.raytheon.edex.plugin.redbook.menu.RedbookHazardsMenuUtil;
import com.raytheon.edex.plugin.redbook.menu.RedbookHpcMenuUtil;
import com.raytheon.edex.plugin.redbook.menu.RedbookMpcMenuUtil;
import com.raytheon.edex.plugin.redbook.menu.RedbookNcoMenuUtil;
import com.raytheon.edex.plugin.redbook.menu.RedbookUaMenuUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.ndm.ingest.INationalDatasetSubscriber;
@ -45,6 +46,7 @@ import com.raytheon.uf.edex.ndm.ingest.INationalDatasetSubscriber;
* Mar 17, 2014 2856 mpduff Implement CPC.
* Mar 19, 2014 2857 mpduff Implement NCO.
* Mar 19, 2014 2859 mpduff Implement MPC.
* Mar 19, 2014 2860 mpduff Implement Upper Air.
*
* </pre>
*
@ -72,6 +74,9 @@ public class RedbookMenuSubscriber implements INationalDatasetSubscriber {
/** NCO menu file */
private static final String NCO_MENU_FILE = "RedbookNCOMenus.xml";
/** Upper air menu file */
private static final String UA_MENU_FILE = "RedbookUAMenus.xml";
/**
* {@inheritDoc}
*/
@ -90,9 +95,13 @@ public class RedbookMenuSubscriber implements INationalDatasetSubscriber {
menuUtil.createMenusFromFile(file.getAbsolutePath());
} else if (MPC_MENU_FILE.equals(fileName)) {
RedbookMpcMenuUtil menuUtil = new RedbookMpcMenuUtil();
menuUtil.createMenusFromFile(file.getAbsolutePath());
} else if (NCO_MENU_FILE.equals(fileName)) {
RedbookNcoMenuUtil menuUtil = new RedbookNcoMenuUtil();
menuUtil.createMenusFromFile(file.getAbsolutePath());
} else if (UA_MENU_FILE.equals(fileName)) {
RedbookUaMenuUtil menuUtil = new RedbookUaMenuUtil();
menuUtil.createMenusFromFile(file.getAbsolutePath());
}
}
}

View file

@ -38,6 +38,7 @@ import javax.xml.bind.annotation.XmlElements;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 12, 2014 2855 mpduff Initial creation
* Mar 19, 2014 2860 mpduff Added DataUri.
*
* </pre>
*
@ -83,6 +84,12 @@ public class MenuEntry {
@XmlAttribute(name = "file")
protected String file = "bundles/Redbook.xml";
/**
* The data uri value
*/
@XmlElement(name = "dataUri")
protected String dataUri;
/**
* List of MenuEntry items
*/
@ -205,6 +212,21 @@ public class MenuEntry {
this.menuEntryList = menuEntryList;
}
/**
* @return the dataUri
*/
public String getDataUri() {
return dataUri;
}
/**
* @param dataUri
* the dataUri to set
*/
public void setDataUri(String dataUri) {
this.dataUri = dataUri;
}
/*
* (non-Javadoc)
*
@ -231,6 +253,9 @@ public class MenuEntry {
if (value != null) {
sb.append(" Value: ").append(this.value).append(nl);
}
if (this.dataUri != null) {
sb.append("DataURI: ").append(this.dataUri).append(nl);
}
sb.append(" File: ").append(this.file).append(nl);

View file

@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlType;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 12, 2014 2855 mpduff Initial creation
* Mar 19, 2014 2860 mpduff Add DataURI as a type.
*
* </pre>
*
@ -60,7 +61,11 @@ public enum MenuEntryType {
/** Menu Title type */
@XmlEnumValue("title")
Title("title");
Title("title"),
/** Data URI type */
@XmlEnumValue("dataUri")
DataUri("dataUri");
/** Menu entry type */
private String entryType;

View file

@ -53,6 +53,7 @@ import com.raytheon.uf.edex.menus.AbstractMenuUtil;
* ------------ ---------- ----------- --------------------------
* Mar 07, 2014 2858 mpduff Initial creation
* Mar 14, 2014 2855 mpduff Refactored common code.
* Mar 19, 2014 2860 mpduff Implemented Redbook UpperAir.
*
* </pre>
*
@ -65,6 +66,10 @@ public abstract class RedbookMenuUtil extends AbstractMenuUtil {
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(RedbookMenuUtil.class);
protected static final String NCEP_HYDRO = "ncepHydro";
protected static final String MENUS = "menus";
/** Jaxb unmarshaller */
protected Unmarshaller unmarshaller;
@ -172,8 +177,26 @@ public abstract class RedbookMenuUtil extends AbstractMenuUtil {
subList.add(var);
}
List<String> dataUriList = new ArrayList<String>();
for (MenuEntry me : menuEntry.getMenuEntryList()) {
if (MenuEntryType.Substitute == me.getType()) {
VariableSubstitution var = new VariableSubstitution();
var.key = me.getKey();
var.value = me.getValue();
statusHandler.info("Substitution: " + var.key + " <> "
+ var.value);
subList.add(var);
} else if (MenuEntryType.DataUri == me.getType()) {
dataUriList.add(me.getDataUri());
}
}
commonBundleMenuContribution.substitutions = subList
.toArray(new VariableSubstitution[subList.size()]);
commonBundleMenuContribution.dataURIs = dataUriList
.toArray(new String[dataUriList.size()]);
}
return commonBundleMenuContribution;

View file

@ -0,0 +1,92 @@
/**
* 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.
**/
package com.raytheon.edex.plugin.redbook.menu;
import java.io.File;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
/**
* Builds the NCEP/Hydro Upper Air menu contributions for NDM (Redbook UA).
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 19, 2014 2860 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class RedbookUaMenuUtil extends RedbookMenuUtil {
/** Status handler */
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(RedbookUaMenuUtil.class);
/** Menu type constant */
private static final String MENU_TYPE = "upperair";
/** HPC menu file */
private static final String UA_MENU = "uaMenus.xml";
/** HPC menu file full path */
private static final String MENU_FILE = MENUS + File.separator + MENU_TYPE
+ File.separator + UA_MENU;
/**
* Constructor.
*/
public RedbookUaMenuUtil() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public void createMenusFromFile(String filename) {
xml = read(filename);
createMenus();
}
/**
* {@inheritDoc}
*/
@Override
public void createMenus() {
statusHandler.info("Creating menus for " + MENU_FILE);
createMenusForFile(MENU_FILE);
}
/**
* {@inheritDoc}
*/
@Override
protected boolean checkCreated() {
return super.checkCreated(UA_MENU, MENU_TYPE);
}
}