Merge branch 'omaha_pda' of ssh://lightning.omaha.us.ray.com:29418/AWIPS2_baseline into omaha_pda
Former-commit-id: cc451692b975f3e40c08960585970b1965aa5b84
This commit is contained in:
commit
66922edb00
308 changed files with 13962 additions and 23024 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -7,6 +7,7 @@ testBin/
|
|||
bin-test/
|
||||
*.class
|
||||
*.pyo
|
||||
*.pyc
|
||||
*.o
|
||||
*.orig
|
||||
|
||||
|
|
|
@ -20,15 +20,15 @@
|
|||
-->
|
||||
<menuContributionFile>
|
||||
<include installTo="menu:Aviation?after=ConvectionProductsStart"
|
||||
fileName="menus/aviationadvisory/baseAviationConvectionProducts.xml" />
|
||||
fileName="menus/upperair/baseAviationConvectionProducts.xml" />
|
||||
<include installTo="menu:Aviation?before=IcingProductsEnd"
|
||||
fileName="menus/aviationadvisory/baseAviationIcingProducts.xml" />
|
||||
fileName="menus/upperair/baseAviationIcingProducts.xml" />
|
||||
<include installTo="menu:Aviation?before=TurbulenceProductsEnd"
|
||||
fileName="menus/aviationadvisory/baseAviationTurbulenceProducts.xml" />
|
||||
fileName="menus/upperair/baseAviationTurbulenceProducts.xml" />
|
||||
<include installTo="menu:Aviation?before=VisibilityProductsEnd"
|
||||
fileName="menus/aviationadvisory/baseAviationVisibilityProducts.xml" />
|
||||
fileName="menus/upperair/baseAviationVisibilityProducts.xml" />
|
||||
<include installTo="menu:Aviation?before=TropicalCycloneEnd"
|
||||
fileName="menus/aviationadvisory/baseAviationTropicalCyclone.xml" />
|
||||
fileName="menus/upperair/baseAviationTropicalCyclone.xml" />
|
||||
<include installTo="menu:Aviation?after=VolcanicAshStart"
|
||||
fileName="menus/aviationadvisory/baseAviationVolcanicAsh.xml" />
|
||||
fileName="menus/upperair/baseAviationVolcanicAsh.xml" />
|
||||
</menuContributionFile>
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuContributionFile>
|
||||
<include installTo="menu:Aviation?before=SignificantWeatherEnd"
|
||||
fileName="menus/upperair/baseAviationBufrSigWx.xml" />
|
||||
</menuContributionFile>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml"
|
||||
menuText="Medium Level" id="SigWxMedium">
|
||||
<substitute key="wxLayer" value="SWM" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml"
|
||||
menuText="High Level" id="SigWxHigh">
|
||||
<substitute key="wxLayer" value="SWH" />
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuContributionFile>
|
||||
<include installTo="menu:Aviation?before=CenterWeatherEnd"
|
||||
fileName="menus/upperair/baseAviationCWA.xml" />
|
||||
</menuContributionFile>
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/CWA.xml"
|
||||
menuText="Center Weather Advisories" id="cwa">
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuContributionFile>
|
||||
<include subMenu="US Western" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseUSWestern.xml" />
|
||||
<include subMenu="US Central" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseUSCentral.xml" />
|
||||
<include subMenu="US Eastern" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseUSEastern.xml" />
|
||||
<include subMenu="Canada North" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseCanadaNorth.xml" />
|
||||
<include subMenu="Canada Western" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseCanadaWestern.xml" />
|
||||
<include subMenu="Canada Central" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseCanadaCentral.xml" />
|
||||
<include subMenu="Canada Eastern" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseCanadaEastern.xml" />
|
||||
<include subMenu="Mexico" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseMexico.xml" />
|
||||
<include subMenu="Atlantic" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseAtlantic.xml" />
|
||||
<include subMenu="Japan/South Asia" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseJapan.xml" />
|
||||
<include subMenu="Australia" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseAustralia.xml" />
|
||||
<include subMenu="China" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseChina.xml" />
|
||||
<include subMenu="Russia" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseRussia.xml" />
|
||||
<include subMenu="Pacific East" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/basePacificEast.xml" />
|
||||
<include subMenu="Pacific West" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/basePacificWest.xml" />
|
||||
<include subMenu="Alaska" installTo="menu:upperAir?before=RAOBMenuEnd"
|
||||
fileName="menus/upperair/baseAlaska.xml" />
|
||||
</menuContributionFile>
|
|
@ -44,4 +44,9 @@
|
|||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
||||
<plugin
|
||||
id="com.raytheon.uf.viz.d2d.ui.obs"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
</feature>
|
||||
|
|
|
@ -2,6 +2,5 @@
|
|||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -2,12 +2,11 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: D2D Local Menu
|
||||
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.ui.local;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Activator: com.raytheon.uf.viz.d2d.ui.local.Activator
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.grid;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.pointdata;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package com.raytheon.uf.viz.d2d.ui.local;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
public class Activator implements BundleActivator {
|
||||
|
||||
private static BundleContext context;
|
||||
|
||||
static BundleContext getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext bundleContext) throws Exception {
|
||||
Activator.context = bundleContext;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext bundleContext) throws Exception {
|
||||
Activator.context = null;
|
||||
}
|
||||
|
||||
}
|
|
@ -2,6 +2,5 @@
|
|||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -2,8 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: D2D Ncep Hydro
|
||||
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.ui.ncephydro;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Activator: com.raytheon.uf.viz.d2d.ui.ncephydro.Activator
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
|
||||
|
@ -13,5 +12,5 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
com.raytheon.viz.warnings;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.tcs;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.ccfp;bundle-version="1.12.1174"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ActivationPolicy: lazy
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
package com.raytheon.uf.viz.d2d.ui.ncephydro;
|
||||
|
||||
import org.osgi.framework.BundleActivator;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
public class Activator implements BundleActivator {
|
||||
|
||||
private static BundleContext context;
|
||||
|
||||
static BundleContext getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void start(BundleContext bundleContext) throws Exception {
|
||||
Activator.context = bundleContext;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
||||
*/
|
||||
public void stop(BundleContext bundleContext) throws Exception {
|
||||
Activator.context = null;
|
||||
}
|
||||
|
||||
}
|
6
cave/com.raytheon.uf.viz.d2d.ui.obs/.classpath
Normal file
6
cave/com.raytheon.uf.viz.d2d.ui.obs/.classpath
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
28
cave/com.raytheon.uf.viz.d2d.ui.obs/.project
Normal file
28
cave/com.raytheon.uf.viz.d2d.ui.obs/.project
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>com.raytheon.uf.viz.d2d.ui.obs</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>
|
|
@ -0,0 +1,7 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.7
|
10
cave/com.raytheon.uf.viz.d2d.ui.obs/META-INF/MANIFEST.MF
Normal file
10
cave/com.raytheon.uf.viz.d2d.ui.obs/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,10 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: D2D UI Obs
|
||||
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.ui.obs;singleton:=true
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.14.0"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ActivationPolicy: lazy
|
3
cave/com.raytheon.uf.viz.d2d.ui.obs/build.properties
Normal file
3
cave/com.raytheon.uf.viz.d2d.ui.obs/build.properties
Normal file
|
@ -0,0 +1,3 @@
|
|||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
74
cave/com.raytheon.uf.viz.d2d.ui.obs/plugin.xml
Normal file
74
cave/com.raytheon.uf.viz.d2d.ui.obs/plugin.xml
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<?eclipse version="3.5"?>
|
||||
<plugin>
|
||||
<extension point="org.eclipse.ui.menus">
|
||||
<menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=d2d.obsMenu">
|
||||
<menu id="obs" label="Obs" mnemonic="O">
|
||||
<visibleWhen>
|
||||
<reference
|
||||
definitionId="com.raytheon.uf.viz.d2d.ui.inD2DActionSet">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
<separator name="SURFACE" visible="false">
|
||||
</separator>
|
||||
<separator name="EndOfInitial" visible="true">
|
||||
</separator>
|
||||
<command commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ METAR ------">
|
||||
</command>
|
||||
<separator name="METAR" visible="false">
|
||||
</separator>
|
||||
<separator name="EndOfMetar" visible="true">
|
||||
</separator>
|
||||
<command commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ Synoptic ------">
|
||||
</command>
|
||||
<separator name="SYNOPTIC" visible="false">
|
||||
</separator>
|
||||
<separator name="EndOfSynoptic" visible="true">
|
||||
</separator>
|
||||
<command commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ Local data ------">
|
||||
</command>
|
||||
<separator name="LocalData" visible="false">
|
||||
</separator>
|
||||
<separator name="EndOfLocalData" visible="true">
|
||||
</separator>
|
||||
<command commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ Maritime ------" id="MARITIME">
|
||||
</command>
|
||||
<separator name="EndOfMaritime" visible="true">
|
||||
</separator>
|
||||
<command commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ Hazards ------">
|
||||
</command>
|
||||
<separator name="HAZARDS" visible="false" />
|
||||
<separator name="LIGHTNINGPLACEHOLDER"
|
||||
visible="false" />
|
||||
<separator name="FOGPLACEHOLDER" visible="false" />
|
||||
<separator name="SNOWPLACEHOLDER" visible="false" />
|
||||
<separator name="EndOfHazards" visible="true">
|
||||
</separator>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
</plugin>
|
|
@ -6,15 +6,9 @@ Bundle-Version: 1.14.0.qualifier
|
|||
Bundle-Vendor: RAYTHEON
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.profiler;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.vaa;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.cwa;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.bufrsigwx;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.radar;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.grid;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.redbook;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.ncwf;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.lpi;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.spi;bundle-version="1.12.1174"
|
||||
|
|
|
@ -46,27 +46,14 @@
|
|||
<contribute xsi:type="titleItem" titleText="------ Volcanic Ash ------" />
|
||||
<contribute xsi:type="separator" id="VolcanicAshStart"
|
||||
visible="false" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/VAA.xml"
|
||||
menuText="Volcanic Ash Advisories" id="VAA">
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="VolcanicAshEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem" titleText="------Center Weather ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/CWA.xml"
|
||||
menuText="Center Weather Advisories" id="cwa">
|
||||
</contribute>
|
||||
<contribute xsi:type="titleItem" titleText="------ Center Weather ------" />
|
||||
<contribute xsi:type="separator" id="CenterWeatherEnd" />
|
||||
|
||||
<contribute xsi:type="titleItem"
|
||||
titleText="------Significant Weather------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml"
|
||||
menuText="Medium Level" id="SigWxMedium">
|
||||
<substitute key="wxLayer" value="SWM" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/BufrSigWx.xml"
|
||||
menuText="High Level" id="SigWxHigh">
|
||||
<substitute key="wxLayer" value="SWH" />
|
||||
</contribute>
|
||||
titleText="------ Significant Weather ------" />
|
||||
<contribute xsi:type="separator" id="SignificantWeatherEnd" />
|
||||
</contribute>
|
||||
<contribute xsi:type="separator" id="AviationMenuEnd" />
|
||||
</menuTemplate>
|
|
@ -19,84 +19,61 @@
|
|||
further_licensing_information.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="subMenu" menuText="UA plots">
|
||||
<contribute xsi:type="titleItem" titleText="------ NCEP ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="200hPa" id="200hPa">
|
||||
<substitute key="wmo" value="PYMA20"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="250hPa" id="250hPa">
|
||||
<substitute key="wmo" value="PYMA25"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="300hPa" id="300hPa">
|
||||
<substitute key="wmo" value="PYMA30"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="500hPa" id="500hPa">
|
||||
<substitute key="wmo" value="PYMA50"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="700hPa" id="700hPa">
|
||||
<substitute key="wmo" value="PYMA70"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="850hPa" id="850hPa">
|
||||
<substitute key="wmo" value="PYMA85"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="titleItem" titleText="------ RAOB ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="150 hPa" id="150hPa">
|
||||
<substitute key="levelKey" value="150MB"/>
|
||||
<substitute key="plotSource" value="raob 150"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="200 hPa" id="200hPa">
|
||||
<substitute key="levelKey" value="200MB"/>
|
||||
<substitute key="plotSource" value="raob 200"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="250 hPa" id="250hPa">
|
||||
<substitute key="levelKey" value="250MB"/>
|
||||
<substitute key="plotSource" value="raob 250"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="300 hPa" id="300hPa">
|
||||
<substitute key="levelKey" value="300MB"/>
|
||||
<substitute key="plotSource" value="raob 300"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="400 hPa" id="400hPa">
|
||||
<substitute key="levelKey" value="400MB"/>
|
||||
<substitute key="plotSource" value="raob 400"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="500 hPa" id="500hPa">
|
||||
<substitute key="levelKey" value="500MB"/>
|
||||
<substitute key="plotSource" value="raob 500"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="700 hPa" id="700hPa">
|
||||
<substitute key="levelKey" value="700MB"/>
|
||||
<substitute key="plotSource" value="raob 700"/>
|
||||
<substitute key="plotModelFile" value="raobLowerDesign"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="850 hPa" id="850hPa">
|
||||
<substitute key="levelKey" value="850MB"/>
|
||||
<substitute key="plotSource" value="raob 850"/>
|
||||
<substitute key="plotModelFile" value="raobLowerDesign"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="925 hPa" id="925hPa">
|
||||
<substitute key="levelKey" value="925MB"/>
|
||||
<substitute key="plotSource" value="raob 925"/>
|
||||
<substitute key="plotModelFile" value="raobLowerDesign"/>
|
||||
</contribute>
|
||||
</contribute>
|
||||
<contribute xsi:type="subMenu" id="UAplots" menuText="UA plots">
|
||||
<contribute xsi:type="titleItem" titleText="------ NCEP ------" />
|
||||
<contribute xsi:type="separator" id="NCEPEnd"
|
||||
visible="false" />
|
||||
|
||||
<contribute xsi:type="subinclude" fileName="menus/upperair/uaMenus.xml"/>
|
||||
|
||||
<contribute xsi:type="separator" id="MySeparatorId"/>
|
||||
<contribute xsi:type="titleItem" titleText="------ RAOB ------" />
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="150 hPa" id="150hPa">
|
||||
<substitute key="levelKey" value="150MB" />
|
||||
<substitute key="plotSource" value="raob 150" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="200 hPa" id="200hPa">
|
||||
<substitute key="levelKey" value="200MB" />
|
||||
<substitute key="plotSource" value="raob 200" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="250 hPa" id="250hPa">
|
||||
<substitute key="levelKey" value="250MB" />
|
||||
<substitute key="plotSource" value="raob 250" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="300 hPa" id="300hPa">
|
||||
<substitute key="levelKey" value="300MB" />
|
||||
<substitute key="plotSource" value="raob 300" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="400 hPa" id="400hPa">
|
||||
<substitute key="levelKey" value="400MB" />
|
||||
<substitute key="plotSource" value="raob 400" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="500 hPa" id="500hPa">
|
||||
<substitute key="levelKey" value="500MB" />
|
||||
<substitute key="plotSource" value="raob 500" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="700 hPa" id="700hPa">
|
||||
<substitute key="levelKey" value="700MB" />
|
||||
<substitute key="plotSource" value="raob 700" />
|
||||
<substitute key="plotModelFile" value="raobLowerDesign" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="850 hPa" id="850hPa">
|
||||
<substitute key="levelKey" value="850MB" />
|
||||
<substitute key="plotSource" value="raob 850" />
|
||||
<substitute key="plotModelFile" value="raobLowerDesign" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/UpperAirPlot.xml"
|
||||
menuText="925 hPa" id="925hPa">
|
||||
<substitute key="levelKey" value="925MB" />
|
||||
<substitute key="plotSource" value="raob 925" />
|
||||
<substitute key="plotModelFile" value="raobLowerDesign" />
|
||||
</contribute>
|
||||
</contribute>
|
||||
|
||||
<contribute xsi:type="separator" id="baseUpperAirEnd" />
|
||||
</menuTemplate>
|
|
@ -1,56 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
|
||||
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
|
||||
<!--
|
||||
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.
|
||||
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
|
||||
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.
|
||||
-->
|
||||
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
|
||||
further_licensing_information.
|
||||
-->
|
||||
<menuContributionFile>
|
||||
|
||||
<include installTo="menu:upperAir?before=PROFILER" fileName="menus/upperair/baseUpperAir.xml" />
|
||||
<include subMenu="Alaska NPN time-height" installTo="menu:upperAir?after=PROFILER" fileName="menus/upperair/baseAlaskaNPN.xml" />
|
||||
<include subMenu="West NPN time-height" installTo="menu:upperAir?before=ProfilerMenuEnd"
|
||||
fileName="menus/upperair/baseWestNPN.xml" />
|
||||
<include subMenu="East NPN time-height" installTo="menu:upperAir?before=ProfilerMenuEnd"
|
||||
fileName="menus/upperair/baseEastNPN.xml" />
|
||||
<include installTo="menu:upperAir?before=ProfilerMenuEnd"
|
||||
fileName="menus/upperair/baseNPNPlot.xml" />
|
||||
<include installTo="menu:upperAir?after=RADAR" fileName="menus/upperair/baseRadar.xml" />
|
||||
<include subMenu="PIREP plots" installTo="menu:upperAir?after=AIRCRAFT" fileName="menus/upperair/basePirep.xml" />
|
||||
<include subMenu="MDCRS plots" installTo="menu:upperAir?before=AircraftMenuEnd"
|
||||
fileName="menus/upperair/baseMDCRS.xml" />
|
||||
<include installTo="menu:upperAir?before=AircraftMenuEnd"
|
||||
fileName="menus/upperair/baseAviation.xml" />
|
||||
<include installTo="menu:upperAir?after=RAOB" fileName="menus/upperair/baseRAOB.xml" />
|
||||
<include installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseAddedFeatures.xml" />
|
||||
<include subMenu="US Western" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseUSWestern.xml" />
|
||||
<include subMenu="US Central" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseUSCentral.xml" />
|
||||
<include subMenu="US Eastern" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseUSEastern.xml" />
|
||||
<include subMenu="Canada North" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseCanadaNorth.xml" />
|
||||
<include subMenu="Canada Western" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseCanadaWestern.xml" />
|
||||
<include subMenu="Canada Central" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseCanadaCentral.xml" />
|
||||
<include subMenu="Canada Eastern" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseCanadaEastern.xml" />
|
||||
<include subMenu="Mexico" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseMexico.xml" />
|
||||
<include subMenu="Atlantic" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseAtlantic.xml" />
|
||||
<include subMenu="Japan/South Asia" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseJapan.xml" />
|
||||
<include subMenu="Australia" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseAustralia.xml" />
|
||||
<include subMenu="China" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseChina.xml" />
|
||||
<include subMenu="Russia" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseRussia.xml" />
|
||||
<include subMenu="Pacific East" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/basePacificEast.xml" />
|
||||
<include subMenu="Pacific West" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/basePacificWest.xml" />
|
||||
<include subMenu="Alaska" installTo="menu:upperAir?before=RAOBMenuEnd" fileName="menus/upperair/baseAlaska.xml" />
|
||||
|
||||
<include installTo="menu:upperAir?before=PROFILER" fileName="menus/upperair/baseUpperAir.xml" />
|
||||
<include installTo="menu:upperAir?before=ProfilerMenuEnd"
|
||||
fileName="menus/upperair/baseNPNPlot.xml" />
|
||||
<include installTo="menu:upperAir?after=RADAR" fileName="menus/upperair/baseRadar.xml" />
|
||||
<include subMenu="PIREP plots" installTo="menu:upperAir?after=AIRCRAFT" fileName="menus/upperair/basePirep.xml" />
|
||||
<include subMenu="MDCRS plots" installTo="menu:upperAir?before=AircraftMenuEnd"
|
||||
fileName="menus/upperair/baseMDCRS.xml" />
|
||||
<include installTo="menu:upperAir?before=AircraftMenuEnd"
|
||||
fileName="menus/upperair/baseAviation.xml" />
|
||||
<include installTo="menu:upperAir?after=RAOB" fileName="menus/upperair/baseRAOB.xml" />
|
||||
<include installTo="menu:upperAir?before=RAOBMenuMiddle" fileName="menus/upperair/baseAddedFeatures.xml" />
|
||||
</menuContributionFile>
|
|
@ -52,9 +52,10 @@
|
|||
<command
|
||||
commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ RAOB ------" id="RAOB">
|
||||
</command>
|
||||
</command>
|
||||
<separator name="RAOBMenuMiddle" visible="false"/>
|
||||
<separator name="RAOBMenuEnd" visible="false"/>
|
||||
</menu>
|
||||
</menuContribution>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -2,10 +2,10 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Ui Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.uf.viz.d2d.ui;singleton:=true
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Version: 1.14.0.qualifier
|
||||
Bundle-Activator: com.raytheon.uf.viz.d2d.ui.Activator
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.uf.viz.d2d.ui,
|
||||
com.raytheon.uf.viz.d2d.ui.actions,
|
||||
|
|
|
@ -293,80 +293,7 @@
|
|||
</visibleWhen>
|
||||
<separator name="top" visible="false"/>
|
||||
</menu>
|
||||
<menu
|
||||
id="obs"
|
||||
label="Obs"
|
||||
mnemonic="O">
|
||||
<visibleWhen>
|
||||
<reference
|
||||
definitionId="com.raytheon.uf.viz.d2d.ui.inD2DActionSet">
|
||||
</reference>
|
||||
</visibleWhen>
|
||||
<separator
|
||||
name="SURFACE"
|
||||
visible="false">
|
||||
</separator>
|
||||
<separator
|
||||
name="EndOfInitial"
|
||||
visible="true">
|
||||
</separator>
|
||||
<command
|
||||
commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ METAR ------">
|
||||
</command>
|
||||
<separator
|
||||
name="METAR"
|
||||
visible="false">
|
||||
</separator>
|
||||
<separator
|
||||
name="EndOfMetar"
|
||||
visible="true">
|
||||
</separator>
|
||||
<command
|
||||
commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ Synoptic ------">
|
||||
</command>
|
||||
<separator
|
||||
name="SYNOPTIC"
|
||||
visible="false">
|
||||
</separator>
|
||||
<separator
|
||||
name="EndOfSynoptic"
|
||||
visible="true">
|
||||
</separator>
|
||||
<command
|
||||
commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ Local data ------">
|
||||
</command>
|
||||
<separator
|
||||
name="LocalData"
|
||||
visible="false">
|
||||
</separator>
|
||||
<separator
|
||||
name="EndOfLocalData"
|
||||
visible="true">
|
||||
</separator>
|
||||
<command
|
||||
commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ Maritime ------" id="MARITIME">
|
||||
</command>
|
||||
<separator
|
||||
name="EndOfMaritime"
|
||||
visible="true">
|
||||
</separator>
|
||||
<command
|
||||
commandId="com.raytheon.viz.ui.actions.titleAction"
|
||||
label="------ Hazards ------" >
|
||||
</command>
|
||||
<separator name="HAZARDS" visible="false"/>
|
||||
<separator name="LIGHTNINGPLACEHOLDER" visible="false"/>
|
||||
<separator name="FOGPLACEHOLDER" visible="false"/>
|
||||
<separator name="SNOWPLACEHOLDER" visible="false"/>
|
||||
<separator
|
||||
name="EndOfHazards"
|
||||
visible="true">
|
||||
</separator>
|
||||
</menu>
|
||||
<separator name="d2d.obsMenu" visible="false"/>
|
||||
<separator name="d2d.ncepHydroMenu" visible="false"/>
|
||||
<separator name="d2d.localMenu" visible="false"/>
|
||||
<separator name="d2d.upperAirMenu" visible="false"/>
|
||||
|
|
|
@ -54,6 +54,8 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* ------------- -------- ----------- --------------------------
|
||||
* Jan 20, 2014 2312 bsteffen Initial creation
|
||||
* Mar 10, 2014 2867 bsteffen Better frame range validation.
|
||||
* Oct 28, 2014 3767 bsteffen Automatically change filename if selected
|
||||
* format does not support all options.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -412,13 +414,23 @@ public class ImageExportDialog extends CaveSWTDialog {
|
|||
}
|
||||
}
|
||||
if (!goodSuffix) {
|
||||
MessageBox mb = new MessageBox(getShell(), SWT.ICON_ERROR | SWT.OK);
|
||||
mb.setText("Invalid Suffix");
|
||||
mb.setMessage("The file extension(" + suffix
|
||||
MessageBox mb = new MessageBox(getShell(), SWT.ICON_WARNING
|
||||
| SWT.YES | SWT.NO);
|
||||
mb.setText("Incompatible Format");
|
||||
ImageFormat format = options.getImageFormat();
|
||||
mb.setMessage("The format(" + suffix
|
||||
+ ") of the selected file is not valid for "
|
||||
+ options.getImageFormat().getDescription());
|
||||
mb.open();
|
||||
return false;
|
||||
+ format.getDescription()
|
||||
+ ". Would you like to continue and export the file in "
|
||||
+ format.getExtensions()[0] + " format?");
|
||||
int result = mb.open();
|
||||
if (result == SWT.YES) {
|
||||
suffix = format.getExtensions()[0];
|
||||
path = path.substring(0, path.lastIndexOf('.') + 1) + suffix;
|
||||
options.setFileLocation(new File(path));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
File file = options.getFileLocation();
|
||||
|
|
|
@ -37,6 +37,7 @@ import com.raytheon.uf.viz.core.datastructure.LoopProperties;
|
|||
* ------------- -------- ----------- --------------------------
|
||||
* Jan 20, 2014 2312 bsteffen Initial creation
|
||||
* Mar 10, 2014 2867 bsteffen Better frame range validation.
|
||||
* Oct 28, 2014 3767 bsteffen Change default name to screenCapture.png
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -79,7 +80,7 @@ public class ImageExportOptions {
|
|||
|
||||
}
|
||||
|
||||
private File fileLocation = new File("screenCapture.gif");
|
||||
private File fileLocation = new File("screenCapture.png");
|
||||
|
||||
private ImageFormat imageFormat = ImageFormat.SEQUENCE;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<import feature="com.raytheon.uf.viz.cots.feature" version="1.0.0.qualifier"/>
|
||||
<import feature="com.raytheon.uf.viz.common.core.feature" version="1.0.0.qualifier"/>
|
||||
<import feature="com.raytheon.uf.viz.core.feature" version="1.0.0.qualifier"/>
|
||||
<import feature="com.raytheon.uf.viz.d2d.nsharp.feature" version="1.0.0.qualifier"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuContributionFile>
|
||||
<include subMenu="East NPN time-height" installTo="menu:upperAir?after=PROFILER"
|
||||
fileName="menus/upperair/baseEastNPN.xml" />
|
||||
<include subMenu="West NPN time-height" installTo="menu:upperAir?after=PROFILER"
|
||||
fileName="menus/upperair/baseWestNPN.xml" />
|
||||
<include subMenu="Alaska NPN time-height" installTo="menu:upperAir?after=PROFILER"
|
||||
fileName="menus/upperair/baseAlaskaNPN.xml" />
|
||||
</menuContributionFile>
|
|
@ -34923,14 +34923,6 @@ bistable
|
|||
bistro
|
||||
bistro's
|
||||
bistros
|
||||
bitched
|
||||
bitchier
|
||||
bitchiest
|
||||
bitchily
|
||||
bitchiness
|
||||
bitchiness's
|
||||
bitching
|
||||
bitchy
|
||||
biter's
|
||||
bitings
|
||||
bittern
|
||||
|
@ -39696,8 +39688,6 @@ cockscomb
|
|||
cockscomb's
|
||||
cockscombs
|
||||
cockshies
|
||||
cocksucker
|
||||
cocksuckers
|
||||
cocksure
|
||||
cocky
|
||||
coco
|
||||
|
@ -60609,7 +60599,6 @@ lepers
|
|||
leprechaun
|
||||
leprechaun's
|
||||
leprechauns
|
||||
leprosy's
|
||||
leprous
|
||||
lepta
|
||||
lepton
|
||||
|
@ -70881,7 +70870,6 @@ piscatorial
|
|||
pismire
|
||||
pismire's
|
||||
pismires
|
||||
pissers
|
||||
pissoir
|
||||
pissoirs
|
||||
pistachio
|
||||
|
|
|
@ -66,7 +66,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.viz.spellchecker.Activator;
|
||||
import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
|
||||
|
||||
/**
|
||||
|
@ -79,6 +78,8 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
|
|||
* 18 APR 2008 ### lvenable Initial creation
|
||||
* 01Mar2010 4765 MW Fegan Moved from GFE plug-in.
|
||||
* 09/24/2014 #16693 lshi filter out swear words in spelling check
|
||||
* 10/23/2014 #3685 randerso Changes to support mixed case
|
||||
* 10/30/2014 #16693 lshi Add more swear words to the filter
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -87,9 +88,12 @@ import com.raytheon.uf.viz.spellchecker.jobs.SpellCheckJob;
|
|||
*
|
||||
*/
|
||||
public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
||||
private static java.util.List<String> swearWords = Arrays.asList("ASSHOLE");
|
||||
private static java.util.List<String> swearWords = Arrays.asList("asshole", "asshole's", "assholes",
|
||||
"bitch", "bitch's", "bitches", "leprosy", "gayest",
|
||||
"shit", "piss", "pissed","psser","pisses","pissing","tits");
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(SpellCheckDlg.class);
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SpellCheckDlg.class);
|
||||
|
||||
private static final Pattern DIGITS = Pattern.compile("\\d");
|
||||
|
||||
|
@ -331,6 +335,7 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
|||
* org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector#accept(org
|
||||
* .eclipse.ui.texteditor.spelling.SpellingProblem)
|
||||
*/
|
||||
@Override
|
||||
public void accept(SpellingProblem problem) {
|
||||
if (shell.isDisposed()) {
|
||||
return;
|
||||
|
@ -345,15 +350,16 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
|||
misspelledLbl.setText(badWord);
|
||||
|
||||
ICompletionProposal[] proposals = problem.getProposals();
|
||||
if (proposals != null && proposals.length > 0) {
|
||||
if ((proposals != null) && (proposals.length > 0)) {
|
||||
for (ICompletionProposal proposal : proposals) {
|
||||
String pdString = proposal.getDisplayString();
|
||||
Matcher pdMatch = CHANGE_TO.matcher(pdString);
|
||||
if (pdMatch.matches()) {
|
||||
String replString = pdMatch.group(1).toUpperCase();
|
||||
String replString = pdMatch.group(1);
|
||||
// proposals may include case changes, which get lost
|
||||
//if (replString != badWord) {
|
||||
if (!swearWords.contains(replString) && !replString.equals(badWord)) {
|
||||
// if (replString != badWord) {
|
||||
if (!swearWords.contains(replString)
|
||||
&& !replString.equals(badWord)) {
|
||||
suggestionList.add(replString);
|
||||
}
|
||||
}
|
||||
|
@ -370,7 +376,7 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
|||
|
||||
StyleRange styleRange = styledText.getStyleRangeAtOffset(problem
|
||||
.getOffset());
|
||||
if (styleRange == null || styleRange.isUnstyled()
|
||||
if ((styleRange == null) || styleRange.isUnstyled()
|
||||
|| styleRange.similarTo(REDSTYLE)) {
|
||||
if (ignoreAll.contains(badWord)) {
|
||||
scanForErrors();
|
||||
|
@ -407,6 +413,7 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
|||
* org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector#beginCollecting
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public void beginCollecting() {
|
||||
// nothing at present
|
||||
}
|
||||
|
@ -531,7 +538,7 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
|||
probStart = matcher.start(2);
|
||||
// Only replace unstyled (unlocked) instances
|
||||
styleRange = styledText.getStyleRangeAtOffset(probStart);
|
||||
if (styleRange == null || styleRange.isUnstyled()) {
|
||||
if ((styleRange == null) || styleRange.isUnstyled()) {
|
||||
repList.addFirst(Integer.valueOf(probStart));
|
||||
}
|
||||
found = matcher.find();
|
||||
|
@ -582,7 +589,8 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
|||
try {
|
||||
userDLFile.save();
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Error saving user dictionary", e);
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error saving user dictionary", e);
|
||||
}
|
||||
// The spell check job might have a backlog of errors
|
||||
// for this word, which no longer apply.
|
||||
|
@ -658,6 +666,7 @@ public class SpellCheckDlg extends Dialog implements ISpellingProblemCollector {
|
|||
* org.eclipse.ui.texteditor.spelling.ISpellingProblemCollector#endCollecting
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public void endCollecting() {
|
||||
MessageDialog.openInformation(shell, "", "Done checking document");
|
||||
styledText.setSelectionRange(0, 0);
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.ui.application.WorkbenchAdvisor;
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
import com.raytheon.uf.common.comm.HttpClient;
|
||||
|
@ -52,6 +51,7 @@ import com.raytheon.uf.viz.thinclient.localization.LocalizationCachePersistence;
|
|||
import com.raytheon.uf.viz.thinclient.localization.ThinClientLocalizationInitializer;
|
||||
import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
|
||||
import com.raytheon.uf.viz.thinclient.refresh.TimedRefresher;
|
||||
import com.raytheon.viz.ui.personalities.awips.AWIPSWorkbenchAdvisor;
|
||||
import com.raytheon.viz.ui.personalities.awips.AbstractAWIPSComponent;
|
||||
import com.raytheon.viz.ui.personalities.awips.CAVE;
|
||||
|
||||
|
@ -178,12 +178,11 @@ public class ThinClientComponent extends CAVE implements IThinClientComponent {
|
|||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.ui.personalities.awips.AbstractCAVEComponent#
|
||||
* getWorkbenchAdvisor()
|
||||
* @see com.raytheon.viz.ui.personalities.awips.AbstractAWIPSComponent#
|
||||
* createAWIPSWorkbenchAdvisor()
|
||||
*/
|
||||
@Override
|
||||
protected WorkbenchAdvisor getWorkbenchAdvisor() {
|
||||
// Use custom workbench advisor, will add thin client preferences page
|
||||
protected AWIPSWorkbenchAdvisor createAWIPSWorkbenchAdvisor() {
|
||||
return new ThinClientWorkbenchAdvisor();
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/VAA.xml"
|
||||
menuText="Volcanic Ash Advisories" id="VAA">
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuContributionFile>
|
||||
<include installTo="menu:Aviation?before=VolcanicAshEnd"
|
||||
fileName="menus/upperair/baseAviationVAA.xml" />
|
||||
</menuContributionFile>
|
|
@ -0,0 +1,475 @@
|
|||
##
|
||||
# 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.
|
||||
##
|
||||
# ----------------------------------------------------------------------------
|
||||
# SVN: $Revision$ - $Date$
|
||||
# ----------------------------------------------------------------------------
|
||||
# This software is in the public domain, furnished "as is", without technical
|
||||
# support, and with no warranty, express or implied, as to its usefulness for
|
||||
# any purpose.
|
||||
#
|
||||
# serpISC - version 1.7
|
||||
#
|
||||
# Changes an existing grid to blend better into neighboring ISC grids.
|
||||
# Can be used as an initial or final step in coordination. Only your grids
|
||||
# are affected: nothing happens to the ISC grids. The ISC button must have
|
||||
# been clicked on at least once before using this tool.
|
||||
#
|
||||
# Every point on the outer perimeter of CWA (i.e, belonging to selected ISCs)
|
||||
# takes part in a serp adjustment of the existing grid. If any ISC grids are
|
||||
# missing or not selected on a CWA boundary, your own grid is used there instead.
|
||||
#
|
||||
# You can use this tool on one ISC at a time to see how each one would influence
|
||||
# your grid. To fit all ISC boundaries at once you must have all of them clicked
|
||||
# on. Running the tool sequentially on each ISC will retain previous results if
|
||||
# you keep the older ones turned on, but different sequences will yield slightly
|
||||
# different results.
|
||||
#
|
||||
# Make sure your grid does not have an artificial boundary near the CWA border.
|
||||
# Otherwise, it might already match your ISC neighbor there, so the tool won't
|
||||
# adjust anything and your artificial boundary will remain.
|
||||
#
|
||||
# You can include or exclude as many sample points within your CWA as you like, but
|
||||
# sample points close to an ISC border can create unrealistic gradients.
|
||||
#
|
||||
# You can match a border only partway if you want. Suppose you want to meet your
|
||||
# ISC neighbor half way. Then set the "percent of full match" to 50. After sending
|
||||
# your ISC grid, your neighbor will want to match FULL way (not half) to meet the
|
||||
# newly received grid. You can also use "percent of full match" to nudge your
|
||||
# grid to your neighbors' grids.
|
||||
#
|
||||
# If your grid's duration spans several shorter-duration ISC grids, the ISC
|
||||
# grids will be time-averaged first (except for PoP which always uses the
|
||||
# maximum value) and the fit will be inexact. Or, if the ISC grids themselves
|
||||
# don't match at a CWA boundary (something you can't do in your own grid), the
|
||||
# the tool will converge intermediate contours to the point of the mismatch,
|
||||
# and the fit will look artificial.
|
||||
#
|
||||
# For winds serp runs twice, once for u and once for v.
|
||||
#
|
||||
# This tool cannot be used with Wx grids.
|
||||
#
|
||||
# Authors: Les Colin - WFO Boise, ID, and Tim Barker - SOO Boise, ID
|
||||
#
|
||||
# 2003/06/21 - Revised "remoteness" calculation (to counteract observation-
|
||||
# clustering). New module is called getGoodRemoteness.
|
||||
# numpy-Python code: Barker. Algorithm: Colin.
|
||||
# 2003/06/22 - Analyzes winds in u and v components, rather than by speed
|
||||
# and direction.
|
||||
# 2003/06/23 - Finishes tool by copying ISC data outside CWA.
|
||||
# 2003/10/29 - Runs serp without considering sample points, then runs it
|
||||
# again only on the samples. ISC-copy feature has been removed.
|
||||
# 2004/05/30 - Uses improved serp analysis (see Barker). Can include or exclude
|
||||
# various ISC neighbors. Can include or exclude currently displayed
|
||||
# samples within your CWA. Samples in the ISC areas are ignored.
|
||||
# 2004/07/09 - Modified to ignore duplicate sample points (previously, they
|
||||
# would hang the tool). Also modified tool to allow partial match
|
||||
# so that CWA grid adjusts only partway toward ISC grid.
|
||||
# 2004/09/04 - Modified to work on an edit area, perhaps only half way across the
|
||||
# home CWA. The effect is a taper from a full (or partial) adjustment
|
||||
# at designated ISC borders to zero change inside the home CWA where
|
||||
# the edit area stops.
|
||||
# 2004/09/21 - Now works even if preceded by ISC_Copy (by moving the home CWA-border
|
||||
# inward one pixel and comparing to nearest ISC neighbor values).
|
||||
# Tool completes by running an equivalent ISC_Copy on the selected ISC
|
||||
# borders. Tool now also contains a thinning feature to speed up
|
||||
# execution. e.g., thinning by 2 runs the tool on alternate border
|
||||
# points, thinning by 3 runs the tool on every third border point, etc.
|
||||
# 2004/09/25 - Corrected bug in preceding version in which sample points could possibly
|
||||
# coincide with the revised home CWA-border points and hang the tool.
|
||||
# 2004/11/10 - Final ISC_Copy feature made optional.
|
||||
# 2004/11/17 - Corrected return statement at end of tool, and repaired code when
|
||||
# NOT adjusting for elevation.
|
||||
# 2008/07/31 - added int() for arguments to createTimeRange for OB8.3. /TB
|
||||
# 2012/07/13 - Version 1.7. AWIPS2 Port.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
ToolType = "numeric"
|
||||
WeatherElementEdited = "variableElement"
|
||||
ScreenList=["SCALAR","VECTOR"]
|
||||
|
||||
#
|
||||
#====================================================================
|
||||
# Part to modify for local configuration
|
||||
defaultCWA="STO"
|
||||
VariableList=[
|
||||
("Include these WFOs:",["MTR","EKA","HNX","REV","MFR"],"check",["MTR","EKA","HNX","REV","MFR"]),
|
||||
("Intentional mismatch (CWA minus WFO):","0","alphaNumeric"),
|
||||
("Currently displayed CWA sample points:","Use","radio",["Use","Don't use"]),
|
||||
("Adjust for terrain elevation?","Yes","radio",["Yes","No"]),
|
||||
("Elevation Factor",36,"numeric"),
|
||||
("Tool thinning-factor:",1,"scale",[1,10],1),
|
||||
("Percent of full match",100,"scale",[0,100],1),
|
||||
("Copy ISC data in afterward?","No","radio",["Yes","No"]),
|
||||
]
|
||||
|
||||
from numpy import *
|
||||
import ObjAnal
|
||||
import SmartScript
|
||||
import time
|
||||
from math import sin,cos,acos,pi
|
||||
|
||||
class Tool (SmartScript.SmartScript):
|
||||
def __init__(self, dbss):
|
||||
self._dbss=dbss
|
||||
SmartScript.SmartScript.__init__(self, dbss)
|
||||
def preProcessTool(self,varDict):
|
||||
self.OA = ObjAnal.ObjAnal(self._dbss)
|
||||
|
||||
def execute(self, variableElement, variableElement_GridInfo, editArea, varDict, Topo, WEname, GridTimeRange):
|
||||
|
||||
wxType = variableElement_GridInfo.getGridType().ordinal()
|
||||
defCWA=self.getEditArea(defaultCWA)
|
||||
defcwa=self.encodeEditArea(defCWA)
|
||||
nondefcwa=1-defcwa # i.e., toggle
|
||||
nondefCWA=self.decodeEditArea(nondefcwa)
|
||||
defea=self.taperGrid(nondefCWA,2)*2
|
||||
|
||||
# The above line defines the default CWA area as defea==0, the outer perimeter of the default CWA
|
||||
# as defea==1, and further outside as defea==2.
|
||||
|
||||
arbea=self.encodeEditArea(editArea)
|
||||
nonarbea=1-arbea
|
||||
nonarbEA=self.decodeEditArea(nonarbea)
|
||||
arbea=self.taperGrid(nonarbEA,2)*2
|
||||
|
||||
cwa=zeros(Topo.shape)
|
||||
ISC=varDict["Include these WFOs:"]
|
||||
samps=varDict["Currently displayed CWA sample points:"]
|
||||
thin=varDict["Tool thinning-factor:"]
|
||||
partial=varDict["Percent of full match"]*.01
|
||||
|
||||
for WFO in ISC:
|
||||
CWA=self.getEditArea(WFO)
|
||||
cwa=self.encodeEditArea(CWA)+cwa
|
||||
|
||||
alltrs=self._getAllHourlyTimeRanges(GridTimeRange)
|
||||
if ((WEname=="MaxT")or(WEname=="PoP")):
|
||||
sum=zeros(Topo.shape)-150.0
|
||||
elif (WEname=="MinT"):
|
||||
sum=zeros(Topo.shape)+150.0
|
||||
else:
|
||||
if (wxType==2):
|
||||
sum=[zeros(Topo.shape),zeros(Topo.shape)]
|
||||
else:
|
||||
sum=zeros(Topo.shape)
|
||||
cnt=zeros(Topo.shape)
|
||||
|
||||
for tr in alltrs:
|
||||
isc=self.getComposite(WEname,tr,0)
|
||||
if isc is None:
|
||||
|
||||
continue
|
||||
#
|
||||
# Add to sums, or min/max
|
||||
#
|
||||
if wxType==1: # SCALAR
|
||||
bits,iscgrid=isc
|
||||
if ((WEname=="MaxT")or(WEname=="PoP")):
|
||||
sum=where(bits,maximum(iscgrid,sum),sum)
|
||||
cnt=where(bits,1,cnt)
|
||||
elif (WEname=="MinT"):
|
||||
sum=where(bits,minimum(iscgrid,sum),sum)
|
||||
cnt=where(bits,1,cnt)
|
||||
else:
|
||||
sum=where(bits,sum+iscgrid,sum)
|
||||
cnt=where(bits,cnt+1,cnt)
|
||||
if wxType==2: # VECTOR
|
||||
bits,mag,dir=isc
|
||||
(u,v)=self.MagDirToUV(mag,dir)
|
||||
sum[0]=where(bits,sum[0]+u,sum[0])
|
||||
sum[1]=where(bits,sum[1]+v,sum[1])
|
||||
cnt=where(bits,cnt+1,cnt)
|
||||
#
|
||||
# now calculate average/max/min, etc.
|
||||
# (count is always 1 for max/min)
|
||||
#
|
||||
if ((wxType==1)or(wxType==2)):
|
||||
if (wxType==2):
|
||||
(mag,dir)=variableElement
|
||||
(u,v)=self.MagDirToUV(mag,dir)
|
||||
sum[0]=where(equal(cnt,0),u,sum[0])
|
||||
sum[1]=where(equal(cnt,0),v,sum[1])
|
||||
else:
|
||||
sum=where(equal(cnt,0),variableElement,sum)
|
||||
cnt=where(equal(cnt,0),1,cnt)
|
||||
new=sum/cnt
|
||||
if (wxType==2):
|
||||
(mag,dir)=self.UVToMagDir(new[0],new[1])
|
||||
newvec=(mag,dir)
|
||||
|
||||
self.elevadjust=0
|
||||
self.elevfactor=0.
|
||||
if varDict["Adjust for terrain elevation?"]=="Yes":
|
||||
self.elevadjust=1
|
||||
self.elevfactor=varDict["Elevation Factor"]
|
||||
if self.elevfactor<1:
|
||||
self.elevfactor=0.
|
||||
|
||||
self.xloclist=[]
|
||||
self.yloclist=[]
|
||||
self.hloclist=[]
|
||||
self.zlist=[]
|
||||
self.ulist=[]
|
||||
self.vlist=[]
|
||||
|
||||
for x in range(1,Topo.shape[1]-1):
|
||||
for y in range(1,Topo.shape[0]-1):
|
||||
if (x+y)%thin!=0:
|
||||
continue
|
||||
if (arbea[y,x]<2 and defea[y,x]==0):
|
||||
if (cwa[y,x+1]==1) or (cwa[y,x-1]==1) or (cwa[y+1,x]==1) or (cwa[y-1,x]==1):
|
||||
if self.elevadjust==1:
|
||||
self.hloclist.append(Topo[y,x])
|
||||
else:
|
||||
self.hloclist.append(0.)
|
||||
self.xloclist.append(x)
|
||||
self.yloclist.append(y)
|
||||
if wxType==1:
|
||||
chgval=0.
|
||||
n=0
|
||||
if cwa[y,x+1]==1:
|
||||
if self.elevadjust==0:
|
||||
chgval=chgval+(new[y,x+1]-variableElement[y,x])
|
||||
elif self.elevadjust==1:
|
||||
elevdif=abs(Topo[y,x]-Topo[y,x+1])
|
||||
if elevdif<5000.:
|
||||
# ISC-CWA neighbors more than 5000 ft apart in elevation are too
|
||||
# dissimilar to compare.
|
||||
chgval=chgval+(new[y,x+1]-variableElement[y,x])*(1.0-elevdif/5000.)
|
||||
n=n+1
|
||||
if cwa[y,x-1]==1:
|
||||
if self.elevadjust==0:
|
||||
chgval=chgval+(new[y,x-1]-variableElement[y,x])
|
||||
elif self.elevadjust==1:
|
||||
elevdif=abs(Topo[y,x]-Topo[y,x-1])
|
||||
if elevdif<5000.:
|
||||
chgval=chgval+(new[y,x-1]-variableElement[y,x])*(1.0-elevdif/5000.)
|
||||
n=n+1
|
||||
if cwa[y+1,x]==1:
|
||||
if self.elevadjust==0:
|
||||
chgval=chgval+(new[y+1,x]-variableElement[y,x])
|
||||
elif self.elevadjust==1:
|
||||
elevdif=abs(Topo[y,x]-Topo[y+1,x])
|
||||
if elevdif<5000.:
|
||||
chgval=chgval+(new[y+1,x]-variableElement[y,x])*(1.0-elevdif/5000.)
|
||||
n=n+1
|
||||
if cwa[y-1,x]==1:
|
||||
if self.elevadjust==0:
|
||||
chgval=chgval+(new[y-1,x]-variableElement[y,x])
|
||||
elif self.elevadjust==1:
|
||||
elevdif=abs(Topo[y,x]-Topo[y-1,x])
|
||||
if elevdif<5000.:
|
||||
chgval=chgval+(new[y-1,x]-variableElement[y,x])*(1.0-elevdif/5000.)
|
||||
n=n+1
|
||||
self.zlist.append((chgval/n)*partial)
|
||||
|
||||
elif wxType==2:
|
||||
(magcwa,dircwa)=variableElement
|
||||
(ucwa,vcwa)=self.MagDirToUV(magcwa,dircwa)
|
||||
(uisc,visc)=self.MagDirToUV(mag,dir)
|
||||
chgu=0.
|
||||
chgv=0.
|
||||
n=0
|
||||
if cwa[y,x+1]==1:
|
||||
if self.elevadjust==0:
|
||||
chgu=chgu+(uisc[y,x+1]-ucwa[y,x])
|
||||
chgv=chgv+(visc[y,x+1]-vcwa[y,x])
|
||||
elif self.elevadjust==1:
|
||||
elevdif=abs(Topo[y,x]-Topo[y,x+1])
|
||||
if elevdif<5000.:
|
||||
chgu=chgu+(uisc[y,x+1]-ucwa[y,x])*(1.0-elevdif/5000.)
|
||||
chgv=chgv+(visc[y,x+1]-vcwa[y,x])*(1.0-elevdif/5000.)
|
||||
n=n+1
|
||||
if cwa[y,x-1]==1:
|
||||
if self.elevadjust==0:
|
||||
chgu=chgu+(uisc[y,x-1]-ucwa[y,x])
|
||||
chgv=chgv+(visc[y,x-1]-vcwa[y,x])
|
||||
elif self.elevadjust==1:
|
||||
elevdif=abs(Topo[y,x]-Topo[y,x-1])
|
||||
if elevdif<5000.:
|
||||
chgu=chgu+(uisc[y,x-1]-ucwa[y,x])*(1.0-elevdif/5000.)
|
||||
chgv=chgv+(visc[y,x-1]-vcwa[y,x])*(1.0-elevdif/5000.)
|
||||
n=n+1
|
||||
if cwa[y+1,x]==1:
|
||||
if self.elevadjust==0:
|
||||
chgu=chgu+(uisc[y+1,x]-ucwa[y,x])
|
||||
chgv=chgv+(visc[y+1,x]-vcwa[y,x])
|
||||
elif self.elevadjust==1:
|
||||
elevdif=abs(Topo[y,x]-Topo[y+1,x])
|
||||
if elevdif<5000.:
|
||||
chgu=chgu+(uisc[y+1,x]-ucwa[y,x])*(1.0-elevdif/5000.)
|
||||
chgv=chgv+(visc[y+1,x]-vcwa[y,x])*(1.0-elevdif/5000.)
|
||||
n=n+1
|
||||
if cwa[y-1,x]==1:
|
||||
if self.elevadjust==0:
|
||||
chgu=chgu+(uisc[y-1,x]-ucwa[y,x])
|
||||
chgv=chgv+(visc[y-1,x]-vcwa[y,x])
|
||||
elif self.elevadjust==1:
|
||||
elevdif=abs(Topo[y,x]-Topo[y-1,x])
|
||||
if elevdif<5000.:
|
||||
chgu=chgu+(uisc[y-1,x]-ucwa[y,x])*(1.0-elevdif/5000.)
|
||||
chgv=chgv+(visc[y-1,x]-vcwa[y,x])*(1.0-elevdif/5000.)
|
||||
n=n+1
|
||||
self.ulist.append((chgu/n)*partial)
|
||||
self.vlist.append((chgv/n)*partial)
|
||||
if arbea[y,x]==1 and defea[y,x]==0:
|
||||
self.pointok=0
|
||||
for nn in range(len(self.xloclist)):
|
||||
if (y==self.yloclist[nn]) and (x==self.xloclist[nn]):
|
||||
self.pointok=1
|
||||
# In the above line an edit area IS on the screen and here we're looking for boundary points
|
||||
# inside the home CWA that are more than one pixel from the border. We want to hold these
|
||||
# points steady (i.e., zero change).
|
||||
if self.pointok==1: # we already have this point, don't use it twice.
|
||||
continue
|
||||
self.xloclist.append(x)
|
||||
self.yloclist.append(y)
|
||||
if self.elevadjust==1:
|
||||
self.hloclist.append(Topo[y,x])
|
||||
else:
|
||||
self.hloclist.append(0.)
|
||||
if wxType==1:
|
||||
self.zlist.append(0.)
|
||||
if wxType==2:
|
||||
self.ulist.append(0.)
|
||||
self.vlist.append(0.)
|
||||
|
||||
if samps=="Use":
|
||||
self.samplePoints = self.getSamplePoints(None)
|
||||
for sample in self.samplePoints:
|
||||
(x,y)=sample
|
||||
self.sampleok=0
|
||||
for count in range(len(self.xloclist)):
|
||||
if ((x==self.xloclist[count]) and (y==self.yloclist[count])):
|
||||
self.sampleok=1
|
||||
# self.sampleok becomes 1 for a duplicate entry, so bypass the duplicate.
|
||||
if self.sampleok==1:
|
||||
continue
|
||||
if x<0 or x>Topo.shape[1]-1:
|
||||
continue
|
||||
if y<0 or y>Topo.shape[0]-1:
|
||||
continue
|
||||
if defea[y,x]!=0:
|
||||
continue
|
||||
|
||||
if self.elevadjust==1:
|
||||
self.hloclist.append(Topo[y,x])
|
||||
else:
|
||||
self.hloclist.append(0.)
|
||||
self.xloclist.append(x)
|
||||
self.yloclist.append(y)
|
||||
if wxType==1:
|
||||
self.zlist.append(0.)
|
||||
if wxType==2:
|
||||
self.ulist.append(0.)
|
||||
self.vlist.append(0.)
|
||||
#
|
||||
# Don't proceed if no points
|
||||
#
|
||||
if len(self.xloclist)==0:
|
||||
self.statusBarMsg("No data available to serp to...","R")
|
||||
return variableElement
|
||||
else:
|
||||
print " the number of points being used:",len(self.xloclist)
|
||||
#
|
||||
#
|
||||
#
|
||||
if wxType==1: # scalar
|
||||
zval=self.OA.Serp(self.zlist,self.xloclist,self.yloclist,self.hloclist,self.elevfactor,Topo)
|
||||
# zval is the new scalar-change grid.
|
||||
if varDict["Copy ISC data in afterward?"]=="Yes":
|
||||
znew=where(logical_or(equal(defea,0),equal(cwa,0)),variableElement+zval,new)
|
||||
else:
|
||||
znew=variableElement+zval
|
||||
|
||||
if wxType==2: # vector
|
||||
zval=self.OA.Serp(self.ulist,self.xloclist,self.yloclist,self.hloclist,self.elevfactor,Topo)
|
||||
# zval is the new u-change grid.
|
||||
if varDict["Copy ISC data in afterward?"]=="Yes":
|
||||
newu=where(logical_or(equal(defea,0),equal(cwa,0)),ucwa+zval,new[0])
|
||||
else:
|
||||
newu=ucwa+zval
|
||||
zval=self.OA.Serp(self.vlist,self.xloclist,self.yloclist,self.hloclist,self.elevfactor,Topo)
|
||||
# this zval is the new v-change grid.
|
||||
if varDict["Copy ISC data in afterward?"]=="Yes":
|
||||
newv=where(logical_or(equal(defea,0),equal(cwa,0)),vcwa+zval,new[1])
|
||||
else:
|
||||
newv=vcwa+zval
|
||||
(newspd,newdir)=self.UVToMagDir(newu,newv)
|
||||
# newspd=where(equal(defea+cwa,0),newspd,mag)
|
||||
# newdir=where(equal(defea+cwa,0),newdir,dir)
|
||||
|
||||
znew=(newspd,newdir)
|
||||
|
||||
absmax=variableElement_GridInfo.getMaxValue()
|
||||
absmin=variableElement_GridInfo.getMinValue()
|
||||
|
||||
if wxType==1:
|
||||
return clip(znew,absmin,absmax)
|
||||
else:
|
||||
return znew
|
||||
|
||||
#===================================================================
|
||||
# _getAllHourlyTimeRanges - gets a list of all 1-hour time ranges
|
||||
# within the specified time range
|
||||
#
|
||||
def _getAllHourlyTimeRanges(self,tr):
|
||||
#
|
||||
# get integer time of UTC midnight today
|
||||
#
|
||||
secsinhour=60*60
|
||||
lt=time.gmtime()
|
||||
mid=time.mktime((lt[0],lt[1],lt[2],0,0,0,lt[6],lt[7],lt[8]))
|
||||
#
|
||||
# get integer time of input timerange start
|
||||
#
|
||||
start=tr.startTime()
|
||||
year=start.year
|
||||
month=start.month
|
||||
day=start.day
|
||||
hour=start.hour
|
||||
trs=time.mktime((year,month,day,hour,0,0,lt[6],lt[7],lt[8]))
|
||||
#
|
||||
# get integer time of input timerange end
|
||||
#
|
||||
end=tr.endTime()
|
||||
year=end.year
|
||||
month=end.month
|
||||
day=end.day
|
||||
hour=end.hour
|
||||
tre=time.mktime((year,month,day,hour,0,0,lt[6],lt[7],lt[8]))
|
||||
#
|
||||
# The difference between start/end determines number of hours
|
||||
#
|
||||
numhours=int((tre-trs)/secsinhour)
|
||||
#
|
||||
# Difference between mid/start determines starting offset
|
||||
#
|
||||
offset=int((trs-mid)/secsinhour)
|
||||
#
|
||||
# create each hourly time range from offset
|
||||
#
|
||||
alltrs=[]
|
||||
for hour in range(0,numhours):
|
||||
newtr=self.createTimeRange(int(offset+hour),int(offset+hour+1),"Zulu")
|
||||
alltrs.append(newtr)
|
||||
|
||||
return alltrs
|
|
@ -33,6 +33,7 @@
|
|||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 02/12/2014 #2591 randerso Added retry when loading combinations fails
|
||||
# 10/20/2014 #3685 randerso Changed default of lowerCase to True if not specified
|
||||
|
||||
import string, getopt, sys, time, os, types, math
|
||||
import ModuleAccessor
|
||||
|
@ -191,7 +192,7 @@ class TextFormatter:
|
|||
if language is not None:
|
||||
text = product.translateForecast(text, language)
|
||||
# Convert to Upper Case
|
||||
if not forecastDef.get('lowerCase', 0):
|
||||
if not forecastDef.get('lowerCase', True):
|
||||
text = text.upper()
|
||||
else:
|
||||
text = "Text Product Type Invalid " + \
|
||||
|
|
|
@ -27,6 +27,12 @@
|
|||
#
|
||||
# Author: hansen
|
||||
# ----------------------------------------------------------------------------
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 10/20/2014 #3685 randerso Changes to support mixed case products
|
||||
|
||||
import EditAreaUtils
|
||||
import StringUtils
|
||||
|
@ -49,7 +55,7 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
|||
cityDescriptor ="Including the cities of",
|
||||
areaList=None, includeCities=1, includeZoneNames=1,
|
||||
includeIssueTime=1, includeCodes=1, includeVTECString=1,
|
||||
hVTECString=None, accurateCities=False):
|
||||
hVTECString=None, accurateCities=False, upperCase=True):
|
||||
# Make a UGC area header for the given areaLabel
|
||||
# Determine list of areas (there could be more than one if we are using a combination)
|
||||
|
||||
|
@ -227,7 +233,17 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
|||
if cityString != "":
|
||||
numCities = len(string.split(cityString, "...")[1:])
|
||||
if numCities == 1:
|
||||
cityDescriptor = string.replace(cityDescriptor, "CITIES", "CITY")
|
||||
def preserveCase(matchobj):
|
||||
orig = matchobj.group(0)
|
||||
repl = 'city'
|
||||
retv = ''
|
||||
for i in range(len(repl)):
|
||||
c = repl[i]
|
||||
if orig[i].isupper():
|
||||
c = c.upper()
|
||||
retv = retv + c
|
||||
return retv
|
||||
cityDescriptor = re.sub("cities", preserveCase, cityDescriptor, flags=re.IGNORECASE)
|
||||
cityString = self.endline(cityDescriptor + cityString,
|
||||
linelength=self._lineLength, breakStr=["..."])
|
||||
issueTimeStr = issueTimeStr + "\n\n"
|
||||
|
@ -249,6 +265,8 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
|||
if includeVTECString == 0:
|
||||
VTECString = ""
|
||||
header = codeString + VTECString + nameString + cityString + issueTimeStr
|
||||
if upperCase:
|
||||
header = header.upper()
|
||||
return header
|
||||
|
||||
# Make accurate city list based on the grids
|
||||
|
@ -569,8 +587,8 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
|||
if entry.has_key("fullStateName"):
|
||||
state = entry["fullStateName"]
|
||||
#Special District of Columbia case
|
||||
if state == "DISTRICT OF COLUMBIA":
|
||||
state = "THE DISTRICT OF COLUMBIA"
|
||||
if state.upper() == "DISTRICT OF COLUMBIA":
|
||||
state = "The District of Columbia"
|
||||
# Get part-of-state information
|
||||
partOfState = ""
|
||||
if entry.has_key("partOfState"):
|
||||
|
@ -583,15 +601,15 @@ class Header(EditAreaUtils.EditAreaUtils, StringUtils.StringUtils):
|
|||
if entry.has_key("ugcCode"):
|
||||
codeType = entry["ugcCode"][2]
|
||||
if codeType == "Z":
|
||||
nameType = "ZONE"
|
||||
nameType = "zone"
|
||||
elif codeType == "C":
|
||||
indCty=entry.get("independentCity", 0)
|
||||
if indCty == 1:
|
||||
nameType = "INDEPENDENT CITY"
|
||||
elif state == "LOUISIANA":
|
||||
nameType = "PARISH"
|
||||
nameType = "independent city"
|
||||
elif state == "Louisiana":
|
||||
nameType = "parish"
|
||||
else:
|
||||
nameType = "COUNTY"
|
||||
nameType = "county"
|
||||
else:
|
||||
codeType == "?"
|
||||
value = (state, partOfState)
|
||||
|
|
|
@ -1,22 +1,3 @@
|
|||
##
|
||||
# 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.
|
||||
##
|
||||
# ----------------------------------------------------------------------------
|
||||
# SVN: $Revision: 134 $ $Date: 2010-08-26 17:32:30 +0000 (Thu, 26 Aug 2010) $
|
||||
#
|
||||
|
@ -24,10 +5,22 @@
|
|||
# support, and with no warranty, express or implied, as to its usefulness for
|
||||
# any purpose.
|
||||
#
|
||||
# ObjAnal - version 2.8 - various Objective Analysis routines
|
||||
# ObjAnal - version 2.12 - various Objective Analysis routines
|
||||
#
|
||||
# Author: Tim Barker - SOO Boise, ID
|
||||
#
|
||||
# 2014/10/06 - Version 2.12. Fix typo with timetupe in logtime which handles
|
||||
# when running in simulations.
|
||||
# 2014/08/31 - Version 2.11. Get rid of debug print statement that shouldn't
|
||||
# have been there in the first place.
|
||||
# 2014/07/28 - Version 2.10. Fix issues when ActualElev=1 and landMask is
|
||||
# used, and a control point near the edge of the landMask has
|
||||
# an elevation that is wildly different than the grid elevation
|
||||
# at at that location. Also introduce the concept of a 'missing'
|
||||
# elevation value for the point obs. If the elevation is missing
|
||||
# the code will use the grid elevation - regardless of the
|
||||
# setting of ActualElev. Defaults to -500ft. Can be changed
|
||||
# with new setMissingElevThreshold routine (but doubt anybody will)
|
||||
# 2014/03/20 - Version 2.8. Better import of numpy. Used SmartScript for
|
||||
# _gmtime instead of time module (for more effective playback)
|
||||
# 2014/01/10 - Version 2.7. Fixed copy of self._empty
|
||||
|
@ -93,8 +86,12 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
# otherwise.......use the elevation of the gridpoint that
|
||||
# contains the station for elevation related
|
||||
# calculations
|
||||
# However...if the station elevation is lower than the missing
|
||||
# elevation Threshold, then use the grid elevation
|
||||
# even if ActualElev is equal to 1.
|
||||
#
|
||||
self.ActualElev=1
|
||||
self.MissingElevThreshold=-500
|
||||
#
|
||||
# Default Serp parameters
|
||||
# Cache (500 by default) (between 0 and 1000) amount of memory
|
||||
|
@ -126,9 +123,7 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
#
|
||||
self.DSquaredDist=-1
|
||||
self.DSquaredMaxPoints=-1
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
return
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -189,25 +184,50 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
yloclist=[]
|
||||
hloclist=[]
|
||||
zlist=[]
|
||||
if landMask is None:
|
||||
newlandMask=(topoGrid*0)+1
|
||||
else:
|
||||
newLandMask=landMask
|
||||
self.logtime("Point values used in analysis:",4)
|
||||
for i in range(len(values)):
|
||||
(name,x,y,elev,val)=values[i]
|
||||
if (x>(self.xmax-1))or(x<0)or(y>(self.ymax-1))or(y<0):
|
||||
continue
|
||||
hloclist.append(elev)
|
||||
#
|
||||
# If the ob point elevation is missing - always use
|
||||
# the gridpoint elevation
|
||||
#
|
||||
if elev>self.MissingElevThreshold:
|
||||
hloclist.append(elev)
|
||||
else:
|
||||
hloclist.append(topoGrid[y,x])
|
||||
xloclist.append(x)
|
||||
yloclist.append(y)
|
||||
#
|
||||
# If using actual elevations (rather than grid elevation)
|
||||
# we will estimate what the grid WOULD have at that elevation
|
||||
# and use THAT for determining the change that needs to be
|
||||
# made
|
||||
# If using the grid elevation at the point, then the
|
||||
# z value (change)is simply the observed value minus the guess
|
||||
# grid value.
|
||||
#
|
||||
if self.ActualElev==1:
|
||||
if self.ActualElev!=1:
|
||||
self.logtime(" %12s %3d,%3d %5d Val:%5.1f -- grid:%5.1f -- change:%5.1f"%(name,x,y,elev,val,guessGrid[y,x],val-guessGrid[y,x]),4)
|
||||
zlist.append(val-guessGrid[y,x])
|
||||
|
||||
#
|
||||
# If using actual elevations - then need to make the z value the
|
||||
# difference between what the guess grid WOULD have at the ob elevation
|
||||
# rather than the guess grid value itself. Searches outward until
|
||||
# it finds a guess grid point with an elevation less than 100 feet
|
||||
# from the ob's elevation.
|
||||
#
|
||||
else:
|
||||
pt=topoGrid[y,x]
|
||||
obLandMask=newLandMask[y,x]
|
||||
desiredDiff=100
|
||||
bestval=guessGrid[y,x]
|
||||
bestdif=abs(elev-pt)
|
||||
if elev>self.MissingElevThreshold:
|
||||
bestdif=abs(elev-pt)
|
||||
else:
|
||||
bestdif=0
|
||||
bestele=pt
|
||||
wid=1
|
||||
#
|
||||
|
@ -219,46 +239,48 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
# to change the grid at the observation gridpoint.
|
||||
#
|
||||
while ((bestdif>desiredDiff)and(wid<10)):
|
||||
#print " searching with wid=%d"%wid
|
||||
if ((y+wid)<self.ymax):
|
||||
for ii in range(max(0,x-wid),min(x+wid+1,self.xmax)):
|
||||
gelev=topoGrid[y+wid,ii]
|
||||
dif=abs(elev-gelev)
|
||||
if dif<bestdif:
|
||||
bestdif=dif
|
||||
bestele=gelev
|
||||
bestval=guessGrid[y+wid,ii]
|
||||
if obLandMask==newLandMask[y+wid,ii]:
|
||||
gelev=topoGrid[y+wid,ii]
|
||||
dif=abs(elev-gelev)
|
||||
if dif<bestdif:
|
||||
bestdif=dif
|
||||
bestele=gelev
|
||||
bestval=guessGrid[y+wid,ii]
|
||||
if ((y-wid)>=0):
|
||||
for ii in range(max(0,x-wid),min(x+wid+1,self.xmax)):
|
||||
gelev=topoGrid[y-wid,ii]
|
||||
dif=abs(elev-gelev)
|
||||
if dif<bestdif:
|
||||
bestdif=dif
|
||||
bestele=gelev
|
||||
bestval=guessGrid[y-wid,ii]
|
||||
if obLandMask==newLandMask[y-wid,ii]:
|
||||
gelev=topoGrid[y-wid,ii]
|
||||
dif=abs(elev-gelev)
|
||||
if dif<bestdif:
|
||||
bestdif=dif
|
||||
bestele=gelev
|
||||
bestval=guessGrid[y-wid,ii]
|
||||
if ((x+wid)<self.xmax):
|
||||
for jj in range(max(0,y-wid),min(y+wid+1,self.ymax)):
|
||||
gelev=topoGrid[jj,x+wid]
|
||||
dif=abs(elev-gelev)
|
||||
if dif<bestdif:
|
||||
bestdif=dif
|
||||
bestele=gelev
|
||||
bestval=guessGrid[jj,x+wid]
|
||||
if obLandMask==newLandMask[jj,x+wid]:
|
||||
gelev=topoGrid[jj,x+wid]
|
||||
dif=abs(elev-gelev)
|
||||
if dif<bestdif:
|
||||
bestdif=dif
|
||||
bestele=gelev
|
||||
bestval=guessGrid[jj,x+wid]
|
||||
if ((x-wid)>=0):
|
||||
for jj in range(max(0,y-wid),min(y+wid+1,self.ymax)):
|
||||
gelev=topoGrid[jj,x-wid]
|
||||
dif=abs(elev-gelev)
|
||||
if dif<bestdif:
|
||||
bestdif=dif
|
||||
bestele=gelev
|
||||
bestval=guessGrid[jj,x-wid]
|
||||
if obLandMask==newLandMask[jj,x-wid]:
|
||||
gelev=topoGrid[jj,x-wid]
|
||||
dif=abs(elev-gelev)
|
||||
if dif<bestdif:
|
||||
bestdif=dif
|
||||
bestele=gelev
|
||||
bestval=guessGrid[jj,x-wid]
|
||||
if bestdif>desiredDiff:
|
||||
wid+=1
|
||||
estval=bestval
|
||||
self.logtime(" %12s %3d,%3d, est at %5d:%5.1f --- grid at %5d:%5.1f --- (%5d diff) -- Val:%5.1f -- Change:%5.1f"%(name,x,y,elev,estval,pt,guessGrid[y,x],pt-elev,val,val-estval),4)
|
||||
zlist.append(val-estval)
|
||||
else:
|
||||
self.logtime(" %12s %3d,%3d %5d Val:%5.1f -- grid:%5.1f -- change:%5.1f"%(name,x,y,elev,val,guessGrid[y,x],val-guessGrid[y,x]),4)
|
||||
zlist.append(val-guessGrid[y,x])
|
||||
#
|
||||
# Do the requested analysis
|
||||
#
|
||||
|
@ -669,7 +691,7 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
# Get distance squared of control points to every gridpoint
|
||||
#
|
||||
self.logtime("Getting distance squared between control points and gridpoints",3)
|
||||
dists=zeros((numpts,self.ymax,self.xmax),np.float32)
|
||||
dists=np.zeros((numpts,self.ymax,self.xmax),np.float32)
|
||||
for k in range(numpts):
|
||||
d=self.getDistance(xarr[k],yarr[k],harr[k],scaledtopo,newlandMask)*self.gridres
|
||||
dists[k]=(d*d).astype(np.float32)
|
||||
|
@ -711,8 +733,8 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
# Barnes PASS 1
|
||||
#
|
||||
self.logtime("Barnes Pass 1",3)
|
||||
totweights=zeros((self.ymax,self.xmax),np.float32)
|
||||
totsum=zeros((self.ymax,self.xmax),np.float32)
|
||||
totweights=np.zeros((self.ymax,self.xmax),np.float32)
|
||||
totsum=np.zeros((self.ymax,self.xmax),np.float32)
|
||||
for k in range(numpts):
|
||||
#
|
||||
# get scaled distance squared divided by kappa
|
||||
|
@ -740,8 +762,8 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
# Barnes PASS 2
|
||||
#
|
||||
self.logtime("Barnes Pass 2",3)
|
||||
totweights=zeros((self.ymax,self.xmax),np.float32)
|
||||
totsum=zeros((self.ymax,self.xmax),np.float32)
|
||||
totweights=np.zeros((self.ymax,self.xmax),np.float32)
|
||||
totsum=np.zeros((self.ymax,self.xmax),np.float32)
|
||||
for k in range(numpts):
|
||||
#
|
||||
# get scaled distance squared divided by gamma *kappa
|
||||
|
@ -1080,6 +1102,15 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
self.verbose=0
|
||||
return
|
||||
#---------------------------------------------------------------------------
|
||||
# setMissingElevThreshold - set the MissingElevThreshold value
|
||||
# Obs with elevation values less than or equal to this threshold
|
||||
# will use the topo grid elevation instead, even if ActualElev is set
|
||||
# to 1.
|
||||
#
|
||||
def setMissingElevThreshold(self,value):
|
||||
self.MissingElevThreshold=value
|
||||
return
|
||||
#---------------------------------------------------------------------------
|
||||
# logtime - write a string with date/time stamp. Can dynamically control
|
||||
# which get printed by using the importance and verbosity settings.
|
||||
# Will only print message with importance less or equal to verbosity
|
||||
|
@ -1089,7 +1120,7 @@ class ObjAnal(SmartScript.SmartScript):
|
|||
#
|
||||
def logtime(self,string,importance=0):
|
||||
if importance<=self.verbose:
|
||||
tt=self._gmtime().timetuple
|
||||
tt=self._gmtime().timetuple()
|
||||
ts="%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d"%(tt[0],tt[1],tt[2],tt[3],tt[4],tt[5])
|
||||
print "%s|ObjAnal - %s" % (ts,string)
|
||||
sys.stdout.flush()
|
||||
|
|
|
@ -95,6 +95,7 @@ import com.raytheon.uf.common.activetable.VTECChange;
|
|||
import com.raytheon.uf.common.activetable.VTECTableChangeNotification;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.textproduct.DraftProduct;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.textproduct.ProductDefinition;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.MixedCaseProductSupport;
|
||||
import com.raytheon.uf.common.jms.notification.INotificationObserver;
|
||||
import com.raytheon.uf.common.jms.notification.NotificationException;
|
||||
import com.raytheon.uf.common.jms.notification.NotificationMessage;
|
||||
|
@ -158,6 +159,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* 02/05/2014 17022 ryu Modified loadDraft() to fix merging of WMO heading and AWIPS ID.
|
||||
* 03/25/2014 #2884 randerso Added xxxid to check for disabling editor
|
||||
* 05/12/2014 16195 zhao Modified widgetSelected() for "Auto Wrap" option widget
|
||||
* 10/20/2014 #3685 randerso Made conversion to upper case conditional on product id
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -480,7 +482,7 @@ public class ProductEditorComp extends Composite implements
|
|||
break;
|
||||
case SWT.Show:
|
||||
if ((!dead)
|
||||
&& (getProductText() != null || !getProductText()
|
||||
&& ((getProductText() != null) || !getProductText()
|
||||
.isEmpty())) {
|
||||
timeUpdater.schedule();
|
||||
}
|
||||
|
@ -707,7 +709,7 @@ public class ProductEditorComp extends Composite implements
|
|||
Rectangle trim = p.computeTrim(0, 0, 0, 0);
|
||||
Point dpi = p.getDPI();
|
||||
int leftMargin = dpi.x + trim.x;
|
||||
int topMargin = dpi.y / 2 + trim.y;
|
||||
int topMargin = (dpi.y / 2) + trim.y;
|
||||
GC gc = new GC(p);
|
||||
Font font = gc.getFont();
|
||||
String printText = textComp.getProductText();
|
||||
|
@ -866,8 +868,8 @@ public class ProductEditorComp extends Composite implements
|
|||
autoWrapMI.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
wrapMode = !wrapMode;
|
||||
textComp.setAutoWrapMode(wrapMode);
|
||||
wrapMode = !wrapMode;
|
||||
textComp.setAutoWrapMode(wrapMode);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1159,7 +1161,9 @@ public class ProductEditorComp extends Composite implements
|
|||
textComp.getTextEditorST().setText(
|
||||
textComp.getTextEditorST().getText() + "\n");
|
||||
}
|
||||
textComp.upper();
|
||||
if (!MixedCaseProductSupport.isMixedCase(getNNNid())) {
|
||||
textComp.upper();
|
||||
}
|
||||
textComp.endUpdate();
|
||||
|
||||
if (!frameCheck(false)) {
|
||||
|
@ -1292,7 +1296,7 @@ public class ProductEditorComp extends Composite implements
|
|||
"Error sending active table request to http server ", e);
|
||||
}
|
||||
|
||||
if (records == null || records.isEmpty()) {
|
||||
if ((records == null) || records.isEmpty()) {
|
||||
activeVtecRecords = null;
|
||||
} else {
|
||||
if (pil != null) {
|
||||
|
@ -1391,7 +1395,7 @@ public class ProductEditorComp extends Composite implements
|
|||
activeRecs = getMatchingActiveVTEC(zones, oid, phen, sig,
|
||||
etn);
|
||||
String eventStr = "." + phen + "." + sig + "." + etn;
|
||||
if (activeRecs == null || activeRecs.isEmpty()) {
|
||||
if ((activeRecs == null) || activeRecs.isEmpty()) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"No active records found for " + vtec);
|
||||
} else {
|
||||
|
@ -1406,7 +1410,7 @@ public class ProductEditorComp extends Composite implements
|
|||
|
||||
// segment invalid due to the event going into
|
||||
// effect in part of the segment area
|
||||
if (started > 0 && started < activeRecs.size()) {
|
||||
if ((started > 0) && (started < activeRecs.size())) {
|
||||
final String msg = "Event "
|
||||
+ eventStr
|
||||
+ " has gone into effect in part"
|
||||
|
@ -1508,8 +1512,8 @@ public class ProductEditorComp extends Composite implements
|
|||
}
|
||||
|
||||
// Check start and ending time for end later than start
|
||||
if (vtecStart != null && vtecEnd != null
|
||||
&& vtecStart.getTime() >= vtecEnd.getTime()) {
|
||||
if ((vtecStart != null) && (vtecEnd != null)
|
||||
&& (vtecStart.getTime() >= vtecEnd.getTime())) {
|
||||
setTabColorFunc(productStateEnum.New);
|
||||
String msg = "VTEC ending time is before "
|
||||
+ "starting time. Product is invalid and must"
|
||||
|
@ -1520,13 +1524,13 @@ public class ProductEditorComp extends Composite implements
|
|||
// Give 30 minutes of slack to a couple of action codes
|
||||
// check the ending time and transmission time
|
||||
if ((action.equals("EXP") || action.equals("CAN"))
|
||||
&& vtecEnd != null) {
|
||||
vtecEnd.setTime(vtecEnd.getTime() + 30
|
||||
* TimeUtil.MILLIS_PER_MINUTE);
|
||||
&& (vtecEnd != null)) {
|
||||
vtecEnd.setTime(vtecEnd.getTime()
|
||||
+ (30 * TimeUtil.MILLIS_PER_MINUTE));
|
||||
}
|
||||
|
||||
if (vtecEnd != null
|
||||
&& vtecEnd.getTime() <= transmissionTime.getTime()) {
|
||||
if ((vtecEnd != null)
|
||||
&& (vtecEnd.getTime() <= transmissionTime.getTime())) {
|
||||
setTabColorFunc(productStateEnum.New);
|
||||
String msg = "VTEC ends before current time."
|
||||
+ " Product is invalid and must be regenerated.";
|
||||
|
@ -1596,7 +1600,7 @@ public class ProductEditorComp extends Composite implements
|
|||
|
||||
// time contains, if time range (tr) contains time (t), return 1 def
|
||||
public boolean contains(Date t) {
|
||||
return t.getTime() >= startTime.getTime() && t.before(endTime);
|
||||
return (t.getTime() >= startTime.getTime()) && t.before(endTime);
|
||||
}
|
||||
|
||||
public Date getStartTime() {
|
||||
|
@ -1650,7 +1654,7 @@ public class ProductEditorComp extends Composite implements
|
|||
zones = decodeUGCs(segData);
|
||||
vtecs = getVTEClines(segData);
|
||||
newVtecs = fixVTEC(zones, vtecs, transmissionTime);
|
||||
if (newVtecs != null && !newVtecs.isEmpty()) {
|
||||
if ((newVtecs != null) && !newVtecs.isEmpty()) {
|
||||
textComp.replaceText(tipVtec, newVtecs);
|
||||
}
|
||||
} catch (VizException e) {
|
||||
|
@ -1761,7 +1765,9 @@ public class ProductEditorComp extends Composite implements
|
|||
|
||||
textComp.startUpdate();
|
||||
try {
|
||||
textComp.upper();
|
||||
if (!MixedCaseProductSupport.isMixedCase(getNNNid())) {
|
||||
textComp.upper();
|
||||
}
|
||||
status1 = frameCheck(true);
|
||||
boolean status2 = changeTimes();
|
||||
if (status1 && status2) {
|
||||
|
@ -1935,7 +1941,8 @@ public class ProductEditorComp extends Composite implements
|
|||
int sel = hoursSpnr.getSelection();
|
||||
int hours = sel / 100;
|
||||
int minuteInc = (sel % 100) / 25;
|
||||
int purgeOffset = hours * TimeUtil.MINUTES_PER_HOUR + minuteInc * 15; // minutes
|
||||
int purgeOffset = (hours * TimeUtil.MINUTES_PER_HOUR)
|
||||
+ (minuteInc * 15); // minutes
|
||||
|
||||
Date now = SimulatedTime.getSystemTime().getTime();
|
||||
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
|
@ -1943,7 +1950,7 @@ public class ProductEditorComp extends Composite implements
|
|||
cal.add(Calendar.MINUTE, purgeOffset);
|
||||
int min = cal.get(Calendar.MINUTE);
|
||||
if ((min % 15) >= 1) {
|
||||
cal.set(Calendar.MINUTE, (min / 15 + 1) * 15);
|
||||
cal.set(Calendar.MINUTE, ((min / 15) + 1) * 15);
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
}
|
||||
this.expireDate = cal.getTime();
|
||||
|
@ -2130,7 +2137,7 @@ public class ProductEditorComp extends Composite implements
|
|||
long delta = expireTimeSec % roundSec;
|
||||
long baseTime = (expireTimeSec / roundSec) * roundSec
|
||||
* TimeUtil.MILLIS_PER_SECOND;
|
||||
if (delta / TimeUtil.SECONDS_PER_MINUTE >= 1) {
|
||||
if ((delta / TimeUtil.SECONDS_PER_MINUTE) >= 1) {
|
||||
expireTime.setTime(baseTime
|
||||
+ (roundSec * TimeUtil.MILLIS_PER_SECOND));
|
||||
} else { // within 1 minute, don't add next increment
|
||||
|
@ -2288,7 +2295,8 @@ public class ProductEditorComp extends Composite implements
|
|||
} catch (IOException e) {
|
||||
MessageBox mb = new MessageBox(parent.getShell(), SWT.OK
|
||||
| SWT.ICON_WARNING);
|
||||
mb.setText("Formatter AutoWrite failed: " + this.pil);
|
||||
mb.setText("Error");
|
||||
mb.setMessage("Formatter AutoWrite failed: " + this.pil);
|
||||
mb.open();
|
||||
}
|
||||
}
|
||||
|
@ -2422,7 +2430,7 @@ public class ProductEditorComp extends Composite implements
|
|||
|
||||
private void displayCallToActionsDialog(int callToActionType) {
|
||||
// Allow only one of the 3 types of dialogs to be displayed.
|
||||
if (ctaDialog != null && ctaDialog.getShell() != null
|
||||
if ((ctaDialog != null) && (ctaDialog.getShell() != null)
|
||||
&& !ctaDialog.isDisposed()) {
|
||||
ctaDialog.bringToTop();
|
||||
return;
|
||||
|
@ -2673,6 +2681,10 @@ public class ProductEditorComp extends Composite implements
|
|||
return productId;
|
||||
}
|
||||
|
||||
public String getNNNid() {
|
||||
return textdbPil.substring(3, 6);
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
@ -2901,24 +2913,24 @@ public class ProductEditorComp extends Composite implements
|
|||
|
||||
// Word-wrap the whole selection.
|
||||
int curLine = styledText.getLineAtOffset(selectionRange.x);
|
||||
int lastSelIdx = selectionRange.x + selectionRange.y - 1;
|
||||
int lastSelIdx = (selectionRange.x + selectionRange.y) - 1;
|
||||
int lastLine = styledText.getLineAtOffset(lastSelIdx);
|
||||
int[] indices = null;
|
||||
while (curLine <= lastLine && curLine < styledText.getLineCount()) {
|
||||
while ((curLine <= lastLine) && (curLine < styledText.getLineCount())) {
|
||||
int lineOff = styledText.getOffsetAtLine(curLine);
|
||||
// word wrap a block, and find out how the text length changed.
|
||||
indices = textComp.wordWrap(styledText, lineOff, wrapColumn);
|
||||
int firstIdx = indices[0];
|
||||
int lastIdx = indices[1];
|
||||
int newLen = indices[2];
|
||||
int oldLen = 1 + lastIdx - firstIdx;
|
||||
int oldLen = (1 + lastIdx) - firstIdx;
|
||||
int diff = newLen - oldLen;
|
||||
// adjust our endpoint for the change in length
|
||||
lastSelIdx += diff;
|
||||
lastLine = styledText.getLineAtOffset(lastSelIdx);
|
||||
// newLen doesn't include \n, so it can be 0. Don't allow
|
||||
// firstIdx+newLen-1 to be < firstIdx, or loop becomes infinite.
|
||||
int lastWrapIdx = Math.max(firstIdx, firstIdx + newLen - 1);
|
||||
int lastWrapIdx = Math.max(firstIdx, (firstIdx + newLen) - 1);
|
||||
// move down to the next unwrapped line
|
||||
curLine = styledText.getLineAtOffset(lastWrapIdx) + 1;
|
||||
}
|
||||
|
@ -2979,7 +2991,7 @@ public class ProductEditorComp extends Composite implements
|
|||
String str = null;
|
||||
|
||||
Object obj = productDefinition.get(key);
|
||||
if (obj != null && obj instanceof Collection) {
|
||||
if ((obj != null) && (obj instanceof Collection)) {
|
||||
Collection<?> collection = (Collection<?>) obj;
|
||||
str = (String) (collection.toArray())[0];
|
||||
} else {
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
/**
|
||||
* 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.viz.grid.rsc.general;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
|
||||
/**
|
||||
* A pool of {@link Job} that executes {@link GridDataRequestRunner}s with a
|
||||
* scheduling pattern that is ideal for smooth user interaction. This object
|
||||
* expects {@link #schedule(GridDataRequestRunner)} to be called each time data
|
||||
* is needed that is not yet available(primarily when the frame is displayed).
|
||||
* Calling {@link #schedule(GridDataRequestRunner)} causes the runner to be
|
||||
* bumped to the front of the queue so that data will be ready as soon as
|
||||
* possible. This causes runners that are not being displayed to frequently get
|
||||
* bumped to the back of the queue, which is desired since the user does not
|
||||
* need that data yet.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* Oct 29, 2014 3668 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class GridDataRequestJobPool {
|
||||
|
||||
private static final int POOL_SIZE = Integer.getInteger(
|
||||
"grid.request.pool.size", 10);
|
||||
|
||||
private static final GridDataRequestJobPool instance = new GridDataRequestJobPool();
|
||||
|
||||
public static void schedule(GridDataRequestRunner runner) {
|
||||
instance.scheduleRunner(runner);
|
||||
}
|
||||
|
||||
protected LinkedBlockingQueue<Job> jobQueue = new LinkedBlockingQueue<Job>();
|
||||
|
||||
protected List<GridDataRequestRunner> runners = new LinkedList<>();
|
||||
|
||||
private GridDataRequestJobPool(){
|
||||
for (int i = 0; i <POOL_SIZE; i++) {
|
||||
jobQueue.add(new GridDataRequestJob());
|
||||
}
|
||||
}
|
||||
|
||||
protected void scheduleRunner(GridDataRequestRunner runner) {
|
||||
synchronized (runners) {
|
||||
if (runners.isEmpty() || !(runners.get(0) == runner)) {
|
||||
runners.remove(runner);
|
||||
runners.add(0, runner);
|
||||
}
|
||||
}
|
||||
Job job = jobQueue.poll();
|
||||
if (job != null) {
|
||||
job.schedule();
|
||||
}
|
||||
}
|
||||
|
||||
protected void reschedule(GridDataRequestRunner runner){
|
||||
synchronized (runners) {
|
||||
if(!runners.contains(runner)){
|
||||
runners.add(runner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected GridDataRequestRunner getNextRunner(){
|
||||
synchronized (runners) {
|
||||
if(runners.isEmpty()){
|
||||
return null;
|
||||
}else{
|
||||
return runners.remove(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class GridDataRequestJob extends Job{
|
||||
|
||||
public GridDataRequestJob() {
|
||||
super("Requesting Grid Data");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
jobQueue.offer(this);
|
||||
GridDataRequestRunner runner = getNextRunner();
|
||||
while(runner != null){
|
||||
if(runner.processOneRequest()){
|
||||
reschedule(runner);
|
||||
}
|
||||
runner = getNextRunner();
|
||||
}
|
||||
return Status.OK_STATUS;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -22,8 +22,6 @@ package com.raytheon.viz.grid.rsc.general;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -34,7 +32,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
|
||||
/**
|
||||
*
|
||||
* Manages asynchronously requesting data for GridResources.
|
||||
* Manages asynchronously requesting data for {@link AbstractGridResource}s.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -48,19 +46,15 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* Jun 24, 2013 2140 randerso Moved safe name code into AbstractVizResource
|
||||
* Oct 07, 2014 3668 bclement uses executor instead of eclipse job
|
||||
* renamed to GridDataRequestRunner
|
||||
* Oct 29, 2014 3668 bsteffen replace executor with custom job pool.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
* @see GridDataRequestJobPool
|
||||
*/
|
||||
class GridDataRequestRunner implements Runnable {
|
||||
|
||||
private static final int POOL_SIZE = Integer.getInteger(
|
||||
"grid.request.pool.size", 10);
|
||||
|
||||
private static final Executor executor = Executors
|
||||
.newFixedThreadPool(POOL_SIZE);
|
||||
class GridDataRequestRunner {
|
||||
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GridDataRequestRunner.class);
|
||||
|
@ -79,6 +73,8 @@ class GridDataRequestRunner implements Runnable {
|
|||
// been notified.)
|
||||
public boolean exceptionHandled = false;
|
||||
|
||||
public boolean isRunning = false;
|
||||
|
||||
public GridDataRequest(DataTime time, List<PluginDataObject> pdos) {
|
||||
this.time = time;
|
||||
if (pdos == null) {
|
||||
|
@ -90,13 +86,12 @@ class GridDataRequestRunner implements Runnable {
|
|||
}
|
||||
|
||||
public boolean shouldRequest() {
|
||||
return (gridData == null) && (exception == null);
|
||||
return (gridData == null) && (exception == null)
|
||||
&& (isRunning == false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private volatile boolean cancelled = false;
|
||||
|
||||
private AbstractGridResource<?> resource;
|
||||
|
||||
private List<GridDataRequest> requests = new ArrayList<GridDataRequest>();
|
||||
|
@ -105,39 +100,46 @@ class GridDataRequestRunner implements Runnable {
|
|||
this.resource = resource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (GridDataRequest request = getNext(); request != null; request = getNext()) {
|
||||
try {
|
||||
request.gridData = resource.getData(request.time, request.pdos);
|
||||
if (request.gridData == null) {
|
||||
// need to remove unfulfillable requests to avoid infinite
|
||||
// loop.
|
||||
synchronized (requests) {
|
||||
requests.remove(request);
|
||||
}
|
||||
} else {
|
||||
resource.issueRefresh();
|
||||
/**
|
||||
* Attempt to process a request if there are any that need to be processed
|
||||
*
|
||||
* @return true if a request was processed or false if no requests need to
|
||||
* be processed.
|
||||
*/
|
||||
public boolean processOneRequest() {
|
||||
GridDataRequest request = getNext();
|
||||
if (request == null) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
request.gridData = resource.getData(request.time, request.pdos);
|
||||
if (request.gridData == null) {
|
||||
/* need to remove unfulfillable requests to avoid infinite loop. */
|
||||
synchronized (requests) {
|
||||
requests.remove(request);
|
||||
}
|
||||
} catch (VizException e) {
|
||||
request.exception = e;
|
||||
} else {
|
||||
resource.issueRefresh();
|
||||
}
|
||||
if (cancelled) {
|
||||
break;
|
||||
}
|
||||
} catch (VizException e) {
|
||||
request.exception = e;
|
||||
resource.issueRefresh();
|
||||
} finally {
|
||||
request.isRunning = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the next request that should be sent
|
||||
* Get the next request that should be processed
|
||||
*
|
||||
* @return null if no request should be sent
|
||||
* @return null if no request should be processed
|
||||
*/
|
||||
protected GridDataRequest getNext() {
|
||||
synchronized (requests) {
|
||||
for (GridDataRequest request : requests) {
|
||||
if (request.shouldRequest()) {
|
||||
request.isRunning = true;
|
||||
return request;
|
||||
}
|
||||
}
|
||||
|
@ -172,21 +174,13 @@ class GridDataRequestRunner implements Runnable {
|
|||
if ((request.exception != null) && !request.exceptionHandled) {
|
||||
handleExceptions();
|
||||
}
|
||||
}
|
||||
if (request.shouldRequest()) {
|
||||
this.schedule();
|
||||
if (request.shouldRequest()) {
|
||||
GridDataRequestJobPool.schedule(this);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* send current requests
|
||||
*/
|
||||
private void schedule() {
|
||||
cancelled = false;
|
||||
executor.execute(this);
|
||||
}
|
||||
|
||||
private void handleExceptions() {
|
||||
|
||||
List<GridDataRequest> failedRequests = new ArrayList<GridDataRequest>(
|
||||
|
@ -267,14 +261,6 @@ class GridDataRequestRunner implements Runnable {
|
|||
synchronized (requests) {
|
||||
requests.clear();
|
||||
}
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
/**
|
||||
* cancel current request
|
||||
*/
|
||||
private void cancel() {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1150,6 +1150,7 @@ public class GageTableDlg extends JFrame implements IEditTimeChangedListener {
|
|||
} else {
|
||||
// Check for equality first
|
||||
response = o1.compareTo(o2);
|
||||
response *= -1;
|
||||
if (response != 0) {
|
||||
if (o1.toString().trim().equalsIgnoreCase("M")) {
|
||||
response = 1;
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
</contribute>
|
||||
</contribute>
|
||||
<contribute xsi:type="command"
|
||||
menuText="Collection/Dissemintation..." id="CollectionDissemintation"
|
||||
menuText="Collection/Dissemination..." id="CollectionDissemination"
|
||||
commandId="com.raytheon.uf.viz.app.launcher.appLauncherHandler">
|
||||
<parameter key="bundleLocation" value="bundles/run-ldadScheduler.xml"/>
|
||||
</contribute>
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuContributionFile>
|
||||
<include installTo="menu:UAplots?before=NCEPEnd"
|
||||
fileName="menus/upperair/baseUpperAirRedbook.xml" />
|
||||
<include installTo="menu:upperAir?before=baseUpperAirEnd"
|
||||
fileName="menus/upperair/uaMenus.xml" />
|
||||
</menuContributionFile>
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="200hPa" id="200hPa">
|
||||
<substitute key="wmo" value="PYMA20" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="250hPa" id="250hPa">
|
||||
<substitute key="wmo" value="PYMA25" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="300hPa" id="300hPa">
|
||||
<substitute key="wmo" value="PYMA30" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="500hPa" id="500hPa">
|
||||
<substitute key="wmo" value="PYMA50" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="700hPa" id="700hPa">
|
||||
<substitute key="wmo" value="PYMA70" />
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/RedbookUpperAir.xml"
|
||||
menuText="850hPa" id="850hPa">
|
||||
<substitute key="wmo" value="PYMA85" />
|
||||
</contribute>
|
||||
</menuTemplate>
|
|
@ -1,4 +1,23 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<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">
|
|
@ -21,8 +21,11 @@ package com.raytheon.viz.satellite.rsc;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.measure.Measure;
|
||||
|
||||
|
@ -50,10 +53,16 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
|||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.interrogation.Interrogatable;
|
||||
import com.raytheon.uf.viz.core.rsc.interrogation.InterrogateMap;
|
||||
import com.raytheon.uf.viz.core.rsc.interrogation.InterrogationKey;
|
||||
import com.raytheon.uf.viz.core.rsc.interrogation.Interrogator;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Displays multiple satellite resources in a single resource. Uses graphics
|
||||
* mosaicing to combine images so that alhpa blending correctly treats multiple
|
||||
* images as a single layer when applying the alpha.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
|
@ -67,6 +76,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* values and returns NaN now
|
||||
* Nov 18, 2013 2544 bsteffen Override recycleInternal
|
||||
* Nov 20, 2013 2492 bsteffen Update inspect to use Measure objects
|
||||
* Oct 27, 2014 3681 bsteffen Implement Interrogatable
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -76,7 +86,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
|
||||
public class SatBlendedResource extends
|
||||
AbstractVizResource<SatBlendedResourceData, MapDescriptor> implements
|
||||
IResourceGroup, IRefreshListener, IResourceDataChanged {
|
||||
IResourceGroup, IRefreshListener, IResourceDataChanged, Interrogatable {
|
||||
|
||||
private IMosaicImage mosaicImage = null;
|
||||
|
||||
|
@ -323,4 +333,40 @@ public class SatBlendedResource extends
|
|||
public void resourceChanged(ChangeType type, Object object) {
|
||||
refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<InterrogationKey<?>> getInterrogationKeys() {
|
||||
Set<InterrogationKey<?>> set = new HashSet<>();
|
||||
List<Interrogatable> resourceList = getResourceList()
|
||||
.getResourcesByTypeAsType(Interrogatable.class);
|
||||
for (Interrogatable resource : resourceList) {
|
||||
set.addAll(resource.getInterrogationKeys());
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InterrogateMap interrogate(ReferencedCoordinate coordinate,
|
||||
DataTime time, InterrogationKey<?>... keys) {
|
||||
if (!Arrays.asList(keys).contains(Interrogator.VALUE)) {
|
||||
keys = Arrays.copyOf(keys, keys.length + 1);
|
||||
keys[keys.length - 1] = Interrogator.VALUE;
|
||||
}
|
||||
List<Interrogatable> list = getResourceList().getResourcesByTypeAsType(
|
||||
Interrogatable.class);
|
||||
Collections.reverse(list);
|
||||
for (Interrogatable resource : list) {
|
||||
InterrogateMap result = resource
|
||||
.interrogate(
|
||||
coordinate, time, keys);
|
||||
Measure<? extends Number, ?> value = result.get(Interrogator.VALUE);
|
||||
if (value != null) {
|
||||
double quantity = value.getValue().doubleValue();
|
||||
if (!Double.isNaN(quantity)) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new InterrogateMap();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,7 @@ import org.eclipse.ui.menus.IMenuService;
|
|||
import com.raytheon.uf.common.activetable.SendPracticeProductRequest;
|
||||
import com.raytheon.uf.common.dataplugin.text.RemoteRetrievalResponse;
|
||||
import com.raytheon.uf.common.dataplugin.text.alarms.AlarmAlertProduct;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.MixedCaseProductSupport;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.OperationalStdTextProduct;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.PracticeStdTextProduct;
|
||||
import com.raytheon.uf.common.dataplugin.text.db.StdTextProduct;
|
||||
|
@ -341,6 +342,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
|
|||
* 13May2014 2536 bclement moved WMO Header to common, switched from TimeTools to TimeUtil
|
||||
* 11Sep2014 3580 mapeters Replaced SerializationTuil usage with JAXBManager,
|
||||
* removed IQueryTransport usage (no longer exists).
|
||||
* 20Oct2014 3685 randerso Made conversion to upper case conditional on product id
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -1096,10 +1098,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
* Search and replace dialog.
|
||||
*/
|
||||
private SearchReplaceDlg searchReplaceDlg;
|
||||
|
||||
/**
|
||||
* Flag indicating if the overwrite mode has been set for
|
||||
* template editing.
|
||||
|
||||
/**
|
||||
* Flag indicating if the overwrite mode has been set for template editing.
|
||||
*/
|
||||
private boolean isTemplateOverwriteModeSet = false;
|
||||
|
||||
|
@ -2065,7 +2066,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
overStrikeItem.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (!AFOSParser.isTemplate) {
|
||||
if (!AFOSParser.isTemplate) {
|
||||
if (overwriteMode == true) {
|
||||
overwriteMode = false;
|
||||
editorInsertCmb.select(INSERT_TEXT);
|
||||
|
@ -3714,14 +3715,14 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
editorInsertCmb.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
if (!AFOSParser.isTemplate) {
|
||||
if (editorInsertCmb.getSelectionIndex() == INSERT_TEXT
|
||||
&& overwriteMode == true) {
|
||||
if (!AFOSParser.isTemplate) {
|
||||
if ((editorInsertCmb.getSelectionIndex() == INSERT_TEXT)
|
||||
&& (overwriteMode == true)) {
|
||||
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
||||
overwriteMode = false;
|
||||
overStrikeItem.setSelection(false);
|
||||
} else if (editorInsertCmb.getSelectionIndex() == OVERWRITE_TEXT
|
||||
&& overwriteMode == false) {
|
||||
} else if ((editorInsertCmb.getSelectionIndex() == OVERWRITE_TEXT)
|
||||
&& (overwriteMode == false)) {
|
||||
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
||||
overwriteMode = true;
|
||||
overStrikeItem.setSelection(true);
|
||||
|
@ -3887,7 +3888,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
event.doit = false; // Ignore Ctrl+Shift+PageDown
|
||||
} else if (event.keyCode == SWT.INSERT) {
|
||||
// Ins key on the keypad
|
||||
if (AFOSParser.isTemplate) {
|
||||
if (AFOSParser.isTemplate) {
|
||||
if (overwriteMode == true) {
|
||||
overwriteMode = false;
|
||||
overStrikeItem.setSelection(false);
|
||||
|
@ -3917,43 +3918,43 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
if (event.keyCode == SWT.BS) {
|
||||
event.doit = false;
|
||||
int currentPos = textEditor.getCaretOffset();
|
||||
String textUpToCaret = textEditor.getText().substring(0, currentPos);
|
||||
int leftMost=textUpToCaret.lastIndexOf("[") + 1;
|
||||
int rightMost = textEditor.getText().indexOf("]",currentPos);
|
||||
String textUpToCaret = textEditor.getText().substring(
|
||||
0, currentPos);
|
||||
int leftMost = textUpToCaret.lastIndexOf("[") + 1;
|
||||
int rightMost = textEditor.getText().indexOf("]",
|
||||
currentPos);
|
||||
int editableTextWidth = rightMost - leftMost;
|
||||
String leftPart="";
|
||||
String rightPart="";
|
||||
String leftPart = "";
|
||||
String rightPart = "";
|
||||
if (currentPos == leftMost) {
|
||||
leftPart = "";
|
||||
rightPart = textEditor.getText().substring(
|
||||
currentPos, rightMost);
|
||||
textEditor.setCaretOffset(leftMost);
|
||||
}
|
||||
else if (currentPos > leftMost && currentPos <= rightMost){
|
||||
leftPart = textEditor.getText().substring(
|
||||
leftMost, currentPos - 1);
|
||||
leftPart = "";
|
||||
rightPart = textEditor.getText().substring(
|
||||
currentPos, rightMost);
|
||||
}
|
||||
else if (currentPos == rightMost) {
|
||||
leftPart = textEditor.getText().substring(
|
||||
leftMost, currentPos-1);
|
||||
textEditor.setCaretOffset(leftMost);
|
||||
} else if ((currentPos > leftMost)
|
||||
&& (currentPos <= rightMost)) {
|
||||
leftPart = textEditor.getText().substring(leftMost,
|
||||
currentPos - 1);
|
||||
rightPart = textEditor.getText().substring(
|
||||
currentPos, rightMost);
|
||||
} else if (currentPos == rightMost) {
|
||||
leftPart = textEditor.getText().substring(leftMost,
|
||||
currentPos - 1);
|
||||
rightPart = "";
|
||||
}
|
||||
String newString = leftPart + rightPart;
|
||||
int neededPadSpaces = editableTextWidth - newString.length();
|
||||
int neededPadSpaces = editableTextWidth
|
||||
- newString.length();
|
||||
String newPaddedString = String.format("%1$-"
|
||||
+ (neededPadSpaces+1) + "s", newString);
|
||||
+ (neededPadSpaces + 1) + "s", newString);
|
||||
String spacedoutString = String.format("%1$-"
|
||||
+ (editableTextWidth) + "s",
|
||||
" ");
|
||||
+ (editableTextWidth) + "s", " ");
|
||||
textEditor.replaceTextRange(leftMost,
|
||||
spacedoutString.length(), spacedoutString);
|
||||
textEditor.replaceTextRange(leftMost,
|
||||
newPaddedString.length(), newPaddedString);
|
||||
textEditor.setCaretOffset(currentPos - 1);
|
||||
|
||||
|
||||
} else if (event.keyCode == SWT.TAB) {
|
||||
if (!isTemplateOverwriteModeSet) {
|
||||
if (overwriteMode) {
|
||||
|
@ -3968,11 +3969,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
String textUpToCaret = textEditor.getText().substring(
|
||||
0, currentPos);
|
||||
int openBracketPos = textUpToCaret.lastIndexOf("[");
|
||||
openBracketPos = textEditor.getText().indexOf("[", currentPos);
|
||||
openBracketPos = textEditor.getText().indexOf("[",
|
||||
currentPos);
|
||||
textEditor.setCaretOffset(openBracketPos + 1);
|
||||
}
|
||||
else if (event.keyCode>=97 && event.keyCode <=122 ||
|
||||
event.keyCode>=48 && event.keyCode <=57){
|
||||
} else if (((event.keyCode >= 97) && (event.keyCode <= 122))
|
||||
|| ((event.keyCode >= 48) && (event.keyCode <= 57))) {
|
||||
event.doit = true;
|
||||
}
|
||||
}
|
||||
|
@ -4160,7 +4161,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
* Enter the text editor mode.
|
||||
*/
|
||||
private void enterEditor() {
|
||||
initTemplateOverwriteMode();
|
||||
initTemplateOverwriteMode();
|
||||
StdTextProduct product = TextDisplayModel.getInstance()
|
||||
.getStdTextProduct(token);
|
||||
if ((product != null)
|
||||
|
@ -4401,7 +4402,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
.getProductCategory(token)
|
||||
+ tdm.getProductDesignator(token);
|
||||
// Set the header text field.
|
||||
if (bbbid.equals("NOR") || (bbbid.isEmpty() && tdm.getAfosPil(token) != null)) {
|
||||
if (bbbid.equals("NOR")
|
||||
|| (bbbid.isEmpty() && (tdm.getAfosPil(token) != null))) {
|
||||
String wmoId = tdm.getWmoId(token);
|
||||
wmoId = (wmoId.length() > 0 ? wmoId : "-");
|
||||
String siteId = tdm.getSiteId(token);
|
||||
|
@ -4902,7 +4904,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
if (warnGenFlag) {
|
||||
QCConfirmationMsg qcMsg = new QCConfirmationMsg();
|
||||
if (!qcMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
|
||||
textEditor.getText().toUpperCase(), prod.getNnnid())) {
|
||||
MixedCaseProductSupport.conditionalToUpper(prod.getNnnid(),
|
||||
textEditor.getText()), prod.getNnnid())) {
|
||||
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
|
||||
qcMsg.getTitle(), qcMsg.getProductMessage(),
|
||||
qcMsg.getModeMessage());
|
||||
|
@ -4986,7 +4989,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
StdTextProduct prod = getStdTextProduct();
|
||||
EmergencyConfirmationMsg emergencyMsg = new EmergencyConfirmationMsg();
|
||||
if (emergencyMsg.checkWarningInfo(headerTF.getText().toUpperCase(),
|
||||
textEditor.getText().toUpperCase(), prod.getNnnid()) == false) {
|
||||
MixedCaseProductSupport.conditionalToUpper(prod.getNnnid(),
|
||||
textEditor.getText()), prod.getNnnid()) == false) {
|
||||
|
||||
WarnGenConfirmationDlg wgcd = new WarnGenConfirmationDlg(shell,
|
||||
emergencyMsg.getTitle(), emergencyMsg.getProductMessage(),
|
||||
|
@ -5016,8 +5020,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
*/
|
||||
private void warngenCloseCallback(boolean resend) {
|
||||
|
||||
// DR14553 (make upper case in product)
|
||||
String body = textEditor.getText().toUpperCase();
|
||||
StdTextProduct prod = getStdTextProduct();
|
||||
String body = MixedCaseProductSupport.conditionalToUpper(
|
||||
prod.getNnnid(), textEditor.getText());
|
||||
CAVEMode mode = CAVEMode.getMode();
|
||||
boolean isOperational = (CAVEMode.OPERATIONAL.equals(mode) || CAVEMode.TEST
|
||||
.equals(mode));
|
||||
|
@ -5031,7 +5036,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
inEditMode = false;
|
||||
}
|
||||
if (!resend) {
|
||||
StdTextProduct prod = getStdTextProduct();
|
||||
OUPTestRequest testReq = new OUPTestRequest();
|
||||
testReq.setOupRequest(createOUPRequest(prod,
|
||||
prod.getProduct()));
|
||||
|
@ -5075,8 +5079,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
|
||||
String product = TextDisplayModel.getInstance().getProduct(
|
||||
token);
|
||||
// TODO: Should not need to call getProduct and the like twice.
|
||||
StdTextProduct prod = getStdTextProduct();
|
||||
|
||||
OUPRequest req = createOUPRequest(prod, product);
|
||||
|
||||
|
@ -5093,8 +5095,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
} else {
|
||||
try {
|
||||
if (!resend) {
|
||||
body = VtecUtil.getVtec(removeSoftReturns(textEditor
|
||||
.getText()));
|
||||
body = VtecUtil
|
||||
.getVtec(removeSoftReturns(MixedCaseProductSupport
|
||||
.conditionalToUpper(prod.getNnnid(),
|
||||
textEditor.getText())));
|
||||
}
|
||||
updateTextEditor(body);
|
||||
if ((inEditMode || resend)
|
||||
|
@ -5168,7 +5172,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
private static String copyEtn(String from, String to) {
|
||||
VtecObject fromVtec = VtecUtil.parseMessage(from);
|
||||
|
||||
if (fromVtec != null && "NEW".equals(fromVtec.getAction())) {
|
||||
if ((fromVtec != null) && "NEW".equals(fromVtec.getAction())) {
|
||||
VtecObject toVtec = VtecUtil.parseMessage(to);
|
||||
if (toVtec != null) {
|
||||
toVtec.setSequence(fromVtec.getSequence());
|
||||
|
@ -5204,8 +5208,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
body.append("\n");
|
||||
}
|
||||
body.append(textEditor.getText().trim());
|
||||
|
||||
if (AFOSParser.isTemplate){
|
||||
|
||||
if (AFOSParser.isTemplate) {
|
||||
return removePreformat(body.toString());
|
||||
}
|
||||
|
||||
|
@ -5279,7 +5283,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
|
||||
String header = headerTF.getText().toUpperCase();
|
||||
String body = resend ? resendMessage()
|
||||
: removeSoftReturns(textEditor.getText().toUpperCase());
|
||||
: removeSoftReturns(MixedCaseProductSupport
|
||||
.conditionalToUpper(product.getNnnid(),
|
||||
textEditor.getText()));
|
||||
// verify text
|
||||
headerTF.setText(header);
|
||||
updateTextEditor(body);
|
||||
|
@ -5302,10 +5308,11 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
if (!isAutoSave) {
|
||||
if (!resend) {
|
||||
// If not a resend, set the DDHHMM field to the current time
|
||||
if (productText.startsWith("- -") && productText.contains("DDHHMM")) {
|
||||
if (productText.startsWith("- -")
|
||||
&& productText.contains("DDHHMM")) {
|
||||
productText = getUnofficeProduct(currentDate);
|
||||
} else {
|
||||
productText = replaceDDHHMM(productText, currentDate);
|
||||
productText = replaceDDHHMM(productText, currentDate);
|
||||
}
|
||||
VtecObject vtecObj = VtecUtil.parseMessage(productText);
|
||||
if (warnGenFlag) {
|
||||
|
@ -5341,7 +5348,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
productText += ATTACHMENT_STR
|
||||
+ statusBarLabel.getText().substring(startIndex);
|
||||
}
|
||||
|
||||
|
||||
if (AFOSParser.isTemplate) {
|
||||
productText = removePreformat(productText);
|
||||
}
|
||||
|
@ -5909,14 +5916,15 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
if (m.find()) {
|
||||
SimpleDateFormat headerFormat = new SimpleDateFormat(
|
||||
"hmm a z EEE MMM d yyyy");
|
||||
TimeZone tz = TextWarningConstants.timeZoneShortNameMap
|
||||
.get(m.group(5));
|
||||
TimeZone tz = TextWarningConstants.timeZoneShortNameMap.get(m
|
||||
.group(5));
|
||||
if (tz != null) {
|
||||
headerFormat.setTimeZone(tz);
|
||||
product = product.replace(m.group(1), headerFormat.format(now)
|
||||
.toUpperCase());
|
||||
} else {
|
||||
statusHandler.warn("Could not sync MND header time because the time zone could not be determined. Will proceed with save/send.");
|
||||
statusHandler
|
||||
.warn("Could not sync MND header time because the time zone could not be determined. Will proceed with save/send.");
|
||||
}
|
||||
}
|
||||
return product;
|
||||
|
@ -6944,9 +6952,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
}
|
||||
String textProduct = product.getASCIIProduct();
|
||||
if ((product.getNnnid() + product.getXxxid())
|
||||
.startsWith(AFOSParser.DRAFT_PIL) ||
|
||||
(product.getNnnid() + product.getXxxid())
|
||||
.startsWith(AFOSParser.MCP_NNN )) {
|
||||
.startsWith(AFOSParser.DRAFT_PIL)
|
||||
|| (product.getNnnid() + product.getXxxid())
|
||||
.startsWith(AFOSParser.MCP_NNN)) {
|
||||
String[] nnnxxx = TextDisplayModel.getNnnXxx(textProduct);
|
||||
String operationalPil = nnnxxx[0] + nnnxxx[1];
|
||||
String siteNode = SiteAbbreviationUtil.getSiteNode(nnnxxx[1]);
|
||||
|
@ -8576,7 +8584,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
return bbb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initTemplateOverwriteMode() {
|
||||
if (AFOSParser.isTemplate) {
|
||||
editorInsertCmb.setEnabled(false);
|
||||
|
@ -8594,8 +8602,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
isTemplateOverwriteModeSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
editorInsertCmb.setEnabled(true);
|
||||
overStrikeItem.setEnabled(true);
|
||||
editorCutBtn.setEnabled(true);
|
||||
|
@ -8603,26 +8610,26 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
editorPasteBtn.setEnabled(true);
|
||||
editorFillBtn.setEnabled(true);
|
||||
editorAttachBtn.setEnabled(true);
|
||||
if (isTemplateOverwriteModeSet && !overwriteMode){
|
||||
if (isTemplateOverwriteModeSet && !overwriteMode) {
|
||||
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
||||
isTemplateOverwriteModeSet=false;
|
||||
isTemplateOverwriteModeSet = false;
|
||||
}
|
||||
if (!isTemplateOverwriteModeSet && overwriteMode){
|
||||
if (!isTemplateOverwriteModeSet && overwriteMode) {
|
||||
textEditor.invokeAction(ST.TOGGLE_OVERWRITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private String removePreformat(String preformattedText) {
|
||||
String modifiedText = preformattedText.replaceAll("\\[|\\]", " ");
|
||||
modifiedText = removeSoftReturns(modifiedText);
|
||||
return modifiedText;
|
||||
}
|
||||
|
||||
private String getUnofficeProduct(String currDate)
|
||||
{
|
||||
StdTextProduct textProd = TextDisplayModel.getInstance().getStdTextProduct(token);
|
||||
|
||||
|
||||
private String getUnofficeProduct(String currDate) {
|
||||
StdTextProduct textProd = TextDisplayModel.getInstance()
|
||||
.getStdTextProduct(token);
|
||||
|
||||
String header = headerTF.getText();
|
||||
|
||||
String nnn = textProd.getNnnid();
|
||||
|
@ -8630,21 +8637,23 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
String nnnXxx = nnn + xxx;
|
||||
String site = SiteMap.getInstance().getSite4LetterId(
|
||||
textProd.getCccid());
|
||||
String wmoId = textProd.getCccid() + nnnXxx + " "
|
||||
+ getAddressee() + "\nTTAA00 " + site;
|
||||
|
||||
String wmoId = textProd.getCccid() + nnnXxx + " " + getAddressee()
|
||||
+ "\nTTAA00 " + site;
|
||||
|
||||
header = header.replaceFirst("\n" + nnnXxx, "");
|
||||
header = header.replaceFirst("-", "ZCZC");
|
||||
header = header.replaceFirst("-", wmoId);
|
||||
|
||||
if (currDate != null)
|
||||
if (currDate != null) {
|
||||
header = header.replaceFirst("DDHHMM", currDate);
|
||||
else
|
||||
} else {
|
||||
header = header.replaceFirst("DDHHMM", textProd.getHdrtime());
|
||||
|
||||
String body = textEditor.getText().toUpperCase();
|
||||
}
|
||||
|
||||
header = header + "\n\n"+body +"\n!--not sent--!";
|
||||
String body = MixedCaseProductSupport.conditionalToUpper(nnn,
|
||||
textEditor.getText());
|
||||
|
||||
header = header + "\n\n" + body + "\n!--not sent--!";
|
||||
|
||||
return header;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,13 @@
|
|||
value="textws/gui"
|
||||
recursive="true">
|
||||
</path>
|
||||
<path
|
||||
application="TextWS"
|
||||
localizationType="COMMON_STATIC"
|
||||
name="Mixed Case"
|
||||
value="mixedCase"
|
||||
recursive="false">
|
||||
</path>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
|
@ -122,10 +122,10 @@ public abstract class AbstractAWIPSComponent extends CAVEApplication {
|
|||
* getWorkbenchAdvisor()
|
||||
*/
|
||||
@Override
|
||||
protected WorkbenchAdvisor getWorkbenchAdvisor() {
|
||||
protected final WorkbenchAdvisor getWorkbenchAdvisor() {
|
||||
WorkbenchAdvisor workbenchAdvisor = null;
|
||||
if ((getRuntimeModes() & WORKBENCH) != 0) {
|
||||
workbenchAdvisor = new AWIPSWorkbenchAdvisor();
|
||||
workbenchAdvisor = createAWIPSWorkbenchAdvisor();
|
||||
} else if (!isNonUIComponent()) {
|
||||
workbenchAdvisor = new HiddenWorkbenchAdvisor(getComponentName(),
|
||||
this);
|
||||
|
@ -141,6 +141,14 @@ public abstract class AbstractAWIPSComponent extends CAVEApplication {
|
|||
return workbenchAdvisor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A new instance of {@link AWIPSWorkbenchAdvisor} to use for the
|
||||
* component's {@link WorkbenchAdvisor}
|
||||
*/
|
||||
protected AWIPSWorkbenchAdvisor createAWIPSWorkbenchAdvisor() {
|
||||
return new AWIPSWorkbenchAdvisor();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
|
11
deltaScripts/14.3.1/DR2757/deleteFSSObsConfigFiles.sh
Normal file
11
deltaScripts/14.3.1/DR2757/deleteFSSObsConfigFiles.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "INFO: delete FSSObs config files - removing safeseas, snow and fog area configuration files."
|
||||
echo "Replace site AKQ with current one."
|
||||
|
||||
cd /awips2/edex/data/utility/common_static/site/AKQ
|
||||
rm -rf fog safeseas snow
|
||||
|
||||
echo "INFO: the update has completed successfully!"
|
||||
|
||||
exit 0
|
|
@ -71,7 +71,7 @@ CASE ${BACKUP_NAME}
|
|||
WHEN 42 then 'DEBRIS FLOW'
|
||||
WHEN 43 then 'BLOWING SNOW'
|
||||
WHEN 44 then 'RAIN'
|
||||
ELSE ${BACKUP_NAME}
|
||||
ELSE ''
|
||||
END;
|
||||
UPDATE ${TABLE_NAME} set ${STATION_COLUMN} = concat(${LON_COLUMN}, ':', ${LAT_COLUMN});
|
||||
ALTER TABLE ${TABLE_NAME} DROP COLUMN ${BACKUP_NAME};
|
||||
|
|
28
deltaScripts/14.4.1/DR3454/createEventsSequences.sh
Executable file
28
deltaScripts/14.4.1/DR3454/createEventsSequences.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This script creates sequences for the tables in the events schema
|
||||
|
||||
STATS_MAX_VAL=$(psql -U awips -d metadata -t -c "select max(id)+1 from events.stats;")
|
||||
NOTIFICATION_MAX_VAL=$(psql -U awips -d metadata -t -c "select max(id)+1 from events.notification;")
|
||||
AGGREGATE_MAX_VAL=$(psql -U awips -d metadata -t -c "select max(id)+1 from events.aggregate;")
|
||||
|
||||
if [ -z $STATS_MAX_VAL ]
|
||||
then
|
||||
STATS_MAX_VAL=1
|
||||
fi
|
||||
|
||||
if [ -z $NOTIFICATION_MAX_VAL ]
|
||||
then
|
||||
NOTIFICATION_MAX_VAL=1
|
||||
fi
|
||||
|
||||
if [ -z $AGGREGATE_MAX_VAL ]
|
||||
then
|
||||
AGGREGATE_MAX_VAL=1
|
||||
fi
|
||||
|
||||
psql -U awips -d metadata -c \
|
||||
"CREATE SEQUENCE stats_seq START WITH $STATS_MAX_VAL; \
|
||||
CREATE SEQUENCE notification_seq START WITH $NOTIFICATION_MAX_VAL; \
|
||||
CREATE SEQUENCE aggregate_seq START WITH $AGGREGATE_MAX_VAL;"
|
||||
|
|
@ -73,6 +73,8 @@
|
|||
<!-- Cache Properties -->
|
||||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="hibernate.cache.use_query_cache">false</property>
|
||||
<property name="hibernate.query.plan_cache_max_strong_references">8</property>
|
||||
<property name="hibernate.query.plan_cache_max_soft_references">16</property>
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
|
@ -73,6 +73,8 @@
|
|||
<!-- Cache Properties -->
|
||||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="hibernate.cache.use_query_cache">false</property>
|
||||
<property name="hibernate.query.plan_cache_max_strong_references">8</property>
|
||||
<property name="hibernate.query.plan_cache_max_soft_references">16</property>
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
|
@ -73,6 +73,8 @@
|
|||
<!-- Cache Properties -->
|
||||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="hibernate.cache.use_query_cache">false</property>
|
||||
<property name="hibernate.query.plan_cache_max_strong_references">8</property>
|
||||
<property name="hibernate.query.plan_cache_max_soft_references">16</property>
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
|
@ -73,6 +73,8 @@
|
|||
<!-- Cache Properties -->
|
||||
<property name="hibernate.cache.use_query_cache">false</property>
|
||||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="hibernate.query.plan_cache_max_strong_references">8</property>
|
||||
<property name="hibernate.query.plan_cache_max_soft_references">16</property>
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
|
@ -73,6 +73,8 @@
|
|||
<!-- Cache Properties -->
|
||||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="hibernate.cache.use_query_cache">false</property>
|
||||
<property name="hibernate.query.plan_cache_max_strong_references">8</property>
|
||||
<property name="hibernate.query.plan_cache_max_soft_references">16</property>
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
|
@ -76,6 +76,8 @@
|
|||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="hibernate.jdbc.use_streams_for_binary">false</property>
|
||||
<property name="hibernate.cache.use_query_cache">false</property>
|
||||
<property name="hibernate.query.plan_cache_max_strong_references">16</property>
|
||||
<property name="hibernate.query.plan_cache_max_soft_references">32</property>
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
|
|
|
@ -70,6 +70,8 @@
|
|||
<!-- Cache Properties -->
|
||||
<property name="hibernate.cache.use_second_level_cache">false</property>
|
||||
<property name="hibernate.cache.use_query_cache">false</property>
|
||||
<property name="hibernate.query.plan_cache_max_strong_references">8</property>
|
||||
<property name="hibernate.query.plan_cache_max_soft_references">16</property>
|
||||
|
||||
</session-factory>
|
||||
</hibernate-configuration>
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 03/25/2014 #2664 randerso Added support for importing non-WGS84 shape files
|
||||
# 10/23/2014 #3685 randerso Fixed bug where .prj was not recognized when shape file
|
||||
# was in the current directory (no directory specified)
|
||||
#
|
||||
##
|
||||
|
||||
|
@ -46,7 +48,7 @@ if [ $# -lt 3 ] ; then
|
|||
exit -1
|
||||
fi
|
||||
|
||||
SHP_PATH=${1}
|
||||
SHP_PATH=`readlink -f ${1}`
|
||||
SHP_DIR="${SHP_PATH%/*}" # shape file dir
|
||||
SHP_NAME="${SHP_PATH##*/}" # shape file name with extension
|
||||
SHP_BASE="${SHP_NAME%.*}" # shape file name without extension
|
||||
|
|
|
@ -106,6 +106,7 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
|
|||
* Sep 30, 2013 #2361 njensen Use JAXBManager for XML
|
||||
* Jan 21, 2014 #2720 randerso Improve efficiency of merging polygons in edit area generation
|
||||
* Aug 27, 2014 #3563 randerso Fix issue where edit areas are regenerated unnecessarily
|
||||
* Oct 20, 2014 #3685 randerso Changed structure of editAreaAttrs to keep zones from different maps separated
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -131,7 +132,7 @@ public class MapManager {
|
|||
|
||||
private final Map<String, List<String>> editAreaMap = new HashMap<String, List<String>>();
|
||||
|
||||
private final Map<String, Map<String, Object>> editAreaAttrs = new HashMap<String, Map<String, Object>>();
|
||||
private final Map<String, List<Map<String, Object>>> editAreaAttrs = new HashMap<String, List<Map<String, Object>>>();
|
||||
|
||||
private final List<String> iscMarkersID = new ArrayList<String>();
|
||||
|
||||
|
@ -811,6 +812,8 @@ public class MapManager {
|
|||
private List<ReferenceData> createReferenceData(DbShapeSource mapDef) {
|
||||
// ServerResponse sr;
|
||||
List<ReferenceData> data = new ArrayList<ReferenceData>();
|
||||
List<Map<String, Object>> attributes = new ArrayList<Map<String, Object>>();
|
||||
editAreaAttrs.put(mapDef.getDisplayName(), attributes);
|
||||
|
||||
// Module dean("DefaultEditAreaNaming");
|
||||
ArrayList<String> created = new ArrayList<String>();
|
||||
|
@ -871,7 +874,8 @@ public class MapManager {
|
|||
// handle new case
|
||||
else {
|
||||
created.add(ean);
|
||||
editAreaAttrs.put(ean, info);
|
||||
info.put("editarea", ean);
|
||||
attributes.add(info);
|
||||
}
|
||||
|
||||
tempData.put(ean, mp);
|
||||
|
|
|
@ -20,27 +20,36 @@
|
|||
package com.raytheon.edex.plugin.gfe.textproducts;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import jep.JepException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.plugin.gfe.reference.MapManager;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||
import com.raytheon.uf.common.dataquery.db.QueryResult;
|
||||
import com.raytheon.uf.common.dataquery.db.QueryResultRow;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.localization.exception.LocalizationException;
|
||||
import com.raytheon.uf.common.python.PyUtil;
|
||||
import com.raytheon.uf.common.python.PythonScript;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.edex.database.tasks.SqlQueryTask;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Code to generate the AreaDictionary for text formatters
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -49,6 +58,8 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 4, 2011 wldougher Moved from MapManager
|
||||
* Oct 10, 2014 #3685 randerso Add code to generate the fips2cities and zones2cites
|
||||
* python modules from the GIS database tables
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -57,11 +68,61 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
*/
|
||||
|
||||
public class AreaDictionaryMaker {
|
||||
private static final Log theLogger = LogFactory
|
||||
.getLog(AreaDictionaryMaker.class);
|
||||
protected static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(AreaDictionaryMaker.class);
|
||||
|
||||
protected static final String FIPS_CITY_QUERY = //
|
||||
"SELECT name, population, ST_Y(city.the_geom), ST_X(city.the_geom) "
|
||||
+ "FROM mapdata.city, mapdata.county "
|
||||
+ "WHERE county.state = '%1$s' AND substring(fips,3,3) = '%2$s' "
|
||||
+ "AND ST_Contains(county.the_geom, city.the_geom) "
|
||||
+ "ORDER BY city.name;";
|
||||
|
||||
protected static final String ZONES_CITY_QUERY = //
|
||||
"SELECT city.name, population, ST_Y(city.the_geom), ST_X(city.the_geom) "
|
||||
+ "FROM mapdata.city, mapdata.zone "
|
||||
+ "WHERE zone.state = '%1$s' AND zone.zone = '%2$s' "
|
||||
+ "AND ST_Contains(zone.the_geom, city.the_geom) "
|
||||
+ "ORDER BY city.name;";
|
||||
|
||||
protected static final Map<String, String> PART_OF_STATE;
|
||||
static {
|
||||
PART_OF_STATE = new HashMap<>(30, 1.0f);
|
||||
PART_OF_STATE.put(null, "");
|
||||
PART_OF_STATE.put("bb", "big bend");
|
||||
PART_OF_STATE.put("c", "");
|
||||
PART_OF_STATE.put("cc", "central");
|
||||
PART_OF_STATE.put("E", "");
|
||||
PART_OF_STATE.put("ea", "east");
|
||||
PART_OF_STATE.put("ec", "east central");
|
||||
PART_OF_STATE.put("ee", "eastern");
|
||||
PART_OF_STATE.put("er", "east central upper");
|
||||
PART_OF_STATE.put("eu", "eastern upper");
|
||||
PART_OF_STATE.put("M", "");
|
||||
PART_OF_STATE.put("mi", "middle");
|
||||
PART_OF_STATE.put("nc", "north central");
|
||||
PART_OF_STATE.put("ne", "northeast");
|
||||
PART_OF_STATE.put("nn", "northern");
|
||||
PART_OF_STATE.put("nr", "north central upper");
|
||||
PART_OF_STATE.put("nw", "northwest");
|
||||
PART_OF_STATE.put("pa", "panhandle");
|
||||
PART_OF_STATE.put("pd", "piedmont");
|
||||
PART_OF_STATE.put("sc", "south central");
|
||||
PART_OF_STATE.put("se", "southeast");
|
||||
PART_OF_STATE.put("so", "south");
|
||||
PART_OF_STATE.put("sr", "south central upper");
|
||||
PART_OF_STATE.put("ss", "southern");
|
||||
PART_OF_STATE.put("sw", "southwest");
|
||||
PART_OF_STATE.put("up", "upstate");
|
||||
PART_OF_STATE.put("wc", "west central");
|
||||
PART_OF_STATE.put("wu", "western upper");
|
||||
PART_OF_STATE.put("ww", "western");
|
||||
}
|
||||
|
||||
protected IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
|
||||
private Map<String, String> stateDict;
|
||||
|
||||
/**
|
||||
* Generate the AreaDictionary.py and CityLocation.py scripts for site,
|
||||
* using editAreaAttrs.
|
||||
|
@ -73,14 +134,14 @@ public class AreaDictionaryMaker {
|
|||
* A Map from edit area names to shape file attributes
|
||||
*/
|
||||
public void genAreaDictionary(String site,
|
||||
Map<String, Map<String, Object>> editAreaAttrs) {
|
||||
theLogger.info("Area Dictionary generation phase");
|
||||
Map<String, List<Map<String, Object>>> editAreaAttrs) {
|
||||
statusHandler.info("Area Dictionary generation phase");
|
||||
|
||||
if (site == null) {
|
||||
throw new IllegalArgumentException("site is null");
|
||||
}
|
||||
|
||||
if ("".equals(site)) {
|
||||
if (site.isEmpty()) {
|
||||
throw new IllegalArgumentException("site is an empty string");
|
||||
}
|
||||
|
||||
|
@ -89,14 +150,99 @@ public class AreaDictionaryMaker {
|
|||
}
|
||||
|
||||
long t0 = System.currentTimeMillis();
|
||||
genStateDict();
|
||||
|
||||
LocalizationContext cx = pathMgr.getContext(
|
||||
LocalizationContext context = pathMgr.getContext(
|
||||
LocalizationContext.LocalizationType.EDEX_STATIC,
|
||||
LocalizationContext.LocalizationLevel.CONFIGURED);
|
||||
context.setContextName(site);
|
||||
|
||||
List<Map<String, Object>> countyAttrs = editAreaAttrs.get("Counties");
|
||||
List<Map<String, Object>> zoneAttrs = editAreaAttrs.get("Zones");
|
||||
|
||||
// To generate national fips2cities and zones2cities files
|
||||
// uncomment the following lines. This should be done for testing
|
||||
// purposes only and should not be checked in uncommented.
|
||||
|
||||
// context = pathMgr.getContext(
|
||||
// LocalizationContext.LocalizationType.EDEX_STATIC,
|
||||
// LocalizationContext.LocalizationLevel.BASE);
|
||||
//
|
||||
// String fipsQuery =
|
||||
// "SELECT fips, state, fe_area, cwa FROM mapdata.county ORDER BY state, fips;";
|
||||
//
|
||||
// SqlQueryTask task = new SqlQueryTask(fipsQuery, "maps");
|
||||
// try {
|
||||
// QueryResult results = task.execute();
|
||||
// countyAttrs = new ArrayList<Map<String, Object>>(
|
||||
// results.getResultCount());
|
||||
// for (QueryResultRow row : results.getRows()) {
|
||||
// String num = (String) row.getColumn(0);
|
||||
// if (num == null) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// Map<String, Object> map = new HashMap<>(3, 1.0f);
|
||||
// countyAttrs.add(map);
|
||||
//
|
||||
// String st = (String) row.getColumn(1);
|
||||
// int len = num.length();
|
||||
//
|
||||
// map.put("editarea", st + 'C' + num.substring(len - 3, len));
|
||||
// map.put("fe_area", row.getColumn(2));
|
||||
// map.put("cwa", row.getColumn(3));
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// statusHandler.error(e.getLocalizedMessage(), e);
|
||||
// }
|
||||
//
|
||||
// String zonesQuery =
|
||||
// "SELECT zone, state, fe_area, cwa FROM mapdata.zone ORDER BY state, zone;";
|
||||
// task = new SqlQueryTask(zonesQuery, "maps");
|
||||
// try {
|
||||
// QueryResult results = task.execute();
|
||||
// zoneAttrs = new ArrayList<Map<String, Object>>(
|
||||
// results.getResultCount());
|
||||
// for (QueryResultRow row : results.getRows()) {
|
||||
// String num = (String) row.getColumn(0);
|
||||
// if (num == null) {
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// Map<String, Object> map = new HashMap<>(3, 1.0f);
|
||||
// zoneAttrs.add(map);
|
||||
//
|
||||
// String st = (String) row.getColumn(1);
|
||||
// int len = num.length();
|
||||
//
|
||||
// map.put("editarea", st + 'Z' + num.substring(len - 3, len));
|
||||
// map.put("fe_area", row.getColumn(2));
|
||||
// map.put("cwa", row.getColumn(3));
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// statusHandler.error(e.getLocalizedMessage(), e);
|
||||
// }
|
||||
|
||||
// To generate national fips2cities and zones2cities files
|
||||
// uncomment the previous lines
|
||||
|
||||
genFips2Cities(context, countyAttrs);
|
||||
genZones2Cities(context, zoneAttrs);
|
||||
|
||||
LocalizationContext baseCtx = pathMgr.getContext(
|
||||
LocalizationType.EDEX_STATIC, LocalizationLevel.BASE);
|
||||
File scriptFile = pathMgr.getLocalizationFile(cx,
|
||||
File scriptFile = pathMgr.getLocalizationFile(baseCtx,
|
||||
FileUtil.join("gfe", "createAreaDictionary.py")).getFile();
|
||||
|
||||
LocalizationContext configCtx = pathMgr.getContext(
|
||||
LocalizationType.EDEX_STATIC, LocalizationLevel.CONFIGURED);
|
||||
configCtx.setContextName(site);
|
||||
File configDir = pathMgr.getLocalizationFile(configCtx, "gfe")
|
||||
.getFile();
|
||||
|
||||
String includePath = PyUtil.buildJepIncludePath(true,
|
||||
GfePyIncludeUtil.getCommonPythonIncludePath(),
|
||||
scriptFile.getParent());
|
||||
configDir.getPath(), scriptFile.getParent());
|
||||
Map<String, Object> argMap = new HashMap<String, Object>();
|
||||
|
||||
LocalizationContext caveStaticConfig = pathMgr.getContext(
|
||||
|
@ -120,7 +266,7 @@ public class AreaDictionaryMaker {
|
|||
// createAreaDictionary()
|
||||
pyScript.execute("createCityLocation", argMap);
|
||||
} catch (JepException e) {
|
||||
theLogger.error("Error generating area dictionary", e);
|
||||
statusHandler.error("Error generating area dictionary", e);
|
||||
} finally {
|
||||
if (pyScript != null) {
|
||||
pyScript.dispose();
|
||||
|
@ -128,6 +274,138 @@ public class AreaDictionaryMaker {
|
|||
}
|
||||
|
||||
long t1 = System.currentTimeMillis();
|
||||
theLogger.info("Area Dictionary generation time: " + (t1 - t0) + " ms");
|
||||
statusHandler.info("Area Dictionary generation time: " + (t1 - t0)
|
||||
+ " ms");
|
||||
}
|
||||
|
||||
private void genFips2Cities(LocalizationContext context,
|
||||
List<Map<String, Object>> attributes) {
|
||||
genArea2Cities(context, attributes, "fips2cities.py", "fipsdata",
|
||||
"FIPS", 'C', FIPS_CITY_QUERY);
|
||||
}
|
||||
|
||||
private void genZones2Cities(LocalizationContext context,
|
||||
List<Map<String, Object>> attributes) {
|
||||
genArea2Cities(context, attributes, "zones2cities.py", "zonedata",
|
||||
"Zones", 'Z', ZONES_CITY_QUERY);
|
||||
}
|
||||
|
||||
private void genArea2Cities(LocalizationContext context,
|
||||
List<Map<String, Object>> attributes, String fileName,
|
||||
String dictName, String group, char separator, String cityQuery) {
|
||||
|
||||
LocalizationFile lf = pathMgr.getLocalizationFile(context,
|
||||
FileUtil.join("gfe", fileName));
|
||||
|
||||
try (PrintWriter out = new PrintWriter(lf.openOutputStream())) {
|
||||
out.println(dictName + " = {");
|
||||
|
||||
try {
|
||||
DecimalFormat df = new DecimalFormat("0.00000");
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Pattern pattern = Pattern.compile("(\\p{Upper}{2})" + separator
|
||||
+ "(\\d{3})");
|
||||
|
||||
for (Map<String, Object> att : attributes) {
|
||||
String ean = (String) att.get("editarea");
|
||||
if ((ean == null) || ean.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Matcher matcher = pattern.matcher(ean);
|
||||
if (!matcher.matches()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String state = matcher.group(1);
|
||||
String num = matcher.group(2);
|
||||
|
||||
String fullStateName = this.stateDict.get(state);
|
||||
String partOfState = PART_OF_STATE.get(att.get("fe_area"));
|
||||
String wfo = (String) att.get("cwa");
|
||||
|
||||
SqlQueryTask task = new SqlQueryTask(String.format(
|
||||
cityQuery, state, num), "maps");
|
||||
|
||||
// retrieve cities for this area
|
||||
QueryResult citiesResult = null;
|
||||
try {
|
||||
citiesResult = task.execute();
|
||||
} catch (Exception e) {
|
||||
statusHandler
|
||||
.error("Error getting cites for " + ean, e);
|
||||
}
|
||||
|
||||
sb.setLength(0);
|
||||
sb.append("'").append(ean).append("': {");
|
||||
sb.append("'fullStateName': '").append(fullStateName)
|
||||
.append("', ");
|
||||
sb.append("'state': '").append(state).append("', ");
|
||||
|
||||
sb.append("'cities': [");
|
||||
if ((citiesResult != null)
|
||||
&& (citiesResult.getResultCount() > 0)) {
|
||||
for (QueryResultRow city : citiesResult.getRows()) {
|
||||
String name = (String) city.getColumn(0);
|
||||
Object population = city.getColumn(1);
|
||||
Double lat = (Double) city.getColumn(2);
|
||||
Double lon = (Double) city.getColumn(3);
|
||||
|
||||
if (name.indexOf("'") >= 0) {
|
||||
sb.append("(\"").append(name).append("\", ");
|
||||
} else {
|
||||
sb.append("('").append(name).append("', ");
|
||||
}
|
||||
if (population == null) {
|
||||
sb.append("None, ");
|
||||
} else {
|
||||
sb.append(population.toString()).append(", ");
|
||||
}
|
||||
sb.append("'").append(df.format(lat)).append("', ");
|
||||
sb.append("'").append(df.format(lon))
|
||||
.append("'), ");
|
||||
}
|
||||
sb.setLength(sb.length() - 2);
|
||||
}
|
||||
sb.append("], ");
|
||||
|
||||
sb.append("'partOfState': '").append(partOfState)
|
||||
.append("', ");
|
||||
sb.append("'wfo': '").append(wfo).append("'}, ");
|
||||
out.println(sb.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
out.println("}");
|
||||
} catch (LocalizationException e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
try {
|
||||
lf.save();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void genStateDict() {
|
||||
SqlQueryTask task = new SqlQueryTask(
|
||||
"SELECT state, name FROM mapdata.states", "maps");
|
||||
try {
|
||||
QueryResult result = task.execute();
|
||||
stateDict = new HashMap<String, String>(result.getResultCount(),
|
||||
1.0f);
|
||||
for (QueryResultRow row : result.getRows()) {
|
||||
String st = (String) row.getColumn(0);
|
||||
String name = (String) row.getColumn(1);
|
||||
stateDict.put(st, name);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ package com.raytheon.edex.plugin.gfe.textproducts;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -32,10 +32,14 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.utility.ProtectedFiles;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.python.GfePyIncludeUtil;
|
||||
import com.raytheon.uf.common.dataquery.db.QueryResult;
|
||||
import com.raytheon.uf.common.dataquery.db.QueryResultRow;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.python.PyUtil;
|
||||
import com.raytheon.uf.common.python.PythonScript;
|
||||
|
@ -45,6 +49,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
||||
import com.raytheon.uf.edex.database.tasks.SqlQueryTask;
|
||||
|
||||
/**
|
||||
* Generate and configure text products when needed.
|
||||
|
@ -59,11 +64,13 @@ import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 7, 2008 1222 jelkins Initial creation
|
||||
* Jul 24,2012 #944 dgilling Fix text product template generation
|
||||
* Jul 7, 2008 1222 jelkins Initial creation
|
||||
* Jul 24, 2012 #944 dgilling Fix text product template generation
|
||||
* to create textProducts and textUtilities.
|
||||
* Sep 07,2012 #1150 dgilling Fix isConfigured to check for textProducts
|
||||
* Sep 07, 2012 #1150 dgilling Fix isConfigured to check for textProducts
|
||||
* and textUtilities dirs.
|
||||
* Oct 20, 2014 #3685 randerso Added code to generate SiteCFG.py from GIS database
|
||||
* Cleaned up how protected file updates are returned
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -75,6 +82,8 @@ public class Configurator {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(Configurator.class);
|
||||
|
||||
private static final String CWA_QUERY = "select wfo, region, fullstaid, citystate, city, state from mapdata.cwa order by wfo;";
|
||||
|
||||
private static final String CONFIG_TEXT_PRODUCTS_TASK = "GfeConfigureTextProducts";
|
||||
|
||||
private String siteID;
|
||||
|
@ -183,26 +192,79 @@ public class Configurator {
|
|||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void execute() {
|
||||
PythonScript python = null;
|
||||
List<String> preEvals = new ArrayList<String>();
|
||||
|
||||
if (isConfigured()) {
|
||||
statusHandler.info("All text products are up to date");
|
||||
return;
|
||||
}
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
LocalizationContext context = pathMgr.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.CONFIGURED);
|
||||
context.setContextName(siteID);
|
||||
|
||||
// regenerate siteCFG.py
|
||||
LocalizationFile lf = null;
|
||||
try {
|
||||
lf = pathMgr.getLocalizationFile(context,
|
||||
FileUtil.join("python", "gfe", "SiteCFG.py"));
|
||||
|
||||
SqlQueryTask task = new SqlQueryTask(CWA_QUERY, "maps");
|
||||
QueryResult results = task.execute();
|
||||
try (PrintWriter out = new PrintWriter(lf.openOutputStream())) {
|
||||
out.println("##");
|
||||
out.println("# Contains information about products, regions, etc. for each site");
|
||||
out.println("# in the country.");
|
||||
out.println("# region= two-letter regional identifier, mainly used for installation of");
|
||||
out.println("# text product templates");
|
||||
out.println("SiteInfo= {");
|
||||
for (QueryResultRow row : results.getRows()) {
|
||||
String wfo = (String) row.getColumn(0);
|
||||
String region = (String) row.getColumn(1);
|
||||
String fullStationID = (String) row.getColumn(2);
|
||||
String wfoCityState = (String) row.getColumn(3);
|
||||
String wfoCity = (String) row.getColumn(4);
|
||||
String state = (String) row.getColumn(5);
|
||||
|
||||
out.println(formatEntry(wfo, region, fullStationID,
|
||||
wfoCityState, wfoCity, state));
|
||||
|
||||
// Add in AFC's dual domain sites
|
||||
if (wfo.equals("AFC")) {
|
||||
out.println(formatEntry("AER", region, fullStationID,
|
||||
wfoCityState, wfoCity, state));
|
||||
out.println(formatEntry("ALU", region, fullStationID,
|
||||
wfoCityState, wfoCity, state));
|
||||
}
|
||||
}
|
||||
|
||||
// Add in the national centers since they
|
||||
// aren't in the shape file
|
||||
out.println(formatEntry("NH1", "NC", "KNHC",
|
||||
"National Hurricane Center Miami FL", "Miami", ""));
|
||||
out.println(formatEntry("NH2", "NC", "KNHC",
|
||||
"National Hurricane Center Miami FL", "Miami", ""));
|
||||
out.println(formatEntry("ONA", "NC", "KWBC",
|
||||
"Ocean Prediction Center Washington DC",
|
||||
"Washington DC", ""));
|
||||
out.println(formatEntry("ONP", "NC", "KWBC",
|
||||
"Ocean Prediction Center Washington DC",
|
||||
"Washington DC", ""));
|
||||
|
||||
out.println("}");
|
||||
} // out is closed here
|
||||
|
||||
lf.save();
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
PythonScript python = null;
|
||||
|
||||
LocalizationContext edexCx = pathMgr.getContext(
|
||||
LocalizationType.EDEX_STATIC, LocalizationLevel.BASE);
|
||||
LocalizationContext commonCx = pathMgr.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
|
||||
|
||||
String filePath = pathMgr.getFile(edexCx,
|
||||
"textproducts" + File.separator + "Generator.py").getPath();
|
||||
String textProductPath = pathMgr.getFile(edexCx,
|
||||
"textProducts.Generator").getPath();
|
||||
String jutilPath = pathMgr.getFile(commonCx, "python").getPath();
|
||||
|
||||
// Add some getters we need "in the script" that we want hidden
|
||||
preEvals.add("from JUtil import pylistToJavaStringList");
|
||||
preEvals.add("from textproducts.Generator import Generator");
|
||||
preEvals.add("generator = Generator()");
|
||||
preEvals.add("def getProtectedData():\n return pylistToJavaStringList(generator.getProtectedFiles())");
|
||||
String commonPython = GfePyIncludeUtil.getCommonPythonIncludePath();
|
||||
|
||||
Map<String, Object> argList = new HashMap<String, Object>();
|
||||
argList.put("siteId", siteID);
|
||||
|
@ -210,20 +272,18 @@ public class Configurator {
|
|||
|
||||
try {
|
||||
python = new PythonScript(filePath, PyUtil.buildJepIncludePath(
|
||||
pythonDirectory, textProductPath, jutilPath), this
|
||||
.getClass().getClassLoader(), preEvals);
|
||||
pythonDirectory, commonPython), this.getClass()
|
||||
.getClassLoader());
|
||||
|
||||
// Open the Python interpreter using the designated script.
|
||||
python.execute("generator.create", argList);
|
||||
protectedFilesList = (List<String>) python.execute(
|
||||
"getProtectedData", null);
|
||||
protectedFilesList = (List<String>) python.execute("runFromJava",
|
||||
argList);
|
||||
|
||||
updateProtectedFile();
|
||||
updateLastRuntime();
|
||||
} catch (JepException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error Configuring Text Products", e);
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (python != null) {
|
||||
python.dispose();
|
||||
|
@ -231,6 +291,22 @@ public class Configurator {
|
|||
}
|
||||
}
|
||||
|
||||
private String formatEntry(String wfo, String region, String fullStationID,
|
||||
String wfoCityState, String wfoCity, String state) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" '").append(wfo).append("': {\n");
|
||||
sb.append(" 'region': '").append(region).append("',\n");
|
||||
sb.append(" 'fullStationID': '").append(fullStationID)
|
||||
.append("',\n");
|
||||
sb.append(" 'wfoCityState': '").append(wfoCityState)
|
||||
.append("',\n");
|
||||
sb.append(" 'wfoCity': '").append(wfoCity).append("',\n");
|
||||
sb.append(" 'state': '").append(state).append("',\n");
|
||||
sb.append(" },");
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the protected files.
|
||||
*/
|
||||
|
|
|
@ -35,8 +35,8 @@ from zones2cities import *
|
|||
# ------------ ---------- ----------- --------------------------
|
||||
# 01/08/10 #1209 randerso Initial Creation.
|
||||
# 10/19/12 #1091 dgilling Support localMaps.py.
|
||||
#
|
||||
#
|
||||
# 10/20/2014 #3685 randerso Converted text to mixed case
|
||||
# Fixed mapDict to keep zones from different maps separate
|
||||
#
|
||||
|
||||
CityLocationDict = {}
|
||||
|
@ -111,13 +111,23 @@ def makeCityString(dictRecord):
|
|||
# handle marine states
|
||||
def checkMarineState(ugcCode):
|
||||
#returns None if unknown, description if known
|
||||
areas = {'AM': 'ATLANTIC COASTAL WATERS', 'GM': 'GULF OF MEXICO',
|
||||
'LE': 'LAKE ERIE', 'LO': 'LAKE ONTARIO', 'LH': 'LAKE HURON',
|
||||
'SC': 'LAKE ST CLAIR', 'LM': 'LAKE MICHIGAN', 'LS': 'LAKE SUPERIOR',
|
||||
'PZ': 'PACIFIC COASTAL WATERS', 'PK': 'ALASKAN COASTAL WATERS',
|
||||
'PH': 'HAWAIIAN COASTAL WATERS', 'PM': 'MARIANAS WATERS',
|
||||
'AN': 'ATLANTIC COASTAL WATERS', 'PS': 'AMERICAN SAMOA COASTAL WATERS',
|
||||
'SL': 'ST LAWRENCE RIVER'}
|
||||
areas = {
|
||||
'AM': 'Atlantic coastal waters',
|
||||
'GM': 'Gulf of Mexico',
|
||||
'LE': 'Lake Erie',
|
||||
'LO': 'Lake Ontario',
|
||||
'LH': 'Lake Huron',
|
||||
'SC': 'Lake St Clair',
|
||||
'LM': 'Lake Michigan',
|
||||
'LS': 'Lake Superior',
|
||||
'PZ': 'Pacific coastal waters',
|
||||
'PK': 'Alaskan coastal waters',
|
||||
'PH': 'Hawaiian coastal waters',
|
||||
'PM': 'Marianas waters',
|
||||
'AN': 'Atlantic coastal waters',
|
||||
'PS': 'American Samoa coastal waters',
|
||||
'SL': 'St Lawrence River',
|
||||
}
|
||||
area = ugcCode[0:2]
|
||||
return areas.get(area, None)
|
||||
|
||||
|
@ -128,82 +138,86 @@ def createAreaDictionary(outputDir, mapDict):
|
|||
areadict = {}
|
||||
mapIter = mapDict.entrySet().iterator()
|
||||
while mapIter.hasNext():
|
||||
entry = mapIter.next()
|
||||
ean = str(entry.getKey())
|
||||
att = entry.getValue()
|
||||
if len(ean):
|
||||
try:
|
||||
d = {}
|
||||
if att.containsKey('zone') and att.containsKey('state'):
|
||||
d['ugcCode'] = str(att.get('state')) + "Z" + str(att.get('zone'))
|
||||
elif att.containsKey('id'):
|
||||
d['ugcCode'] = str(att.get('id'))
|
||||
elif att.containsKey('fips') and att.containsKey('state') and \
|
||||
att.containsKey('countyname'):
|
||||
d['ugcCode'] = str(att.get('state')) + "C" + str(att.get('fips'))[-3:]
|
||||
d['ugcName'] = string.strip(str(att.get('countyname')))
|
||||
else:
|
||||
continue
|
||||
|
||||
if att.containsKey('state'):
|
||||
d["stateAbbr"] = str(att.get('state'))
|
||||
|
||||
if att.containsKey('name'):
|
||||
d["ugcName"] = string.strip(str(att.get('name')))
|
||||
|
||||
if att.containsKey('time_zone'):
|
||||
tzvalue = getRealTimeZone(str(att.get('time_zone')))
|
||||
if tzvalue is not None:
|
||||
d["ugcTimeZone"] = tzvalue
|
||||
|
||||
if zonedata.has_key(d['ugcCode']):
|
||||
cityDict = zonedata[d['ugcCode']]
|
||||
elif fipsdata.has_key(d['ugcCode']):
|
||||
cityDict = fipsdata[d['ugcCode']]
|
||||
else:
|
||||
cityDict = None
|
||||
|
||||
if cityDict:
|
||||
cityString = makeCityString(cityDict)
|
||||
if cityString is not None:
|
||||
cityString, locs = cityString
|
||||
if len(cityString):
|
||||
d["ugcCityString"] = cityString
|
||||
CityLocationDict[ean] = locs
|
||||
|
||||
# partOfState codes
|
||||
if zonedata.has_key(d['ugcCode']):
|
||||
if zonedata[d['ugcCode']].has_key('partOfState'):
|
||||
d["partOfState"] = \
|
||||
zonedata[d['ugcCode']]['partOfState']
|
||||
elif fipsdata.has_key(d['ugcCode']):
|
||||
if fipsdata[d['ugcCode']].has_key('partOfState'):
|
||||
d["partOfState"] = \
|
||||
fipsdata[d['ugcCode']]['partOfState']
|
||||
|
||||
# full state name
|
||||
if zonedata.has_key(d['ugcCode']):
|
||||
if zonedata[d['ugcCode']].has_key('fullStateName'):
|
||||
d["fullStateName"] = \
|
||||
zonedata[d['ugcCode']]['fullStateName']
|
||||
elif fipsdata.has_key(d['ugcCode']):
|
||||
if fipsdata[d['ugcCode']].has_key('fullStateName'):
|
||||
d["fullStateName"] = \
|
||||
fipsdata[d['ugcCode']]['fullStateName']
|
||||
else:
|
||||
marineState = checkMarineState(d['ugcCode'])
|
||||
if marineState is not None:
|
||||
d['fullStateName'] = marineState
|
||||
|
||||
|
||||
if areadict.has_key(ean) and d != areadict[ean]:
|
||||
LogStream.logDiag("Mismatch of definitions in " +\
|
||||
"AreaDictionary creation. EditAreaName=", ean,
|
||||
"AreaDict=\n", areadict[ean], "\nIgnored=\n", d)
|
||||
else:
|
||||
areadict[ean] = d
|
||||
except:
|
||||
LogStream.logProblem("Problem with ", ean, LogStream.exc())
|
||||
mapEntry = mapIter.next()
|
||||
mapname = str(mapEntry.getKey())
|
||||
attList = mapEntry.getValue()
|
||||
attIter = attList.iterator()
|
||||
while attIter.hasNext():
|
||||
att = attIter.next()
|
||||
ean = str(att.get("editarea"))
|
||||
if len(ean):
|
||||
try:
|
||||
d = {}
|
||||
if att.containsKey('zone') and att.containsKey('state'):
|
||||
d['ugcCode'] = str(att.get('state')) + "Z" + str(att.get('zone'))
|
||||
elif att.containsKey('id'):
|
||||
d['ugcCode'] = str(att.get('id'))
|
||||
elif att.containsKey('fips') and att.containsKey('state') and \
|
||||
att.containsKey('countyname'):
|
||||
d['ugcCode'] = str(att.get('state')) + "C" + str(att.get('fips'))[-3:]
|
||||
d['ugcName'] = string.strip(str(att.get('countyname')))
|
||||
else:
|
||||
continue
|
||||
|
||||
if att.containsKey('state'):
|
||||
d["stateAbbr"] = str(att.get('state'))
|
||||
|
||||
if att.containsKey('name'):
|
||||
d["ugcName"] = string.strip(str(att.get('name')))
|
||||
|
||||
if att.containsKey('time_zone'):
|
||||
tzvalue = getRealTimeZone(str(att.get('time_zone')))
|
||||
if tzvalue is not None:
|
||||
d["ugcTimeZone"] = tzvalue
|
||||
|
||||
if zonedata.has_key(d['ugcCode']):
|
||||
cityDict = zonedata[d['ugcCode']]
|
||||
elif fipsdata.has_key(d['ugcCode']):
|
||||
cityDict = fipsdata[d['ugcCode']]
|
||||
else:
|
||||
cityDict = None
|
||||
|
||||
if cityDict:
|
||||
cityString = makeCityString(cityDict)
|
||||
if cityString is not None:
|
||||
cityString, locs = cityString
|
||||
if len(cityString):
|
||||
d["ugcCityString"] = cityString
|
||||
CityLocationDict[ean] = locs
|
||||
|
||||
# partOfState codes
|
||||
if zonedata.has_key(d['ugcCode']):
|
||||
if zonedata[d['ugcCode']].has_key('partOfState'):
|
||||
d["partOfState"] = \
|
||||
zonedata[d['ugcCode']]['partOfState']
|
||||
elif fipsdata.has_key(d['ugcCode']):
|
||||
if fipsdata[d['ugcCode']].has_key('partOfState'):
|
||||
d["partOfState"] = \
|
||||
fipsdata[d['ugcCode']]['partOfState']
|
||||
|
||||
# full state name
|
||||
if zonedata.has_key(d['ugcCode']):
|
||||
if zonedata[d['ugcCode']].has_key('fullStateName'):
|
||||
d["fullStateName"] = \
|
||||
zonedata[d['ugcCode']]['fullStateName']
|
||||
elif fipsdata.has_key(d['ugcCode']):
|
||||
if fipsdata[d['ugcCode']].has_key('fullStateName'):
|
||||
d["fullStateName"] = \
|
||||
fipsdata[d['ugcCode']]['fullStateName']
|
||||
else:
|
||||
marineState = checkMarineState(d['ugcCode'])
|
||||
if marineState is not None:
|
||||
d['fullStateName'] = marineState
|
||||
|
||||
|
||||
if areadict.has_key(ean) and d != areadict[ean]:
|
||||
LogStream.logDiag("Mismatch of definitions in " +\
|
||||
"AreaDictionary creation. EditAreaName=", ean,
|
||||
"AreaDict=\n", areadict[ean], "\nIgnored=\n", d)
|
||||
else:
|
||||
areadict[ean] = d
|
||||
except:
|
||||
LogStream.logProblem("Problem with ", ean, LogStream.exc())
|
||||
|
||||
s = """
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -18,29 +18,34 @@
|
|||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
|
||||
"""Generate site specific text products.
|
||||
|
||||
This script is run at install time to customize a set of the text products
|
||||
for a given site.
|
||||
|
||||
SOFTWARE HISTORY
|
||||
Date Ticket# Engineer Description
|
||||
------------ ---------- ----------- --------------------------
|
||||
Jun 23, 2008 1180 jelkins Initial creation
|
||||
Jul 08, 2008 1222 jelkins Modified for use within Java
|
||||
Jul 09, 2008 1222 jelkins Split command line loader from class
|
||||
Jul 24, 2012 #944 dgilling Refactored to support separate
|
||||
generation of products and utilities.
|
||||
Sep 07, 2012 #1150 dgilling Ensure all necessary dirs get created.
|
||||
May 12, 2014 2536 bclement renamed text plugin to include uf in name
|
||||
|
||||
@author: jelkins
|
||||
"""
|
||||
#
|
||||
# Generate site specific text products.
|
||||
#
|
||||
# This script is run at install time to customize a set of the text products
|
||||
# for a given site.
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# Jun 23, 2008 1180 jelkins Initial creation
|
||||
# Jul 08, 2008 1222 jelkins Modified for use within Java
|
||||
# Jul 09, 2008 1222 jelkins Split command line loader from class
|
||||
# Jul 24, 2012 #944 dgilling Refactored to support separate
|
||||
# generation of products and utilities.
|
||||
# Sep 07, 2012 #1150 dgilling Ensure all necessary dirs get created.
|
||||
# May 12, 2014 2536 bclement renamed text plugin to include uf in name
|
||||
# Oct 20, 2014 #3685 randerso Changed how SiteInfo is loaded.
|
||||
# Fixed logging to log to a file
|
||||
# Cleaned up how protected file updates are returned
|
||||
#
|
||||
# @author: jelkins
|
||||
#
|
||||
##
|
||||
__version__ = "1.0"
|
||||
|
||||
import errno
|
||||
import os
|
||||
import JUtil
|
||||
from os.path import basename
|
||||
from os.path import join
|
||||
from os.path import dirname
|
||||
|
@ -64,7 +69,6 @@ from sys import path
|
|||
path.append(join(LIBRARY_DIR,"../"))
|
||||
path.append(join(PREFERENCE_DIR,"../"))
|
||||
|
||||
from library.SiteInfo import SiteInfo as SITE_INFO
|
||||
from preferences.configureTextProducts import NWSProducts as NWS_PRODUCTS
|
||||
|
||||
from os.path import basename
|
||||
|
@ -73,12 +77,21 @@ from os.path import abspath
|
|||
from os.path import join
|
||||
|
||||
# ---- Setup Logging ----------------------------------------------------------
|
||||
LOG_CONF = join(SCRIPT_DIR,"preferences","logging.conf")
|
||||
import logging
|
||||
from time import strftime, gmtime
|
||||
timeStamp = strftime("%Y%m%d", gmtime())
|
||||
logFile = '/awips2/edex/logs/configureTextProducts-'+timeStamp+'.log'
|
||||
|
||||
import logging.config
|
||||
logging.config.fileConfig(LOG_CONF)
|
||||
LOG = logging.getLogger("configureTextProducts")
|
||||
LOG.setLevel(logging.DEBUG)
|
||||
handler = logging.FileHandler(logFile)
|
||||
handler.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter("%(levelname)-5s %(asctime)s [%(process)d:%(thread)d] %(filename)s: %(message)s")
|
||||
handler.setFormatter(formatter)
|
||||
for h in LOG.handlers:
|
||||
LOG.removeHandler(h)
|
||||
LOG.addHandler(handler)
|
||||
|
||||
LOG = logging.getLogger("Generator")
|
||||
|
||||
# List of protected files
|
||||
fileList = []
|
||||
|
@ -96,6 +109,17 @@ ProcessDirectories = [
|
|||
},
|
||||
]
|
||||
|
||||
# This will "load" SiteInfo in a more complicated way
|
||||
# than 'from SiteCFG import SiteInfo'.
|
||||
from LockingFile import File
|
||||
|
||||
pathManager = PathManagerFactory.getPathManager()
|
||||
lf = pathManager.getStaticLocalizationFile(LocalizationType.COMMON_STATIC, "python/gfe/SiteCFG.py")
|
||||
with File(lf.getFile(), lf.getName(), 'r') as file:
|
||||
fileContents = file.read()
|
||||
|
||||
exec fileContents
|
||||
|
||||
|
||||
class Generator():
|
||||
"""Generates site specific text products from base template files.
|
||||
|
@ -118,7 +142,7 @@ class Generator():
|
|||
|
||||
@raise LookupError: when the site ID is invalid
|
||||
"""
|
||||
if siteId in SITE_INFO.keys():
|
||||
if siteId in SiteInfo.keys():
|
||||
self.__siteId = siteId
|
||||
else:
|
||||
raise LookupError, ' unknown WFO: ' + siteId
|
||||
|
@ -179,6 +203,8 @@ class Generator():
|
|||
created += self.__create(dirInfo['src'], dirInfo['dest'])
|
||||
LOG.info("%d text products created" % created)
|
||||
LOG.debug("Configuration of Text Products Finish")
|
||||
|
||||
return JUtil.pylistToJavaStringList(self.getProtectedFiles())
|
||||
|
||||
def delete(self):
|
||||
"""Delete text products"""
|
||||
|
@ -216,11 +242,11 @@ class Generator():
|
|||
|
||||
LOG.debug("PIL Information for all sites Begin.......")
|
||||
|
||||
for site in SITE_INFO.keys():
|
||||
for site in SiteInfo.keys():
|
||||
LOG.info("--------------------------------------------")
|
||||
LOG.info("%s %s %s" % (site,
|
||||
SITE_INFO[site]['fullStationID'],
|
||||
SITE_INFO[site]['wfoCityState']))
|
||||
SiteInfo[site]['fullStationID'],
|
||||
SiteInfo[site]['wfoCityState']))
|
||||
pils = self.__createPilDictionary(site)
|
||||
self.__printPilDictionary(pils)
|
||||
found += len(pils)
|
||||
|
@ -303,11 +329,11 @@ class Generator():
|
|||
|
||||
subDict = {}
|
||||
subDict['<site>'] = siteid.strip()
|
||||
subDict['<region>'] = SITE_INFO[siteid]['region'].strip()
|
||||
subDict['<wfoCityState>'] = SITE_INFO[siteid]['wfoCityState'].strip()
|
||||
subDict['<wfoCity>'] = SITE_INFO[siteid]['wfoCity'].strip()
|
||||
subDict['<fullStationID>'] = SITE_INFO[siteid]['fullStationID'].strip()
|
||||
subDict['<state>'] = SITE_INFO[siteid]['state'].strip()
|
||||
subDict['<region>'] = SiteInfo[siteid]['region'].strip()
|
||||
subDict['<wfoCityState>'] = SiteInfo[siteid]['wfoCityState'].strip()
|
||||
subDict['<wfoCity>'] = SiteInfo[siteid]['wfoCity'].strip()
|
||||
subDict['<fullStationID>'] = SiteInfo[siteid]['fullStationID'].strip()
|
||||
subDict['<state>'] = SiteInfo[siteid]['state'].strip()
|
||||
if product is not None:
|
||||
subDict['<product>'] = product.strip()
|
||||
if ProductToStandardMapping.has_key(product):
|
||||
|
@ -342,7 +368,7 @@ class Generator():
|
|||
|
||||
subDict = {}
|
||||
subDict['Site'] = siteid.strip()
|
||||
subDict['Region'] = SITE_INFO[siteid]['region'].strip()
|
||||
subDict['Region'] = SiteInfo[siteid]['region'].strip()
|
||||
if product is not None:
|
||||
subDict['Product'] = product.strip()
|
||||
if pilInfo is not None and pilInfo.has_key("pil") and multiPilFlag:
|
||||
|
@ -378,10 +404,10 @@ class Generator():
|
|||
LOG.info("%s %s" % (p,pillist[p]))
|
||||
|
||||
def __createPilDictionary(self, siteid):
|
||||
"""Update the SITE_INFO with a PIL dictionary
|
||||
"""Update the SiteInfo with a PIL dictionary
|
||||
|
||||
Read the a2a data from the database, create PIL information, and add the information
|
||||
to the SITE_INFO dictionary.
|
||||
to the SiteInfo dictionary.
|
||||
|
||||
@param site: the site for which PIL information is created
|
||||
@type site: string
|
||||
|
@ -390,7 +416,7 @@ class Generator():
|
|||
@rtype: dictionary
|
||||
"""
|
||||
|
||||
siteD = SITE_INFO[siteid]
|
||||
siteD = SiteInfo[siteid]
|
||||
stationID4 = siteD['fullStationID']
|
||||
|
||||
from com.raytheon.uf.edex.plugin.text.dao import AfosToAwipsDao
|
||||
|
@ -435,7 +461,7 @@ class Generator():
|
|||
e['textdbPil'] = pil
|
||||
e['awipsWANPil'] = site4 + pil[3:]
|
||||
d.append(e)
|
||||
siteD[nnn] = d #store the pil dictionary back into the SITE_INFO
|
||||
siteD[nnn] = d #store the pil dictionary back into the SiteInfo
|
||||
|
||||
return pillist
|
||||
|
||||
|
@ -572,8 +598,8 @@ class Generator():
|
|||
continue
|
||||
|
||||
# extract out the pil information from the dictionary
|
||||
if SITE_INFO[siteid].has_key(pilNames[0]):
|
||||
pils = SITE_INFO[siteid][pilNames[0]]
|
||||
if SiteInfo[siteid].has_key(pilNames[0]):
|
||||
pils = SiteInfo[siteid][pilNames[0]]
|
||||
else:
|
||||
#set pils to empty list if none defined
|
||||
pils = [{'awipsWANPil': 'kssscccnnn',
|
||||
|
@ -728,4 +754,7 @@ class Generator():
|
|||
LOG.debug(" Deleting Existing Baseline Templates Finished........")
|
||||
|
||||
return productsRemoved
|
||||
|
||||
|
||||
def runFromJava(siteId, destinationDir):
|
||||
generator = Generator()
|
||||
return generator.create(siteId, destinationDir)
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue