13.2.1-3 baseline
Former-commit-id: ba03739c3528638c5383528fd64674ae5af1ed64
This commit is contained in:
parent
328c6dccad
commit
2b6ac028bd
19 changed files with 754 additions and 88 deletions
|
@ -85,7 +85,7 @@
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping key="primaryElevationAngle">
|
<mapping key="primaryElevationAngle">
|
||||||
<constraint constraintValue="${elevation1}"
|
<constraint constraintValue="${elevation1}"
|
||||||
constraintType="IN" />
|
constraintType="BETWEEN" />
|
||||||
</mapping>
|
</mapping>
|
||||||
</metadataMap>
|
</metadataMap>
|
||||||
</resourceData>
|
</resourceData>
|
||||||
|
@ -119,7 +119,7 @@
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping key="primaryElevationAngle">
|
<mapping key="primaryElevationAngle">
|
||||||
<constraint constraintValue="${elevation1}"
|
<constraint constraintValue="${elevation1}"
|
||||||
constraintType="IN" />
|
constraintType="BETWEEN" />
|
||||||
</mapping>
|
</mapping>
|
||||||
</metadataMap>
|
</metadataMap>
|
||||||
</resourceData>
|
</resourceData>
|
||||||
|
@ -173,7 +173,7 @@
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping key="primaryElevationAngle">
|
<mapping key="primaryElevationAngle">
|
||||||
<constraint constraintValue="${elevation2}"
|
<constraint constraintValue="${elevation2}"
|
||||||
constraintType="IN" />
|
constraintType="BETWEEN" />
|
||||||
</mapping>
|
</mapping>
|
||||||
</metadataMap>
|
</metadataMap>
|
||||||
</resourceData>
|
</resourceData>
|
||||||
|
@ -207,7 +207,7 @@
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping key="primaryElevationAngle">
|
<mapping key="primaryElevationAngle">
|
||||||
<constraint constraintValue="${elevation2}"
|
<constraint constraintValue="${elevation2}"
|
||||||
constraintType="IN" />
|
constraintType="BETWEEN" />
|
||||||
</mapping>
|
</mapping>
|
||||||
</metadataMap>
|
</metadataMap>
|
||||||
</resourceData>
|
</resourceData>
|
||||||
|
@ -256,7 +256,7 @@
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping key="primaryElevationAngle">
|
<mapping key="primaryElevationAngle">
|
||||||
<constraint constraintValue="${elevation4}"
|
<constraint constraintValue="${elevation4}"
|
||||||
constraintType="IN" />
|
constraintType="BETWEEN" />
|
||||||
</mapping>
|
</mapping>
|
||||||
</metadataMap>
|
</metadataMap>
|
||||||
</resourceData>
|
</resourceData>
|
||||||
|
@ -290,7 +290,7 @@
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping key="primaryElevationAngle">
|
<mapping key="primaryElevationAngle">
|
||||||
<constraint constraintValue="${elevation4}"
|
<constraint constraintValue="${elevation4}"
|
||||||
constraintType="IN" />
|
constraintType="BETWEEN" />
|
||||||
</mapping>
|
</mapping>
|
||||||
</metadataMap>
|
</metadataMap>
|
||||||
</resourceData>
|
</resourceData>
|
||||||
|
@ -344,7 +344,7 @@
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping key="primaryElevationAngle">
|
<mapping key="primaryElevationAngle">
|
||||||
<constraint constraintValue="${elevation3}"
|
<constraint constraintValue="${elevation3}"
|
||||||
constraintType="IN" />
|
constraintType="BETWEEN" />
|
||||||
</mapping>
|
</mapping>
|
||||||
</metadataMap>
|
</metadataMap>
|
||||||
</resourceData>
|
</resourceData>
|
||||||
|
@ -378,7 +378,7 @@
|
||||||
</mapping>
|
</mapping>
|
||||||
<mapping key="primaryElevationAngle">
|
<mapping key="primaryElevationAngle">
|
||||||
<constraint constraintValue="${elevation3}"
|
<constraint constraintValue="${elevation3}"
|
||||||
constraintType="IN" />
|
constraintType="BETWEEN" />
|
||||||
</mapping>
|
</mapping>
|
||||||
</metadataMap>
|
</metadataMap>
|
||||||
</resourceData>
|
</resourceData>
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
<substitute key="stationId" value="72233"/>
|
<substitute key="stationId" value="72233"/>
|
||||||
</contribute>
|
</contribute>
|
||||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
|
<contribute xsi:type="bundleItem" file="bundles/UpperAirRaob.xml"
|
||||||
menuText="Wash-Dulles, VA (KLWX)" id="raobWash-Dulles"
|
menuText="Wash-Dulles, VA (KIAD)" id="raobWash-Dulles"
|
||||||
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
|
editorType="gov.noaa.nws.ncep.ui.nsharp.display.NsharpEditor">
|
||||||
<substitute key="stationId" value="72403"/>
|
<substitute key="stationId" value="72403"/>
|
||||||
</contribute>
|
</contribute>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
|
|
||||||
package com.raytheon.viz.gfe.actions;
|
package com.raytheon.viz.gfe.actions;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import com.raytheon.viz.gfe.Activator;
|
import com.raytheon.viz.gfe.Activator;
|
||||||
import org.eclipse.core.commands.AbstractHandler;
|
import org.eclipse.core.commands.AbstractHandler;
|
||||||
import org.eclipse.core.commands.ExecutionEvent;
|
import org.eclipse.core.commands.ExecutionEvent;
|
||||||
|
@ -29,9 +31,8 @@ import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import com.raytheon.viz.gfe.core.msgs.Message;
|
import com.raytheon.viz.gfe.core.msgs.Message;
|
||||||
import com.raytheon.viz.gfe.core.msgs.ShowISCGridsMsg;
|
import com.raytheon.viz.gfe.core.msgs.ShowISCGridsMsg;
|
||||||
|
|
||||||
import org.eclipse.swt.graphics.Image;
|
import org.eclipse.ui.commands.IElementUpdater;
|
||||||
import org.eclipse.swt.widgets.Event;
|
import org.eclipse.ui.menus.UIElement;
|
||||||
import org.eclipse.swt.widgets.ToolItem;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action to show the ISC grids
|
* Action to show the ISC grids
|
||||||
|
@ -44,44 +45,47 @@ import org.eclipse.swt.widgets.ToolItem;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 07/20/09 1995 bphillip Initial release
|
* 07/20/09 1995 bphillip Initial release
|
||||||
* 12/06/12 DR 15574 jzeng Change the image of
|
* 12/06/12 DR 15574 jzeng Change the image of
|
||||||
* the icon when it is activated
|
* the icon when it is activated
|
||||||
* 01/11/13 DR 15574 jzeng delete all fields to local variables
|
* 01/11/13 DR 15574 jzeng Change all fields to local variables
|
||||||
|
* 01/16/13 DR 15722 jzeng/randerson override updateElement()
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bphillip
|
* @author bphillip
|
||||||
* @version 1
|
* @version 1
|
||||||
*/
|
*/
|
||||||
public class ShowISCGridsAction extends AbstractHandler {
|
public class ShowISCGridsAction extends AbstractHandler implements
|
||||||
|
IElementUpdater {
|
||||||
|
|
||||||
@Override
|
|
||||||
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
boolean current = Message.inquireLastMessage(ShowISCGridsMsg.class).show();
|
boolean current = Message.inquireLastMessage(ShowISCGridsMsg.class)
|
||||||
|
.show();
|
||||||
if (arg0.getTrigger() instanceof Event) {
|
|
||||||
Event e = (Event) arg0.getTrigger();
|
|
||||||
if ( e.widget instanceof ToolItem) {
|
|
||||||
ToolItem ti = (ToolItem) e.widget;
|
|
||||||
if (ti != null ){
|
|
||||||
ImageDescriptor id;
|
|
||||||
|
|
||||||
if (!current){
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
|
||||||
Activator.PLUGIN_ID, "icons/isc1.gif" );
|
|
||||||
} else {
|
|
||||||
id = Activator.imageDescriptorFromPlugin(
|
|
||||||
Activator.PLUGIN_ID, "icons/isc0.gif" );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (id != null){
|
|
||||||
Image img = id.createImage();
|
|
||||||
ti.setImage(img);
|
|
||||||
img.dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
new ShowISCGridsMsg(!current).send();
|
new ShowISCGridsMsg(!current).send();
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateElement(UIElement element,
|
||||||
|
@SuppressWarnings("rawtypes") Map parameters) {
|
||||||
|
|
||||||
|
boolean current = Message.inquireLastMessage(ShowISCGridsMsg.class)
|
||||||
|
.show();
|
||||||
|
|
||||||
|
ImageDescriptor id;
|
||||||
|
if (current) {
|
||||||
|
id = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
|
||||||
|
"icons/isc1.gif");
|
||||||
|
} else {
|
||||||
|
id = Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
|
||||||
|
"icons/isc0.gif");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (id != null) {
|
||||||
|
element.setIcon(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.viz.gfe.core.msgs;
|
package com.raytheon.viz.gfe.core.msgs;
|
||||||
|
|
||||||
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
import org.eclipse.ui.commands.ICommandService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* TODO Add Description
|
||||||
*
|
*
|
||||||
|
@ -26,9 +29,12 @@ package com.raytheon.viz.gfe.core.msgs;
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ---------------- --------------------------
|
||||||
* Mar 30, 2011 randerso Initial creation
|
* 03/30/11 randerso Initial creation
|
||||||
|
* 01/16/13 DR15722 jzeng/randerso override send() to
|
||||||
|
* force the UI to update the button
|
||||||
|
* whenever the message is sent.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -50,4 +56,15 @@ public class ShowISCGridsMsg extends Message {
|
||||||
public boolean show() {
|
public boolean show() {
|
||||||
return showIscGrids;
|
return showIscGrids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void send() {
|
||||||
|
super.send();
|
||||||
|
|
||||||
|
ICommandService service = (ICommandService) PlatformUI.getWorkbench()
|
||||||
|
.getService(ICommandService.class);
|
||||||
|
service.refreshElements("com.raytheon.viz.gfe.actions.showISCGrids",
|
||||||
|
null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,46 @@
|
||||||
id="${icao}fourPanel">
|
id="${icao}fourPanel">
|
||||||
<contribute xsi:type="titleItem" titleText="------ Z/V ------"
|
<contribute xsi:type="titleItem" titleText="------ Z/V ------"
|
||||||
id="${icao}Terminal4panelZV" />
|
id="${icao}Terminal4panelZV" />
|
||||||
|
<contribute xsi:type="bundleItem"
|
||||||
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev1} ${elev2} ${elev6} ${elev8}"
|
||||||
|
id="${icao}${elev1}${elev2}${elev6}${elev8}Terminal4panelZV"
|
||||||
|
suppressErrors="${suppressErrors3}">
|
||||||
|
<substitute key="icao" value="${icao}" />
|
||||||
|
<substitute key="product1" value="180" />
|
||||||
|
<substitute key="product2" value="181" />
|
||||||
|
<substitute key="product3" value="" />
|
||||||
|
<substitute key="product4" value="" />
|
||||||
|
<substitute key="mode1" value="" />
|
||||||
|
<substitute key="product5" value="182" />
|
||||||
|
<substitute key="product6" value="183" />
|
||||||
|
<substitute key="product7" value="" />
|
||||||
|
<substitute key="product8" value="" />
|
||||||
|
<substitute key="mode2" value="" />
|
||||||
|
<substitute key="elevation1" value="${elev1}--${elev1}" />
|
||||||
|
<substitute key="elevation2" value="${elev2}--${elev2}" />
|
||||||
|
<substitute key="elevation3" value="${elev6}--${elev6}" />
|
||||||
|
<substitute key="elevation4" value="${elev8}--${elev8}" />
|
||||||
|
</contribute>
|
||||||
|
<contribute xsi:type="bundleItem"
|
||||||
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev1} ${elev3} ${elev5} ${elev6}"
|
||||||
|
id="${icao}${elev1}${elev3}${elev5}${elev6}Terminal4panelZV"
|
||||||
|
suppressErrors="${suppressErrors3}">
|
||||||
|
<substitute key="icao" value="${icao}" />
|
||||||
|
<substitute key="product1" value="180" />
|
||||||
|
<substitute key="product2" value="181" />
|
||||||
|
<substitute key="product3" value="" />
|
||||||
|
<substitute key="product4" value="" />
|
||||||
|
<substitute key="mode1" value="" />
|
||||||
|
<substitute key="product5" value="182" />
|
||||||
|
<substitute key="product6" value="183" />
|
||||||
|
<substitute key="product7" value="" />
|
||||||
|
<substitute key="product8" value="" />
|
||||||
|
<substitute key="mode2" value="" />
|
||||||
|
<substitute key="elevation1" value="${elev1}--${elev1}" />
|
||||||
|
<substitute key="elevation2" value="${elev3}--${elev3}" />
|
||||||
|
<substitute key="elevation3" value="${elev5}--${elev5}" />
|
||||||
|
<substitute key="elevation4" value="${elev6}--${elev6}" />
|
||||||
|
</contribute>
|
||||||
<contribute xsi:type="bundleItem"
|
<contribute xsi:type="bundleItem"
|
||||||
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev1} ${elev2} ${elev3} ${elev4}"
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev1} ${elev2} ${elev3} ${elev4}"
|
||||||
id="${icao}${elev1}${elev2}${elev3}${elev4}Terminal4panelZV"
|
id="${icao}${elev1}${elev2}${elev3}${elev4}Terminal4panelZV"
|
||||||
|
@ -38,14 +78,94 @@
|
||||||
<substitute key="product7" value="" />
|
<substitute key="product7" value="" />
|
||||||
<substitute key="product8" value="" />
|
<substitute key="product8" value="" />
|
||||||
<substitute key="mode2" value="" />
|
<substitute key="mode2" value="" />
|
||||||
<substitute key="elevation1" value="${elev1}" />
|
<substitute key="elevation1" value="${elev1}--${elev1}" />
|
||||||
<substitute key="elevation2" value="${elev2}" />
|
<substitute key="elevation2" value="${elev2}--${elev2}" />
|
||||||
<substitute key="elevation3" value="${elev3}" />
|
<substitute key="elevation3" value="${elev3}--${elev3}" />
|
||||||
<substitute key="elevation4" value="${elev4}" />
|
<substitute key="elevation4" value="${elev4}--${elev4}" />
|
||||||
</contribute>
|
</contribute>
|
||||||
|
<contribute xsi:type="bundleItem"
|
||||||
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev3} ${elev7} ${elev8} ${elev9}"
|
||||||
|
id="${icao}${elev3}${elev7}${elev8}${elev9}Terminal4panelZV"
|
||||||
|
suppressErrors="${suppressErrors3}">
|
||||||
|
<substitute key="icao" value="${icao}" />
|
||||||
|
<substitute key="product1" value="180" />
|
||||||
|
<substitute key="product2" value="181" />
|
||||||
|
<substitute key="product3" value="" />
|
||||||
|
<substitute key="product4" value="" />
|
||||||
|
<substitute key="mode1" value="" />
|
||||||
|
<substitute key="product5" value="182" />
|
||||||
|
<substitute key="product6" value="183" />
|
||||||
|
<substitute key="product7" value="" />
|
||||||
|
<substitute key="product8" value="" />
|
||||||
|
<substitute key="mode2" value="" />
|
||||||
|
<substitute key="elevation1" value="${elev3}--${elev3}" />
|
||||||
|
<substitute key="elevation2" value="${elev7}--${elev7}" />
|
||||||
|
<substitute key="elevation3" value="${elev8}--${elev8}" />
|
||||||
|
<substitute key="elevation4" value="${elev9}--${elev9}" />
|
||||||
|
</contribute>
|
||||||
|
<contribute xsi:type="bundleItem"
|
||||||
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev8} ${elev9} ${elev10} ${elev12}"
|
||||||
|
id="${icao}${elev8}${elev9}${elev10}${elev12}Terminal4panelZV"
|
||||||
|
suppressErrors="${suppressErrors3}">
|
||||||
|
<substitute key="icao" value="${icao}" />
|
||||||
|
<substitute key="product1" value="180" />
|
||||||
|
<substitute key="product2" value="181" />
|
||||||
|
<substitute key="product3" value="" />
|
||||||
|
<substitute key="product4" value="" />
|
||||||
|
<substitute key="mode1" value="" />
|
||||||
|
<substitute key="product5" value="182" />
|
||||||
|
<substitute key="product6" value="183" />
|
||||||
|
<substitute key="product7" value="" />
|
||||||
|
<substitute key="product8" value="" />
|
||||||
|
<substitute key="mode2" value="" />
|
||||||
|
<substitute key="elevation1" value="${elev8}--${elev8}" />
|
||||||
|
<substitute key="elevation2" value="${elev9}--${elev9}" />
|
||||||
|
<substitute key="elevation3" value="${elev10}--${elev10}" />
|
||||||
|
<substitute key="elevation4" value="${elev12}--${elev12}" />
|
||||||
|
</contribute>
|
||||||
<contribute xsi:type="separator" id="below${icao}Terminal4panelZSRM8" />
|
<contribute xsi:type="separator" id="below${icao}Terminal4panelZSRM8" />
|
||||||
<contribute xsi:type="titleItem" titleText="------ Z/SRM8 ------"
|
<contribute xsi:type="titleItem" titleText="------ Z/SRM8 ------"
|
||||||
id="${icao}Terminal4panelZSRM8" />
|
id="${icao}Terminal4panelZSRM8" />
|
||||||
|
<contribute xsi:type="bundleItem"
|
||||||
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev1} ${elev2} ${elev6} ${elev8}"
|
||||||
|
id="${icao}${elev1}${elev2}${elev6}${elev8}Terminal4panelZSRM8"
|
||||||
|
suppressErrors="${suppressErrors3}">
|
||||||
|
<substitute key="icao" value="${icao}" />
|
||||||
|
<substitute key="product1" value="180" />
|
||||||
|
<substitute key="product2" value="181" />
|
||||||
|
<substitute key="product3" value="" />
|
||||||
|
<substitute key="product4" value="" />
|
||||||
|
<substitute key="mode1" value="" />
|
||||||
|
<substitute key="product5" value="182" />
|
||||||
|
<substitute key="product6" value="" />
|
||||||
|
<substitute key="product7" value="" />
|
||||||
|
<substitute key="product8" value="" />
|
||||||
|
<substitute key="mode2" value="SRM8" />
|
||||||
|
<substitute key="elevation1" value="${elev1}--${elev1}" />
|
||||||
|
<substitute key="elevation2" value="${elev2}--${elev2}" />
|
||||||
|
<substitute key="elevation3" value="${elev6}--${elev6}" />
|
||||||
|
<substitute key="elevation4" value="${elev8}--${elev8}" />
|
||||||
|
</contribute>
|
||||||
|
<contribute xsi:type="bundleItem"
|
||||||
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev1} ${elev3} ${elev5} ${elev6}"
|
||||||
|
id="${icao}${elev1}${elev3}${elev5}${elev6}Terminal4panelZSRM8"
|
||||||
|
suppressErrors="${suppressErrors3}">
|
||||||
|
<substitute key="icao" value="${icao}" />
|
||||||
|
<substitute key="product1" value="180" />
|
||||||
|
<substitute key="product2" value="181" />
|
||||||
|
<substitute key="product3" value="" />
|
||||||
|
<substitute key="product4" value="" />
|
||||||
|
<substitute key="mode1" value="" />
|
||||||
|
<substitute key="product5" value="182" />
|
||||||
|
<substitute key="product6" value="" />
|
||||||
|
<substitute key="product7" value="" />
|
||||||
|
<substitute key="product8" value="" />
|
||||||
|
<substitute key="mode2" value="SRM8" />
|
||||||
|
<substitute key="elevation1" value="${elev1}--${elev1}" />
|
||||||
|
<substitute key="elevation2" value="${elev3}--${elev3}" />
|
||||||
|
<substitute key="elevation3" value="${elev5}--${elev5}" />
|
||||||
|
<substitute key="elevation4" value="${elev6}--${elev6}" />
|
||||||
|
</contribute>
|
||||||
<contribute xsi:type="bundleItem"
|
<contribute xsi:type="bundleItem"
|
||||||
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev1} ${elev2} ${elev3} ${elev4}"
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev1} ${elev2} ${elev3} ${elev4}"
|
||||||
id="${icao}${elev1}${elev2}${elev3}${elev4}Terminal4panelZSRM8"
|
id="${icao}${elev1}${elev2}${elev3}${elev4}Terminal4panelZSRM8"
|
||||||
|
@ -60,11 +180,51 @@
|
||||||
<substitute key="product6" value="" />
|
<substitute key="product6" value="" />
|
||||||
<substitute key="product7" value="" />
|
<substitute key="product7" value="" />
|
||||||
<substitute key="product8" value="" />
|
<substitute key="product8" value="" />
|
||||||
|
<substitute key="mode2" value="SRM8" />
|
||||||
|
<substitute key="elevation1" value="${elev1}--${elev1}" />
|
||||||
|
<substitute key="elevation2" value="${elev2}--${elev2}" />
|
||||||
|
<substitute key="elevation3" value="${elev3}--${elev3}" />
|
||||||
|
<substitute key="elevation4" value="${elev4}--${elev4}" />
|
||||||
|
</contribute>
|
||||||
|
<contribute xsi:type="bundleItem"
|
||||||
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev3} ${elev7} ${elev8} ${elev9}"
|
||||||
|
id="${icao}${elev3}${elev7}${elev8}${elev9}Terminal4panelZSRM8"
|
||||||
|
suppressErrors="${suppressErrors3}">
|
||||||
|
<substitute key="icao" value="${icao}" />
|
||||||
|
<substitute key="product1" value="180" />
|
||||||
|
<substitute key="product2" value="181" />
|
||||||
|
<substitute key="product3" value="" />
|
||||||
|
<substitute key="product4" value="" />
|
||||||
|
<substitute key="mode1" value="" />
|
||||||
|
<substitute key="product5" value="182" />
|
||||||
|
<substitute key="product6" value="" />
|
||||||
|
<substitute key="product7" value="" />
|
||||||
|
<substitute key="product8" value="" />
|
||||||
<substitute key="mode2" value="SRM8" />
|
<substitute key="mode2" value="SRM8" />
|
||||||
<substitute key="elevation1" value="${elev1}" />
|
<substitute key="elevation1" value="${elev3}--${elev3}" />
|
||||||
<substitute key="elevation2" value="${elev2}" />
|
<substitute key="elevation2" value="${elev7}--${elev7}" />
|
||||||
<substitute key="elevation3" value="${elev3}" />
|
<substitute key="elevation3" value="${elev8}--${elev8}" />
|
||||||
<substitute key="elevation4" value="${elev4}" />
|
<substitute key="elevation4" value="${elev9}--${elev9}" />
|
||||||
</contribute>
|
</contribute>
|
||||||
|
<contribute xsi:type="bundleItem"
|
||||||
|
file="bundles/DefaultRadarFourPanelBlendedBestRes.xml" menuText="${elev8} ${elev9} ${elev10} ${elev12}"
|
||||||
|
id="${icao}${elev8}${elev9}${elev10}${elev12}Terminal4panelZSRM8"
|
||||||
|
suppressErrors="${suppressErrors3}">
|
||||||
|
<substitute key="icao" value="${icao}" />
|
||||||
|
<substitute key="product1" value="180" />
|
||||||
|
<substitute key="product2" value="181" />
|
||||||
|
<substitute key="product3" value="" />
|
||||||
|
<substitute key="product4" value="" />
|
||||||
|
<substitute key="mode1" value="" />
|
||||||
|
<substitute key="product5" value="182" />
|
||||||
|
<substitute key="product6" value="" />
|
||||||
|
<substitute key="product7" value="" />
|
||||||
|
<substitute key="product8" value="" />
|
||||||
|
<substitute key="mode2" value="SRM8" />
|
||||||
|
<substitute key="elevation1" value="${elev8}--${elev8}" />
|
||||||
|
<substitute key="elevation2" value="${elev9}--${elev9}" />
|
||||||
|
<substitute key="elevation3" value="${elev10}--${elev10}" />
|
||||||
|
<substitute key="elevation4" value="${elev12}--${elev12}" />
|
||||||
|
</contribute>
|
||||||
</contribute>
|
</contribute>
|
||||||
</menuTemplate>
|
</menuTemplate>
|
||||||
|
|
|
@ -60,8 +60,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* uses the font.
|
* uses the font.
|
||||||
* Feb 03, 2012 14317 mhuang Make alarm display window wider
|
* Feb 03, 2012 14317 mhuang Make alarm display window wider
|
||||||
* Sep 6, 2012 13365 rferrel Accumulate and Display fix.
|
* Sep 6, 2012 13365 rferrel Accumulate and Display fix.
|
||||||
* Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow. Added DO_NOT_BLOCK.
|
* Sep 25, 2012 1196 lvenable Dialog refactor for AlarmDisplayWindow.Added DO_NOT_BLOCK.
|
||||||
* Dec 31, 2012 15651 mgamazaychikov Added an argument to re-factored PrintDisplay.print
|
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -199,7 +198,7 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintDisplay.print(lines.toString(), text.getFont()
|
PrintDisplay.print(lines.toString(), text.getFont()
|
||||||
.getFontData()[0], -1, UFStatus
|
.getFontData()[0], UFStatus
|
||||||
.getHandler(AlarmDisplayWindow.class));
|
.getHandler(AlarmDisplayWindow.class));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -208,7 +207,7 @@ public class AlarmDisplayWindow extends CaveSWTDialog {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
PrintDisplay.print(text.getText(),
|
PrintDisplay.print(text.getText(),
|
||||||
text.getFont().getFontData()[0], -1,
|
text.getFont().getFontData()[0],
|
||||||
UFStatus.getHandler(AlarmDisplayWindow.class));
|
UFStatus.getHandler(AlarmDisplayWindow.class));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -307,8 +307,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
|
||||||
* 28Nov2012 14842 M.Gamazaychikov Re-wrote processPopup method
|
* 28Nov2012 14842 M.Gamazaychikov Re-wrote processPopup method
|
||||||
* 13Dec2012 1353 rferrel Change to make edit cancel message not
|
* 13Dec2012 1353 rferrel Change to make edit cancel message not
|
||||||
* dispaly the red had kill job message.
|
* dispaly the red had kill job message.
|
||||||
* 31Dec2012 15651 M.Gamazaychikov Added an argument to re-factored PrintDisplay.print
|
* 10JAN2012 15704 M.Gamazaychikov Added setting userKeyPressed to false in verifyText method
|
||||||
* 10JAN2012 15704 M.Gamazaychikov Added setting userKeyPressed to false in verifyText method.
|
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -4192,7 +4191,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
*/
|
*/
|
||||||
private void printAllText() {
|
private void printAllText() {
|
||||||
FontData fontData = textEditor.getFont().getFontData()[0];
|
FontData fontData = textEditor.getFont().getFontData()[0];
|
||||||
PrintDisplay.print(textEditor.getText(), fontData, charWrapCol, statusHandler);
|
PrintDisplay.print(textEditor.getText(), fontData, statusHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4215,7 +4214,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
||||||
String tmpText = textEditor.getText();
|
String tmpText = textEditor.getText();
|
||||||
Point point = textEditor.getSelection();
|
Point point = textEditor.getSelection();
|
||||||
FontData fontData = textEditor.getFont().getFontData()[0];
|
FontData fontData = textEditor.getFont().getFontData()[0];
|
||||||
PrintDisplay.print(textEditor.getSelectionText(), fontData, charWrapCol,
|
PrintDisplay.print(textEditor.getSelectionText(), fontData,
|
||||||
statusHandler);
|
statusHandler);
|
||||||
textEditor.setText(tmpText);
|
textEditor.setText(tmpText);
|
||||||
textEditor.setSelection(point);
|
textEditor.setSelection(point);
|
||||||
|
|
|
@ -43,7 +43,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
* Sep 15, 2011 10557 rferrel Initial creation
|
* Sep 15, 2011 10557 rferrel Initial creation
|
||||||
* Jul 17, 2012 14274 rferrel Now use eclipse Printer instead of awt.
|
* Jul 17, 2012 14274 rferrel Now use eclipse Printer instead of awt.
|
||||||
* Text is printed using same font as the GUI
|
* Text is printed using same font as the GUI
|
||||||
* Dec 31, 2012 15651 mgamazaychikov Added setFont method to scale font for printing
|
* Dec 31, 2012 15651 M Gamazaychikov Added setFont method to scale font for printing
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -53,7 +53,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
|
||||||
public class PrintDisplay {
|
public class PrintDisplay {
|
||||||
public static void print(final String printedText, final FontData fontData,
|
public static void print(final String printedText, final FontData fontData,
|
||||||
int aLineWidth, IUFStatusHandler statusHandler) {
|
IUFStatusHandler statusHandler) {
|
||||||
PrinterData data = Printer.getDefaultPrinterData();
|
PrinterData data = Printer.getDefaultPrinterData();
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
|
@ -67,11 +67,9 @@ public class PrintDisplay {
|
||||||
}
|
}
|
||||||
|
|
||||||
final Printer printer = new Printer(data);
|
final Printer printer = new Printer(data);
|
||||||
PrintDisplay pd = new PrintDisplay(printer, printedText, fontData, aLineWidth);
|
PrintDisplay pd = new PrintDisplay(printer, printedText, fontData);
|
||||||
pd.printJob();
|
pd.printJob();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int lineWidth;
|
|
||||||
|
|
||||||
private Printer printer;
|
private Printer printer;
|
||||||
|
|
||||||
|
@ -105,16 +103,10 @@ public class PrintDisplay {
|
||||||
|
|
||||||
int end;
|
int end;
|
||||||
|
|
||||||
private PrintDisplay(Printer printer, String text, FontData fontData, int aWidth) {
|
private PrintDisplay(Printer printer, String text, FontData fontData) {
|
||||||
this.printer = printer;
|
this.printer = printer;
|
||||||
this.textToPrint = text;
|
this.textToPrint = text;
|
||||||
this.printerFontData = fontData;
|
this.printerFontData = fontData;
|
||||||
if (aWidth == -1) {
|
|
||||||
this.lineWidth = 69;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.lineWidth = aWidth;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printJob() {
|
private void printJob() {
|
||||||
|
@ -128,6 +120,19 @@ public class PrintDisplay {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setFont() {
|
protected void setFont() {
|
||||||
|
/*
|
||||||
|
* get the max number of characters in a line of text
|
||||||
|
* and add a length of tab
|
||||||
|
*/
|
||||||
|
String [] textLines = textToPrint.split("[\n]");
|
||||||
|
int maxChar = textLines[0].length();
|
||||||
|
for ( int counter=1; counter<textLines.length; counter++){
|
||||||
|
if (textLines[counter].length() > maxChar){
|
||||||
|
maxChar = textLines[counter].length();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
maxChar = maxChar + 4;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get the original font size and set the gc font.
|
* get the original font size and set the gc font.
|
||||||
*/
|
*/
|
||||||
|
@ -138,8 +143,8 @@ public class PrintDisplay {
|
||||||
/*
|
/*
|
||||||
* Create a buffer for computing line width in pixels.
|
* Create a buffer for computing line width in pixels.
|
||||||
*/
|
*/
|
||||||
StringBuilder aBuffer = new StringBuilder(lineWidth);
|
StringBuilder aBuffer = new StringBuilder(maxChar);
|
||||||
for (int i = 0; i < lineWidth; i++) {
|
for (int i = 0; i < maxChar; i++) {
|
||||||
aBuffer.append(' ');
|
aBuffer.append(' ');
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -605,7 +605,7 @@ HRAP = ('HRAP', POLAR_STEREOGRAPHIC,
|
||||||
(-119.036, 23.097), (-75.945396, 53.480095),
|
(-119.036, 23.097), (-75.945396, 53.480095),
|
||||||
(0.0, 0.0), 0.0, 0.0, (1, 1), (801, 881), 0.0, 0.0, -105.0)
|
(0.0, 0.0), 0.0, 0.0, (1, 1), (801, 881), 0.0, 0.0, -105.0)
|
||||||
|
|
||||||
NDFD_Oceanic_10K = ('NDFD Oceanic 10km', MERCATOR,
|
NDFD_Oceanic_10K = ('NDFD_Oceanic_10km', MERCATOR,
|
||||||
(-230.094, -30.4192), (10.71, 67.03),
|
(-230.094, -30.4192), (10.71, 67.03),
|
||||||
(0.0, 0.0), 0.0, 0.0, (1, 1), (2517, 1289), 0.0, -109.962, 0.0)
|
(0.0, 0.0), 0.0, 0.0, (1, 1), (2517, 1289), 0.0, -109.962, 0.0)
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,7 @@ public class GfeScriptExecutor {
|
||||||
}
|
}
|
||||||
|
|
||||||
String fileContents = getFileContents(xmlFileName);
|
String fileContents = getFileContents(xmlFileName);
|
||||||
Pattern pat = Pattern.compile("<site>([A-Z]{3})</site>");
|
Pattern pat = Pattern.compile("<site>(.*?)</site>");
|
||||||
Matcher matcher = pat.matcher(fileContents);
|
Matcher matcher = pat.matcher(fileContents);
|
||||||
|
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
|
|
|
@ -334,4 +334,5 @@ com.raytheon.uf.common.dataplugin.shef.tables.YuniqueId
|
||||||
com.raytheon.uf.common.dataplugin.shef.tables.Zoneinfo
|
com.raytheon.uf.common.dataplugin.shef.tables.Zoneinfo
|
||||||
com.raytheon.uf.common.dataplugin.shef.tables.ZoneinfoId
|
com.raytheon.uf.common.dataplugin.shef.tables.ZoneinfoId
|
||||||
com.raytheon.uf.common.dataplugin.shef.tables.Zonenum
|
com.raytheon.uf.common.dataplugin.shef.tables.Zonenum
|
||||||
com.raytheon.uf.common.dataplugin.shef.tables.ZonenumId
|
com.raytheon.uf.common.dataplugin.shef.tables.ZonenumId
|
||||||
|
com.raytheon.edex.transform.shef.MetarToShefFilter
|
|
@ -28,7 +28,7 @@
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="metarToShefFilter"
|
<bean id="metarToShefFilter"
|
||||||
class="com.raytheon.uf.edex.decodertools.core.filterimpl.PluginDataObjectFilter">
|
class="com.raytheon.edex.transform.shef.MetarToShefFilter">
|
||||||
<constructor-arg type="java.lang.String" value="metarToShefFilter.xml" />
|
<constructor-arg type="java.lang.String" value="metarToShefFilter.xml" />
|
||||||
<constructor-arg type="java.lang.String" value="SITE" />
|
<constructor-arg type="java.lang.String" value="SITE" />
|
||||||
</bean>
|
</bean>
|
||||||
|
@ -133,7 +133,7 @@
|
||||||
<pipeline>
|
<pipeline>
|
||||||
<split streaming="true">
|
<split streaming="true">
|
||||||
<method bean="metarToShef" method="iterate" />
|
<method bean="metarToShef" method="iterate" />
|
||||||
<bean ref="metarToShef" method="transform" />
|
<bean ref="metarToShef" method="transformMetar" />
|
||||||
<to
|
<to
|
||||||
uri="jms-generic:queue:Ingest.ShefStaged?destinationResolver=#qpidDurableResolver" />
|
uri="jms-generic:queue:Ingest.ShefStaged?destinationResolver=#qpidDurableResolver" />
|
||||||
</split>
|
</split>
|
||||||
|
|
|
@ -483,7 +483,7 @@ public abstract class AbstractShefTransformer<T extends PluginDataObject>
|
||||||
/**
|
/**
|
||||||
* Create, or recreate and validate the shef archive directory.
|
* Create, or recreate and validate the shef archive directory.
|
||||||
*/
|
*/
|
||||||
private void configureArchiveDir() {
|
protected void configureArchiveDir() {
|
||||||
archiveEnabled = AppsDefaults.getInstance().getBoolean(OPT_ARC_ENABLE,
|
archiveEnabled = AppsDefaults.getInstance().getBoolean(OPT_ARC_ENABLE,
|
||||||
false);
|
false);
|
||||||
String arcDir = AppsDefaults.getInstance().getToken(OPT_SHEF_ARC_DIR);
|
String arcDir = AppsDefaults.getInstance().getToken(OPT_SHEF_ARC_DIR);
|
||||||
|
|
|
@ -0,0 +1,286 @@
|
||||||
|
/**
|
||||||
|
* 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.transform.shef;
|
||||||
|
|
||||||
|
import static com.raytheon.uf.common.localization.LocalizationContext.LocalizationType.EDEX_STATIC;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.JAXBException;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||||
|
import com.raytheon.uf.common.localization.IPathManager;
|
||||||
|
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||||
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||||
|
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||||
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
|
import com.raytheon.uf.common.ohd.AppsDefaults;
|
||||||
|
//import com.raytheon.edex.transform.shef.MetarToShefTransformer;
|
||||||
|
import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractFilterElement;
|
||||||
|
import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractObsFilter;
|
||||||
|
import com.raytheon.uf.edex.decodertools.core.filterimpl.PluginDataObjectFilter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use information in metarToShefFilter.xml, MetarToShefFilter filters out
|
||||||
|
* the metar messages before send the message to MetarToShefTransformer to
|
||||||
|
* encode to a SHEF message.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ---------- ------- -------- --------------------------
|
||||||
|
* 1/10/2013 15497 wkwock Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author wkwock
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@XmlRootElement
|
||||||
|
@XmlAccessorType(XmlAccessType.NONE)
|
||||||
|
@DynamicSerialize
|
||||||
|
public class MetarToShefFilter {
|
||||||
|
@XmlElement
|
||||||
|
@DynamicSerializeElement
|
||||||
|
protected List<MetarToShefRun> metarToShefRun = new ArrayList<MetarToShefRun>();
|
||||||
|
|
||||||
|
private static final String ERROR_1_FMT = "Could not create {%s} context for file \"%s\"";
|
||||||
|
|
||||||
|
private static final String ERROR_2_FMT = "File %s does not exist";
|
||||||
|
|
||||||
|
private static final String METAR_CFG = "metar.cfg";
|
||||||
|
|
||||||
|
public static final String FILTERS_DIR = "plugin-filters";
|
||||||
|
|
||||||
|
private String metarToShefOptions = AppsDefaults.getInstance().getToken("metar2shef_options");
|
||||||
|
|
||||||
|
private Log logger = LogFactory.getLog(getClass());
|
||||||
|
|
||||||
|
private String filterConfigFile = null;
|
||||||
|
|
||||||
|
public MetarToShefFilter() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public MetarToShefFilter(String configFile, String localContext) {
|
||||||
|
filterConfigFile = configFile;
|
||||||
|
try {
|
||||||
|
File filterDir = null;
|
||||||
|
IPathManager manager = PathManagerFactory.getPathManager();
|
||||||
|
if(manager != null) {
|
||||||
|
LocalizationContext context = manager.getContext(EDEX_STATIC, LocalizationLevel.valueOf(localContext));
|
||||||
|
if(context != null) {
|
||||||
|
filterDir = manager.getFile(context, FILTERS_DIR);
|
||||||
|
if (filterDir.exists()) {
|
||||||
|
File srcFile = new File(filterDir, filterConfigFile);
|
||||||
|
|
||||||
|
byte[] data = new byte[(int) srcFile.length()];
|
||||||
|
|
||||||
|
InputStream stream = getInputStream(srcFile);
|
||||||
|
try {
|
||||||
|
stream.read(data);
|
||||||
|
stream.close();
|
||||||
|
Object obj = SerializationUtil
|
||||||
|
.unmarshalFromXml(new String(data));
|
||||||
|
if (obj instanceof PluginDataObjectFilter){
|
||||||
|
logger.info("Found "+filterConfigFile+" is PluginDataObjectFilter");
|
||||||
|
PluginDataObjectFilter pdof=(PluginDataObjectFilter) obj;
|
||||||
|
MetarToShefRun mtsr= new MetarToShefRun();
|
||||||
|
mtsr.setConfigFileName(METAR_CFG);
|
||||||
|
mtsr.setMetarToShefOptions(metarToShefOptions);
|
||||||
|
mtsr.setFilterElements(pdof.getFilterElements());
|
||||||
|
mtsr.setFilterName(pdof.getFilterName());
|
||||||
|
this.metarToShefRun.add(mtsr);
|
||||||
|
}else if (obj instanceof MetarToShefFilter) {
|
||||||
|
MetarToShefFilter filter = (MetarToShefFilter) obj;
|
||||||
|
this.metarToShefRun=filter.metarToShefRun;
|
||||||
|
logger.info("Found "+filterConfigFile+" is MetarToShefFilter");
|
||||||
|
}else {
|
||||||
|
logger.error("Found "+filterConfigFile+" is "+obj.getClass().getCanonicalName());
|
||||||
|
createDummyFilter();
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("Unable to read filter config", e);
|
||||||
|
} catch (JAXBException e) {
|
||||||
|
logger.error("Unable to unmarshall filter config", e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.error(String.format(ERROR_2_FMT,filterDir.getPath()));
|
||||||
|
createDummyFilter();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.error(String.format(ERROR_1_FMT, localContext,configFile));
|
||||||
|
createDummyFilter();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Could not create PathManager
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(
|
||||||
|
"Error creating filter.", e);
|
||||||
|
createDummyFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (MetarToShefRun mtsr: metarToShefRun){
|
||||||
|
logger.info("Filter name = " + mtsr.getFilterName()+" with config file: "+mtsr.getConfigFileName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private PluginDataObject[] filterARun(PluginDataObject[] reports, List<AbstractFilterElement> filterElements) {
|
||||||
|
int reportCount = 0;
|
||||||
|
if (reports != null) {
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < reports.length; i++) {
|
||||||
|
PluginDataObject r = null;
|
||||||
|
boolean keep = true;
|
||||||
|
for (AbstractFilterElement element : filterElements) {
|
||||||
|
r = element.filter(reports[i]);
|
||||||
|
|
||||||
|
// Only allow keep to be set to true. Once true it stays that way.
|
||||||
|
if(AbstractObsFilter.INCLUDE_TYPE.equals(element.getFilterType())) {
|
||||||
|
// Did the filter pass?
|
||||||
|
if(r == null) {
|
||||||
|
// If we fail an element, exit now.
|
||||||
|
keep = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if(AbstractObsFilter.EXCLUDE_TYPE.equals(element.getFilterType())) {
|
||||||
|
if(r != null) {
|
||||||
|
// There was a match, so we want to remove this item.
|
||||||
|
keep = false;
|
||||||
|
// And there's no reason for further checks.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (keep) {
|
||||||
|
reportCount++;
|
||||||
|
} else {
|
||||||
|
reports[i] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (reportCount == 0) {
|
||||||
|
reports = new PluginDataObject[0];
|
||||||
|
} else {
|
||||||
|
PluginDataObject[] newReports = new PluginDataObject[reportCount];
|
||||||
|
int i = 0;
|
||||||
|
// Copy in the reports that passed filtering.
|
||||||
|
for (PluginDataObject report : reports) {
|
||||||
|
if (report != null) {
|
||||||
|
newReports[i++] = report;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reports = newReports;
|
||||||
|
}
|
||||||
|
return reports;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply the list of filters against given input data.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
// @Override
|
||||||
|
public PluginDataObject[] filter(PluginDataObject[] reports) {
|
||||||
|
PluginDataObject[] resultRpt=null;
|
||||||
|
for (MetarToShefRun mtsr : metarToShefRun) {
|
||||||
|
PluginDataObject[] tmpRprts = reports.clone();
|
||||||
|
resultRpt=filterARun(tmpRprts,mtsr.getFilterElements());
|
||||||
|
if (resultRpt!=null && resultRpt.length>=1) {
|
||||||
|
logger.info("Report matchs in filter "+mtsr.getFilterName());
|
||||||
|
MetarToShefTransformer.setCfgNOption(mtsr.getConfigFileName(),mtsr.getMetarToShefOptions());
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return resultRpt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createDummyFilter() {
|
||||||
|
MetarToShefRun mtsr= new MetarToShefRun();
|
||||||
|
mtsr.setConfigFileName(METAR_CFG);
|
||||||
|
mtsr.setMetarToShefOptions(metarToShefOptions);
|
||||||
|
|
||||||
|
// Add a dummy element.
|
||||||
|
AbstractFilterElement dummy = new AbstractFilterElement() {
|
||||||
|
@Override
|
||||||
|
public PluginDataObject filter(PluginDataObject report) {
|
||||||
|
return report;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
dummy.setFilterType(AbstractObsFilter.INCLUDE_TYPE);
|
||||||
|
mtsr.getFilterElements().set(0, dummy);
|
||||||
|
mtsr.setFilterName("Created Pass-All filter");
|
||||||
|
this.metarToShefRun.add(mtsr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static FileInputStream getInputStream(File file) {
|
||||||
|
FileInputStream fis = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
fis = new FileInputStream(file);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return fis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addMetarToShefRun(MetarToShefRun element) {
|
||||||
|
metarToShefRun.add(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<MetarToShefRun> getMetarToShefRun() {
|
||||||
|
return metarToShefRun;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param elements
|
||||||
|
*/
|
||||||
|
public void setMetarToShefRun(List<MetarToShefRun> elements) {
|
||||||
|
metarToShefRun = elements;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,150 @@
|
||||||
|
package com.raytheon.edex.transform.shef;
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
**/
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||||
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
|
import com.raytheon.uf.edex.decodertools.core.filterimpl.AbstractFilterElement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MetarToShefRun is for the metarToShefRun tag in Metar2ShefFilter tag
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ---------- ------- -------- --------------------------
|
||||||
|
* 1/10/2013 15497 wkwock Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author wkwock
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.NONE)
|
||||||
|
@DynamicSerialize
|
||||||
|
public class MetarToShefRun implements ISerializableObject{
|
||||||
|
public static final String INCLUDE_TYPE = "INCLUDE";
|
||||||
|
|
||||||
|
public static final String EXCLUDE_TYPE = "EXCLUDE";
|
||||||
|
@XmlElement
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private String configFileName;
|
||||||
|
|
||||||
|
@XmlElement
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private String metarToShefOptions;
|
||||||
|
|
||||||
|
@XmlElement
|
||||||
|
@DynamicSerializeElement
|
||||||
|
protected List<AbstractFilterElement> filterElements = new ArrayList<AbstractFilterElement>();
|
||||||
|
|
||||||
|
@XmlElement
|
||||||
|
@DynamicSerializeElement
|
||||||
|
private String filterName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param filterFile
|
||||||
|
*/
|
||||||
|
void createFilter(File filterFile) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getConfigFileName() {
|
||||||
|
return configFileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
*/
|
||||||
|
public void setConfigFileName(String name) {
|
||||||
|
configFileName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getMetarToShefOptions() {
|
||||||
|
return metarToShefOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
*/
|
||||||
|
public void setMetarToShefOptions(String name) {
|
||||||
|
metarToShefOptions = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void addFilterElement(AbstractFilterElement element) {
|
||||||
|
filterElements.add(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<AbstractFilterElement> getFilterElements() {
|
||||||
|
return filterElements;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param elements
|
||||||
|
*/
|
||||||
|
public void setFilterElements(List<AbstractFilterElement> elements) {
|
||||||
|
filterElements = elements;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getFilterName() {
|
||||||
|
return filterName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
*/
|
||||||
|
public void setFilterName(String name) {
|
||||||
|
filterName = name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -80,6 +80,10 @@ public class MetarToShefTransformer extends
|
||||||
private static final int P1_MIN = 50;
|
private static final int P1_MIN = 50;
|
||||||
private static final int P2_MAX = 5;
|
private static final int P2_MAX = 5;
|
||||||
|
|
||||||
|
private static String cfgFileName="metar.cfg";
|
||||||
|
private static String cmdLnOptions="";
|
||||||
|
private static boolean refreshOptions=true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct an instance of this transformer.
|
* Construct an instance of this transformer.
|
||||||
* @param cmdLine Command line options that may be used if these
|
* @param cmdLine Command line options that may be used if these
|
||||||
|
@ -411,4 +415,24 @@ public class MetarToShefTransformer extends
|
||||||
}
|
}
|
||||||
return sb;
|
return sb;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public final byte[] transformMetar(MetarRecord report, Headers headers)
|
||||||
|
throws TransformerException {
|
||||||
|
if (refreshOptions) {
|
||||||
|
logger.info("Metar to SHEF now use config file: "+cfgFileName+" with options:"+cmdLnOptions);
|
||||||
|
options.setCfgFileName(cfgFileName);
|
||||||
|
options.updateCommandLine(cmdLnOptions);
|
||||||
|
options.updateOptions();
|
||||||
|
refreshOptions=false;
|
||||||
|
}
|
||||||
|
configureArchiveDir();
|
||||||
|
|
||||||
|
return transformReport(report, headers);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setCfgNOption (String cfg, String options){
|
||||||
|
cfgFileName=cfg;
|
||||||
|
cmdLnOptions=options;
|
||||||
|
refreshOptions=true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -179,6 +179,7 @@ public class ObsToSHEFOptions {
|
||||||
|
|
||||||
public static final String OPT_NO_HR_TRACE = "optNoHourTrace";
|
public static final String OPT_NO_HR_TRACE = "optNoHourTrace";
|
||||||
|
|
||||||
|
private String cfgFileName=null;
|
||||||
// private static class PCReset {
|
// private static class PCReset {
|
||||||
//
|
//
|
||||||
// private final String stationId;
|
// private final String stationId;
|
||||||
|
@ -408,7 +409,11 @@ public class ObsToSHEFOptions {
|
||||||
initOptions();
|
initOptions();
|
||||||
parseCommandLine(cmdLine);
|
parseCommandLine(cmdLine);
|
||||||
if (useLocalized) {
|
if (useLocalized) {
|
||||||
readConfig(METAR_CFG, optConfigContext);
|
if (cfgFileName==null){
|
||||||
|
readConfig(METAR_CFG, optConfigContext);
|
||||||
|
} else {
|
||||||
|
readConfig(cfgFileName, optConfigContext);
|
||||||
|
}
|
||||||
updateTime = System.currentTimeMillis();
|
updateTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
localized = useLocalized;
|
localized = useLocalized;
|
||||||
|
@ -843,7 +848,11 @@ public class ObsToSHEFOptions {
|
||||||
long cTime = System.currentTimeMillis() - updateTime;
|
long cTime = System.currentTimeMillis() - updateTime;
|
||||||
if (cTime > UPDATE_DELTA) {
|
if (cTime > UPDATE_DELTA) {
|
||||||
if (loaded && localized) {
|
if (loaded && localized) {
|
||||||
readConfig(METAR_CFG, optConfigContext);
|
if (cfgFileName==null) {
|
||||||
|
readConfig(METAR_CFG, optConfigContext);
|
||||||
|
} else {
|
||||||
|
readConfig(cfgFileName, optConfigContext);
|
||||||
|
}
|
||||||
updateTime = System.currentTimeMillis();
|
updateTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -874,7 +883,11 @@ public class ObsToSHEFOptions {
|
||||||
if (SITE_CONTEXT.equals(optConfigContext)) {
|
if (SITE_CONTEXT.equals(optConfigContext)) {
|
||||||
// Retry from a base context.
|
// Retry from a base context.
|
||||||
optConfigContext = BASE_CONTEXT;
|
optConfigContext = BASE_CONTEXT;
|
||||||
readConfig(METAR_CFG, optConfigContext);
|
if (cfgFileName==null) {
|
||||||
|
readConfig(METAR_CFG, optConfigContext);
|
||||||
|
}else{
|
||||||
|
readConfig(cfgFileName, optConfigContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -973,6 +986,10 @@ public class ObsToSHEFOptions {
|
||||||
loaded = true;
|
loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCfgFileName(String fileName) {
|
||||||
|
cfgFileName=fileName;
|
||||||
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
# 06/16/10 njensen Initial Creation.
|
# 06/16/10 njensen Initial Creation.
|
||||||
# 05/03/11 9134 njensen Optimized for pointdata
|
# 05/03/11 9134 njensen Optimized for pointdata
|
||||||
# 10/09/12 rjpeter Optimized __getGroup for retrievals
|
# 10/09/12 rjpeter Optimized __getGroup for retrievals
|
||||||
|
# 01/17/13 DR 15294 D. Friedman Clear out data in response
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
@ -94,6 +95,9 @@ class H5pyDataStore(IDataStore.IDataStore):
|
||||||
except:
|
except:
|
||||||
logger.warn("Exception occurred on file " + fn + ":" + IDataStore._exc())
|
logger.warn("Exception occurred on file " + fn + ":" + IDataStore._exc())
|
||||||
exc.append(IDataStore._exc())
|
exc.append(IDataStore._exc())
|
||||||
|
# Clear out data so we don't send the whole thing back to the client.
|
||||||
|
# NOTE: This assumes pypies no longer needs the data
|
||||||
|
r.putDataObject(None)
|
||||||
failRecs.append(r)
|
failRecs.append(r)
|
||||||
|
|
||||||
if ss:
|
if ss:
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
Name: awips2-ldm
|
Name: awips2-ldm
|
||||||
Summary: AWIPS II LDM Distribution
|
Summary: AWIPS II LDM Distribution
|
||||||
Version: 6.8.1
|
Version: 6.8.1
|
||||||
Release: 28
|
Release: 29
|
||||||
Group: AWIPSII
|
Group: AWIPSII
|
||||||
BuildRoot: /tmp
|
BuildRoot: /tmp
|
||||||
URL: N/A
|
URL: N/A
|
||||||
|
|
Loading…
Add table
Reference in a new issue