Merge branch 'master_14.2.1' into omaha_14.2.1

Former-commit-id: b2032880ac [formerly 9133aeccd450b0e241953c588192c2ee33fcbe8e]
Former-commit-id: eb9d4319dc
This commit is contained in:
Steve Harris 2014-02-03 10:26:11 -06:00
commit 33aea09906
347 changed files with 62855 additions and 50802 deletions

View file

@ -35,29 +35,31 @@ fi
if [ -z $7 ] ; then
PGBINDIR=''
PSQLBINDIR=''
else
PGBINDIR=${7}/bin/
PSQLBINDIR=/awips2/psql/bin/
fi
echo " Importing `basename ${SHAPEFILE}` into ${SCHEMA}.${TABLE} ..."
if [ -n "$LOGFILE" ] ; then
${PGBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
${PSQLBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
DELETE FROM public.geometry_columns WHERE f_table_schema = '${SCHEMA}' AND f_table_name = '${TABLE}';
DROP TABLE IF EXISTS ${SCHEMA}.${TABLE}
" >> $LOGFILE 2>&1
${PGBINDIR}shp2pgsql -s 4326 -I ${SHAPEFILE} ${SCHEMA}.${TABLE} 2>> $LOGFILE | ${PGBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -f - >> $LOGFILE 2>&1
${PGBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
${PGBINDIR}shp2pgsql -s 4326 -g the_geom -I ${SHAPEFILE} ${SCHEMA}.${TABLE} 2>> $LOGFILE | ${PSQLBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -f - >> $LOGFILE 2>&1
${PSQLBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
SELECT AddGeometryColumn('${SCHEMA}','${TABLE}','the_geom_0','4326',(SELECT type FROM public.geometry_columns WHERE f_table_schema='${SCHEMA}' and f_table_name='${TABLE}' and f_geometry_column='the_geom'),2);
UPDATE ${SCHEMA}.${TABLE} SET the_geom_0=ST_Segmentize(the_geom,0.1);
CREATE INDEX ${TABLE}_the_geom_0_gist ON ${SCHEMA}.${TABLE} USING gist(the_geom_0);
" >> $LOGFILE 2>&1
else
${PGBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
${PSQLBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
DELETE FROM public.geometry_columns WHERE f_table_schema = '${SCHEMA}' AND f_table_name = '${TABLE}';
DROP TABLE IF EXISTS ${SCHEMA}.${TABLE}
"
${PGBINDIR}shp2pgsql -s 4326 -I ${SHAPEFILE} ${SCHEMA}.${TABLE} | ${PGBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -f -
${PGBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
${PGBINDIR}shp2pgsql -s 4326 -g the_geom -I ${SHAPEFILE} ${SCHEMA}.${TABLE} | ${PSQLBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -f -
${PSQLBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
SELECT AddGeometryColumn('${SCHEMA}','${TABLE}','the_geom_0','4326',(SELECT type FROM public.geometry_columns WHERE f_table_schema='${SCHEMA}' and f_table_name='${TABLE}' and f_geometry_column='the_geom'),2);
UPDATE ${SCHEMA}.${TABLE} SET the_geom_0=ST_Segmentize(the_geom,0.1);
CREATE INDEX ${TABLE}_the_geom_0_gist ON ${SCHEMA}.${TABLE} USING gist(the_geom_0);
@ -73,12 +75,12 @@ if [ -n "$SIMPLEVS" ] ; then
SUFFIX=
for x in $LEV ; do SUFFIX=${SUFFIX}_${x} ; done
if [ -n "$LOGFILE" ] ; then
${PGBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
${PSQLBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
SELECT AddGeometryColumn('${SCHEMA}','${TABLE}','the_geom${SUFFIX}','4326',(SELECT type FROM public.geometry_columns WHERE f_table_schema='${SCHEMA}' and f_table_name='${TABLE}' and f_geometry_column='the_geom'),2);
UPDATE ${SCHEMA}.${TABLE} SET the_geom${SUFFIX}=ST_Segmentize(ST_Multi(ST_SimplifyPreserveTopology(the_geom,${LEV})),0.1);
CREATE INDEX ${TABLE}_the_geom${SUFFIX}_gist ON ${SCHEMA}.${TABLE} USING gist(the_geom${SUFFIX});" >> $LOGFILE 2>&1
else
${PGBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
${PSQLBINDIR}psql -d ncep -U ${PGUSER} -q -p ${PGPORT} -c "
SELECT AddGeometryColumn('${SCHEMA}','${TABLE}','the_geom${SUFFIX}','4326',(SELECT type FROM public.geometry_columns WHERE f_table_schema='${SCHEMA}' and f_table_name='${TABLE}' and f_geometry_column='the_geom'),2);
UPDATE ${SCHEMA}.${TABLE} SET the_geom${SUFFIX}=ST_Segmentize(ST_Multi(ST_SimplifyPreserveTopology(the_geom,${LEV})),0.1);
CREATE INDEX ${TABLE}_the_geom${SUFFIX}_gist ON ${SCHEMA}.${TABLE} USING gist(the_geom${SUFFIX});"

View file

@ -1,4 +1,4 @@
<!--
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
@ -6810,6 +6810,8 @@
</grib1Parameter>
<!-- ECMWF -->
<grib1Parameter>
<center>98</center>
<grib1TableVersion>128</grib1TableVersion>
@ -6891,6 +6893,26 @@
<grib2Value>255</grib2Value>
</grib1Parameter>
<!-- Below added for ECENSMEAN by BradS 03-20-12 -->
<grib1Parameter>
<center>98</center>
<grib1TableVersion>128</grib1TableVersion>
<grib1Value>15</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>0</grib2category>
<grib2Value>4</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>98</center>
<grib1TableVersion>128</grib1TableVersion>
<grib1Value>16</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>0</grib2category>
<grib2Value>5</grib2Value>
</grib1Parameter>
<!-- Above added for ECENSMEAN by BradS 03-20-12 -->
<grib1Parameter>
<center>98</center>
<grib1TableVersion>128</grib1TableVersion>
@ -8740,5 +8762,252 @@
<grib2discipline>10</grib2discipline>
<grib2category>0</grib2category>
<grib2Value>13</grib2Value>
</grib1Parameter>
<!-- end fnmocWave -->
<!-- ukmetHR -->
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>1</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>3</grib2category>
<grib2Value>0</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>2</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>3</grib2category>
<grib2Value>1</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>5</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>3</grib2category>
<grib2Value>3</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>7</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>3</grib2category>
<grib2Value>5</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>11</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>0</grib2category>
<grib2Value>0</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>15</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>0</grib2category>
<grib2Value>4</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>16</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>0</grib2category>
<grib2Value>5</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>20</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>19</grib2category>
<grib2Value>0</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>33</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>2</grib2category>
<grib2Value>2</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>34</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>2</grib2category>
<grib2Value>3</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>40</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>2</grib2category>
<grib2Value>9</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>51</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>1</grib2category>
<grib2Value>0</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>52</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>1</grib2category>
<grib2Value>1</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>59</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>1</grib2category>
<grib2Value>7</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>61</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>1</grib2category>
<grib2Value>8</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>72</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>6</grib2category>
<grib2Value>2</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>73</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>6</grib2category>
<grib2Value>3</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>74</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>6</grib2category>
<grib2Value>4</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>75</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>6</grib2category>
<grib2Value>5</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>111</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>4</grib2category>
<grib2Value>0</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>128</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>3</grib2category>
<grib2Value>1</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>138</grib1Value>
<grib2discipline>255</grib2discipline>
<grib2category>255</grib2category>
<grib2Value>255</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>143</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>1</grib2category>
<grib2Value>195</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>144</grib1Value>
<grib2discipline>2</grib2discipline>
<grib2category>0</grib2category>
<grib2Value>192</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>146</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>6</grib2category>
<grib2Value>15</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>147</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>3</grib2category>
<grib2Value>16</grib2Value>
</grib1Parameter>
<grib1Parameter>
<center>74</center>
<grib1TableVersion>3</grib1TableVersion>
<grib1Value>149</grib1Value>
<grib2discipline>0</grib2discipline>
<grib2category>2</grib2category>
<grib2Value>14</grib2Value>
</grib1Parameter>
<!-- end ukmetHR -->
</grib1ParameterSet>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>108162001</name>
<description>UKMet HiRes tile - Northern Hemisphere
Longitude range 341.25E - 70.416E </description>
<la1>0.279</la1>
<lo1>341.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>108</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>89.722</la2>
<lo2>70.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>108162002</name>
<description>UKMet HiRes tile - Northern Hemisphere
Longitude range 71.25E - 160.416E </description>
<la1>0.279</la1>
<lo1>71.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>108</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>89.722</la2>
<lo2>160.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>108162003</name>
<description>UKMet HiRes tile - Northern Hemisphere
Longitude range 161.25E - 250.416E </description>
<la1>0.279</la1>
<lo1>161.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>108</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>89.722</la2>
<lo2>250.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>108162004</name>
<description>UKMet HiRes tile - Northern Hemisphere
Longitude range 251.25E - 340.416E </description>
<la1>0.279</la1>
<lo1>251.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>108</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>89.722</la2>
<lo2>340.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>108162005</name>
<description>UKMet HiRes tile - Southern Hemisphere
Longitude range 341.25E - 70.416E </description>
<la1>-89.721</la1>
<lo1>341.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>108</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>-0.278</la2>
<lo2>70.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>108162006</name>
<description>UKMet HiRes tile - Southern Hemisphere
Longitude range 71.25E - 160.416E </description>
<la1>-89.721</la1>
<lo1>71.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>108</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>-0.278</la2>
<lo2>160.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>108162007</name>
<description>UKMet HiRes tile - Southern Hemisphere
Longitude range 161.25E - 250.416E </description>
<la1>-89.721</la1>
<lo1>161.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>108</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>-0.278</la2>
<lo2>250.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>108162008</name>
<description>UKMet HiRes tile - Southern Hemisphere
Longitude range 251.25E - 340.416E </description>
<la1>-89.721</la1>
<lo1>251.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>108</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>-0.278</la2>
<lo2>340.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>864162001</name>
<description>UKMet HiRes combined - Northern Hemisphere
Longitude range 71.25E - 70.416E </description>
<la1>0.279</la1>
<lo1>71.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>864</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>89.722</la2>
<lo2>70.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,35 @@
<?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.
-->
<latLonGridCoverage>
<name>864162002</name>
<description>UKMet HiRes combined - Southern Hemisphere
Longitude range 71.25E - 70.416E </description>
<la1>-89.721</la1>
<lo1>71.25</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>864</nx>
<ny>162</ny>
<dx>0.833</dx>
<dy>0.556</dy>
<spacingUnit>degree</spacingUnit>
<la2>-0.278</la2>
<lo2>70.416</lo2>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>115001</name>
<description> SWPC IRGF C </description>
<la1>38.0</la1>
<lo1>250.0</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>11</nx>
<ny>5</ny>
<dx>1</dx>
<dy>1</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>18060001</name>
<description> SWPC Enlil C </description>
<la1>59.0</la1>
<lo1>1.0</lo1>
<firstGridPointCorner>UpperLeft</firstGridPointCorner>
<nx>180</nx>
<ny>60</ny>
<dx>2</dx>
<dy>2</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>18090001</name>
<description> SWPC XRAY C </description>
<la1>89.0</la1>
<lo1>178.0</lo1>
<firstGridPointCorner>UpperLeft</firstGridPointCorner>
<nx>180</nx>
<ny>90</ny>
<dx>2</dx>
<dy>2</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>2090001</name>
<description> SWPC Conductivity C </description>
<la1>-90.0</la1>
<lo1>180.0</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>20</nx>
<ny>90</ny>
<dx>18</dx>
<dy>2</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>2091001</name>
<description> SWPC Ion Temperature C </description>
<la1>-90.0</la1>
<lo1>0.0</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>20</nx>
<ny>91</ny>
<dx>18</dx>
<dy>2</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>360180001</name>
<description> SWPC SXI C </description>
<la1>90.0</la1>
<lo1>0.0</lo1>
<firstGridPointCorner>UpperLeft</firstGridPointCorner>
<nx>360</nx>
<ny>180</ny>
<dx>1</dx>
<dy>1</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>3636001</name>
<description> SWPC SOLAR FLUX C </description>
<la1>87.5</la1>
<lo1>185.0</lo1>
<firstGridPointCorner>UpperLeft</firstGridPointCorner>
<nx>36</nx>
<ny>36</ny>
<dx>10</dx>
<dy>5</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>9050001</name>
<description> SWPC Ovation C </description>
<la1>40.0</la1>
<lo1>0.0</lo1>
<firstGridPointCorner>LowerLeft</firstGridPointCorner>
<nx>90</nx>
<ny>50</ny>
<dx>4</dx>
<dy>1</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -0,0 +1,32 @@
<?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.
-->
<latLonGridCoverage>
<name>9090001</name>
<description> SWPC DRAP20 C </description>
<la1>89.0</la1>
<lo1>182.0</lo1>
<firstGridPointCorner>UpperLeft</firstGridPointCorner>
<nx>90</nx>
<ny>90</ny>
<dx>4</dx>
<dy>2</dy>
<spacingUnit>degree</spacingUnit>
</latLonGridCoverage>

View file

@ -11,6 +11,20 @@
<gribModelSet>
<!-- SUBCENTER 0 -->
<model>
<name>ecens</name>
<center>98</center>
<subcenter>0</subcenter>
<grid>360181001</grid>
<process>
<id>141</id>
<id>142</id>
<id>143</id>
<id>144</id>
<id>145</id>
</process>
</model>
<model>
<name>ecmwfP25</name>
<center>98</center>

View file

@ -2879,6 +2879,7 @@
<name>HPCGuide</name>
<center>7</center>
<subcenter>5</subcenter>
<grid>197</grid>
<process>
<id>183</id>
</process>
@ -3131,6 +3132,16 @@
</process>
</model>
<model>
<name>AK-RTMA-HR</name>
<center>7</center>
<subcenter>4</subcenter>
<grid>1023</grid>
<process>
<id>109</id>
</process>
</model>
<model>
<name>GFSLAMPTstorm</name>
<center>7</center>
@ -3184,4 +3195,90 @@
<!-- END SUBCENTER 14: NWS METEOROLOGICAL DEVELOPMENT LABORATORY -->
<!-- SUBCENTER 16: SPACE WEATHER PREDICTION CENTER -->
<model>
<name>Conductivity</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>2090001</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>SXI</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>360180001</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>DRAP20</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>9090001</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>ENLIL</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>18060001</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>EPFlux</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>3636001</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>SolarFlux</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>18090001</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>IonTemperature</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>2091001</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>IRGF</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>115001</grid>
<process>
<id>255</id>
</process>
</model>
<model>
<name>Ovation</name>
<center>7</center>
<subcenter>16</subcenter>
<grid>9050001</grid>
<process>
<id>255</id>
</process>
</model>
<!-- END SUBCENTER 16: SPACE WEATHER PREDICTION CENTER -->
</gribModelSet>

View file

@ -5,7 +5,10 @@
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. -->
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for further_licensing_information.
History:
F.Achorn/OPC 10/15/13 Added Ukmet HR tiles 1-8
-->
<gribModelSet>
@ -182,6 +185,100 @@
</process>
</model>
<!-- END SUBCENTER 0 -->
<!-- UKMET HiRes Tiles -->
<model>
<name>UkmetHR-1</name>
<center>74</center>
<subcenter>0</subcenter>
<grid>108162001</grid>
<process>
<id>15</id>
<id>44</id>
<id>45</id>
</process>
</model>
<model>
<name>UkmetHR-2</name>
<center>74</center>
<subcenter>0</subcenter>
<grid>108162002</grid>
<process>
<id>15</id>
<id>44</id>
<id>45</id>
</process>
</model>
<model>
<name>UkmetHR-3</name>
<center>74</center>
<subcenter>0</subcenter>
<grid>108162003</grid>
<process>
<id>15</id>
<id>44</id>
<id>45</id>
</process>
</model>
<model>
<name>UkmetHR-4</name>
<center>74</center>
<subcenter>0</subcenter>
<grid>108162004</grid>
<process>
<id>15</id>
<id>44</id>
<id>45</id>
</process>
</model>
<model>
<name>UkmetHR-5</name>
<center>74</center>
<subcenter>0</subcenter>
<grid>108162005</grid>
<process>
<id>15</id>
<id>44</id>
<id>45</id>
</process>
</model>
<model>
<name>UkmetHR-6</name>
<center>74</center>
<subcenter>0</subcenter>
<grid>108162006</grid>
<process>
<id>15</id>
<id>44</id>
<id>45</id>
</process>
</model>
<model>
<name>UkmetHR-7</name>
<center>74</center>
<subcenter>0</subcenter>
<grid>108162007</grid>
<process>
<id>15</id>
<id>44</id>
<id>45</id>
</process>
</model>
<model>
<name>UkmetHR-8</name>
<center>74</center>
<subcenter>0</subcenter>
<grid>108162008</grid>
<process>
<id>15</id>
<id>44</id>
<id>45</id>
</process>
</model>
</gribModelSet>

View file

@ -0,0 +1,5 @@
#Code Table 0.0: Discipline of processed data in the GRIB message, number of GRIB Master table
3:3:Satellite remote sensing products
4:4:Space Weather Products
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,5 @@
# CODE TABLE 3.2, Shape of the reference system
10:10:Earth model assumed WGS84 with corrected geomagnetic coordinates (latitude and longitude) defined by Gustafsson et al., 1992
11:11:Sun assumed spherical with radius = 695,990,000 m (Allen, C.W., 1976 Astrophysical Quantities (3rd Ed.; London: Athlone) and Stonyhurst latitude and longitude system with origin at the intersection of the solar central meridian (as seen from Earth) and the solar equator (Thompson, W, Coordinate systems for solar image data, A&A 449, 791803 (2006))
# 192- 254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,15 @@
# CODE TABLE 4.1, Parameter category by product discipline
0:0:Temperature
1:1:Momentum
2:2:Charged particle mass and number
3:3:Electric and magnetic fields
4:4:Energetic particles
5:5:Waves
6:6:Solar electromagnetic emissions
7:7:Terrestrial electromagnetic emissions
8:8:Imagery
9:9:Ion-neutral coupling
#10-191 Reserved
#192-254 Reserved for Local Use
255:255:Missing

View file

@ -0,0 +1,10 @@
# Product Discipline 4: Space Weather Products, Parameter Category 0: Temperature
0:0:Temperature:K:TMPSWP
1:1:Electron Temperature:K:ELECTMP
2:2:Proton Temperature:K:PROTTMP
3:3:Ion Temperature:K:IONTMP
4:4:Parallel Temperature:K:PRATMP
5:5:Perpendicular Temperature:K:PRPTMP
# 6-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,8 @@
# Product Discipline 4: Space Weather Products, Parameter Category 1: Momentum
0:0:Velocity Magnitude (Speed):m*s^1:SPEED
1:1:1st Vector Component of Velocity (Coordinate system dependent):m*s^1:VEL1
2:2:2nd Vector Component of Velocity (Coordinate system dependent):m*s^1:VEL2
3:3:3rd Vector Component of Velocity (Coordinate system dependent):m*s^1:VEL3
# 4-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,17 @@
# Product Discipline 4: Space Weather Products, Parameter Category 2: Charged Particle Mass and Number
0:0:Particle Number Density:m^3:PLSMDEN
1:1:Electron Density:m^3:ELCDEN
2:2:Proton Density:m^3:PROTDEN
3:3:Ion Density:m^3:IONDEN
4:4:Vertical Electron Content:m^2:VTEC
5:5:HF Absorption Frequency:Hz:ABSFRQ
6:6:HF Absorption:dB:ABSRB
7:7:Spread F:m:SPRDF
8:8:h'F:m:HPRIMF
9:9:Critical Frequency:Hz:CRTFRQ
10:10:Scintillation:Numeric:SCINT
# 11-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,12 @@
# Product Discipline 4: Space Weather Products, Parameter Category 3: Electric and Magnetic Fields
0:0:Magnetic Field Magnitude:T:BTOT
1:1:1st Vector Component of Magnetic Field:T:BVEC1
2:2:2nd Vector Component of Magnetic Field:T:BVEC2
3:3:3rd Vector Component of Magnetic Field:T:BVEC3
4:4:Electric Field Magnitude:V*m^1:ETOT
5:5:1st Vector Component of Electric Field:V*m^1:EVEC1
6:6:2nd Vector Component of Electric Field:V*m^1:EVEC2
7:7:3rd Vector Component of Electric Field:V*m^1:EVEC3
# 8-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,11 @@
# Product Discipline 4: Space Weather Products, Parameter Category 4: Energetic Particles
0:0:Proton Flux (Differential):(m^2*s*sr*eV)^1:DIFPFLUX
1:1:Proton Flux (Integral):(m^2*s*sr)^1:INTPFLUX
2:2:Electron Flux (Differential):(m^2*s*sr*eV)^1:DIFEFLUX
3:3:Electron Flux (Integral):(m^2*s*sr)^1:INTEFLUX
4:4:Heavy Ion Flux (Differential):((m^2*s*sr*eV)/nuc)^1:DIFIFLUX
5:5:Heavy Ion Flux (iIntegral):(m^2*s*sr)^1:INTIFLUX
6:6:Cosmic Ray Neutron Flux:h^1:NTRNFLUX
# 7-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,4 @@
# Product Discipline 4: Space Weather Products, Parameter Category 5: Waves
# 0-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,13 @@
# Product Discipline 4: Space Weather Products, Parameter Category 6: Solar Electromagnetic Emissions
0:0:Integrated Solar Irradiance:W*m^2:TSI
1:1:Solar X-ray Flux (XRS Long):W*m^2:XLONG
2:2:Solar X-ray Flux (XRS Short):W*m^2:XSHRT
3:3:Solar EUV Irradiance:W*m^2:EUVIRR
4:4:Solar Spectral Irradiance:W*m^2*n*m^1:SPECIRR
5:5:F10.7:W*m^2*H*z^1:F107
6:6:Solar Radio Emissions:W*m^2*Hz^1:SOLRF
# 7-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,10 @@
# Product Discipline 4: Space Weather Products, Parameter Category 7: Terrestrial electromagnetic emissions
0:0:Limb Intensity:J*m^2*s^1:LMBINT
1:1:Disk Intensity:j*m^2*s^1:DSKINT
2:2:Disk Intensity Day:J*m^2*s^1:DSKDAY
3:3:Disk Intensity Night:J*m^2*s^1:DSKNGT
# 4-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,14 @@
# Product Discipline 4: Space Weather Products, Parameter Category 8: Imagery
0:0:X-Ray Radiance:W*s*r^1*m^2:XRAYRAD
1:1:EUV Radiance:W*s*r^1*m^2:EUVRAD
2:2:H-Alpha Radiance:W*s*r^1*m^2:HARAD
3:3:White Light Radiance:W*s*r^1*m^2:WHTRAD
4:4:CaII-K Radiance:W*s*r^1*m^2:CAIIRAD
5:5:White Light Coronagraph Radiance:W*s*r^1*m^2:WHTCOR
6:6:Heliospheric Radiance:W*s*r^1*m^2:HELCOR
7:7:Thematic Mask:Numeric:MASK
# 8-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,7 @@
# Product Discipline 4: Space Weather Products, Parameter Category 9: Ion-Neutral Coupling
0:0:Pedersen Conductivity:S*m^1:SIGPED
1:1:Hall Conductivity:S*m^1:SIGHAL
2:2:Parallel Conductivity:S*m^1:SIGPAR
# 3-191 Reserved
# 192-254 Reserved for local use
255:255:Missing

View file

@ -0,0 +1,48 @@
# Code:table:4.5: Fixed surface types and units
170:170:Ionospheric D-region level::IDRL
171:171:Ionospheric E-region level::IERL
172:172:Ionospheric F1-region level::IF1RL
173:173:Ionospheric F2-region level::IF2RL
174:174:Specified radius from the center of the Sun:m:SRCS
175:175:Solar photosphere::SP
#192-254 Reserved for local use
200:200:Entire Atmosphere::EATM:EA
201:201:Entire Ocean::EOCN
204:204:Highest Tropospheric Freezing Level::HTFL
206:206:Grid Scale Cloud Bottom Level::GCBL
207:207:Grid Scale Cloud Top Level::GCTL
209:209:Boundary Layer Cloud Bottom Level::BCBL
210:210:Boundary Layer Cloud Top Level::BCTL
211:211:Boundary Layer Cloud Layer::BCY
212:212:Low Cloud Bottom Level::LCBL
213:213:Low Cloud Top Level::LCTL
214:214:Low Cloud Layer::LCY
215:215:Cloud Ceiling::CLG
220:220:Planetary Boundary Layer:: BLD
221:221:Layer Between Two Hybrid Levels::LBTHL
222:222:Middle Cloud Bottom Level::MCBL
223:223:Middle Cloud Top Level::MCTL
224:224:Middle Cloud Layer::MCY
232:232:High Cloud Bottom Level::HCBL
233:233:High Cloud Top Level::HCTL
234:234:High Cloud Layer::HCL
235:235:Ocean Isotherm Level:1/10 ℃:OITL
236:236:Layer Between Two Depths Below Ocean Surface::OLYR
237:237:Bottom of Ocean Mixed Layer (m):m:OBML
238:238:Bottom of Ocean Isothermal Layer:m:OBIL
239:239:Layer Ocean Surface and 26C Ocean Isothermal Level::LOS
240:240:Ocean Mixed Layer::OML
241:241:Ordered Sequence of Data::OSD
242:242:Convective Cloud Bottom Level::CCBL
243:243:Convective Cloud Top Level::CCTL
244:244:Convective Cloud::CCY
245:245:Lowest Level of the Wet Bulb Zero::WBZ
246:246:Maximum Equivalent Potential Temperature level::MTHE:MEPT
247:247:Equilibrium Level::EHLT:EL
248:248:Shallow Convective Cloud Bottom Level::SCBL
249:249:Shallow Convective Cloud Top Level::SCTL
251:251:Deep Convective Cloud Bottom Level::DCBL
252:252:Deep Convective Cloud Top Level::DCTL
253:253:Lowest Bottom Level of Supercooled Liquid Water Layer::LSCLW
254:254:Highest Top Level of Supercooled Liquid Water Layer::HSCLW
255:255:Missing

View file

@ -0,0 +1,5 @@
# Product Discipline 2: Land surface products, Parameter Category 0: Vegetation/Biomass
#192-254 Reserved for local use
192:192:Volumetric soil moisture content:Proportion:SOILW
255:255:Missing

View file

@ -0,0 +1,26 @@
<?xml version="2.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.
-->
<compositeModel>
<modelName>UkmetHR-NorthernHemisphere</modelName>
<grid>864162001</grid>
<componentModels>UkmetHR-2:UkmetHR-3:UkmetHR-4:UkmetHR-1</componentModels>
</compositeModel>

View file

@ -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.
-->
<compositeModel>
<modelName>UkmetHR-SouthernHemisphere</modelName>
<grid>864162002</grid>
<componentModels>UkmetHR-6:UkmetHR-7:UkmetHR-8:UkmetHR-5</componentModels>
</compositeModel>

View file

@ -137,4 +137,8 @@
<alias base="GCBL">GCBL</alias>
<alias base="SCBL">SCBL</alias>
<alias base="SCTL">SCTL</alias>
<alias base="SP">SPXX</alias>
<alias base="IDRL">IDRL</alias>
<alias base="SRCS">SRCS</alias>
<alias base="NTAT">NTAT</alias>
</aliasList>

View file

@ -91,7 +91,7 @@
<alias base="CICEP18hr">WXTP18</alias>
<alias base="CICEP24hr">WXTP24</alias>
<alias base="CICEP48hr">WXTP48</alias>
<alias base="CIn">CINH</alias>
<alias base="CIn">CINS</alias>
<alias base="CLWMR">CLWMR</alias>
<alias base="CP">ACPCP</alias>
<alias base="CP1hr">C01M</alias>
@ -294,15 +294,15 @@
<alias base="T24hr">TMPK24</alias>
<alias base="T48hr">TMPK48</alias>
<alias base="Ta">TMPKA</alias>
<alias base="TCC">CLD</alias>
<alias base="TCC1hr">CLD01</alias>
<alias base="TCC3hr">CLD03</alias>
<alias base="TCC6hr">CLD06</alias>
<alias base="TCC9hr">CLD09</alias>
<alias base="TCC12hr">CLD12</alias>
<alias base="TCC18hr">CLD18</alias>
<alias base="TCC24hr">CLD24</alias>
<alias base="TCC48hr">CLD48</alias>
<alias base="TCC">TCLD</alias>
<alias base="TCC1hr">TCLD01</alias>
<alias base="TCC3hr">TCLD03</alias>
<alias base="TCC6hr">TCLD06</alias>
<alias base="TCC9hr">TCLD09</alias>
<alias base="TCC12hr">TCLD12</alias>
<alias base="TCC18hr">TCLD18</alias>
<alias base="TCC24hr">TCLD24</alias>
<alias base="TCC48hr">TCLD48</alias>
<alias base="ThP">TSTM</alias>
<alias base="TOZNE">TOZO</alias>
<alias base="TP">APCP</alias>

View file

@ -14,8 +14,8 @@
* 12/2009 144 T. Lee Migrated to TO11D6
* 01/2010 201 M. Li Split into dataplugin project
* 05/2010 144 L. Lin Migration to TO11DR11.
* 11/2013 1066 G. Hull call constructCRSfromWKT
* Nov 14, 2013 2393 bclement added getGridGeometry()
*
* </pre>
*/
@ -24,8 +24,6 @@ package gov.noaa.nws.ncep.common.dataplugin.mcidas;
import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN;
import java.awt.geom.Rectangle2D;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -69,16 +67,18 @@ import com.vividsolutions.jts.geom.Polygon;
@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
@XmlAccessorType(XmlAccessType.NONE)
@DynamicSerialize
public class McidasMapCoverage extends PersistableDataObject implements ISpatialObject {
public class McidasMapCoverage extends PersistableDataObject implements
ISpatialObject {
private static final long serialVersionUID = 1;
@Id
private int pid;
/**
* The projection of the map coverage 1 = Mercator, 3 = Lambert Conformal or TANC
* 5 = Polar Stereographic
* 7585 = native satellite navigation e.g. GVAR, ...
* The projection of the map coverage 1 = Mercator, 3 = Lambert Conformal or
* TANC 5 = Polar Stereographic 7585 = native satellite navigation e.g.
* GVAR, ...
*/
@Column
@XmlAttribute
@ -96,7 +96,7 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
@XmlAttribute
@DynamicSerializeElement
private Integer ny;
/** The pixel resolution of the image */
@Column
@XmlAttribute
@ -116,10 +116,11 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
private Float clon;
/**
* The standard latitude 1. For the Lambert Conformal projection this is the latitude
* of the proection cone intersects the earth. For the Polar Stereographic this is the
* latitude at which projection plan intersects the earth. For Mercator this is the
* latitude at which the Mercator projection cylinder intersects the earth.
* The standard latitude 1. For the Lambert Conformal projection this is the
* latitude of the proection cone intersects the earth. For the Polar
* Stereographic this is the latitude at which projection plan intersects
* the earth. For Mercator this is the latitude at which the Mercator
* projection cylinder intersects the earth.
*/
@Column
@XmlAttribute
@ -127,14 +128,14 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
private Float stdlat1;
/**
* The standard latitude 2 is the second latitude of a secant cone which intersects the
* earth for the Lambert Conformal projection.
* The standard latitude 2 is the second latitude of a secant cone which
* intersects the earth for the Lambert Conformal projection.
*/
@Column
@XmlAttribute
@DynamicSerializeElement
private Float stdlat2;
/** The latitude of the lower-left corner */
@Column
@XmlAttribute
@ -158,31 +159,31 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
@XmlAttribute
@DynamicSerializeElement
private Float urlon;
/** image element coordinate of area line 0, element 0 */
@Column
@XmlAttribute
@DynamicSerializeElement
private int upperLeftElement;
/** image line coordinate of area line 0, element 0 */
@Column
@XmlAttribute
@DynamicSerializeElement
private int upperLeftLine;
/** element resolution */
@Column
@XmlAttribute
@DynamicSerializeElement
private int elementRes;
/** line resolution */
@Column
@XmlAttribute
@DynamicSerializeElement
private int lineRes;
@Column(length = 5120)
@XmlAttribute
@DynamicSerializeElement
@ -245,9 +246,10 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
* @param geometry
* The geometry
*/
public McidasMapCoverage(Integer projection, Integer nx, Integer ny, Float dx,
Float dy, Float clon, Float stdlat1, Float stdlat2, Float lllat, Float lllon,
Float urlat,Float urlon, CoordinateReferenceSystem crs, Geometry geometry) {
public McidasMapCoverage(Integer projection, Integer nx, Integer ny,
Float dx, Float dy, Float clon, Float stdlat1, Float stdlat2,
Float lllat, Float lllon, Float urlat, Float urlon,
CoordinateReferenceSystem crs, Geometry geometry) {
this.projection = projection;
this.nx = nx;
this.ny = ny;
@ -274,19 +276,27 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
* Constructs a new SatMapCoverage Object for native satellite navigation
*
* @param mapProjection
* @param nx The number of horizontal scan lines
* @param ny The number vertical scan lines
* @param reflon Reference Longitude
* @param upperLeftElement image element coordinate of area line 0, element 0
* @param upperLeftLine image line coordinate of area line 0, element 0
* @param xres Element resolution
* @param yres Line resolution
* @param crs The coordinate reference system
* @param nx
* The number of horizontal scan lines
* @param ny
* The number vertical scan lines
* @param reflon
* Reference Longitude
* @param upperLeftElement
* image element coordinate of area line 0, element 0
* @param upperLeftLine
* image line coordinate of area line 0, element 0
* @param xres
* Element resolution
* @param yres
* Line resolution
* @param crs
* The coordinate reference system
* @param geometry
*/
public McidasMapCoverage(Integer projection, Integer nx, Integer ny,
Float reflon, int upperLeftElement, int upperLeftLine, int xres,
int yres, ProjectedCRS crs, Geometry geometry) {
Float reflon, int upperLeftElement, int upperLeftLine, int xres,
int yres, ProjectedCRS crs, Geometry geometry) {
this.projection = projection;
this.nx = nx;
this.ny = ny;
@ -307,10 +317,10 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
this.crsWKT = crsObject.toWKT();
this.location = (Polygon) geometry;
pid = this.hashCode();
}
}
@Override
public int hashCode() {
public int hashCode() {
HashCodeBuilder hashBuilder = new HashCodeBuilder();
hashBuilder.append(projection);
hashBuilder.append(nx);
@ -342,39 +352,9 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
if (crsObject == null) {
try {
crsObject = CRS.parseWKT(crsWKT);
// ReferencingFactoryFinder.getCRSFactory(null).createFromWKT(crsWKT);
} catch (Exception e) {
/*
* parseWKT() doesn't recognize PROJCS PARAMETERS whose value is a "String" (it
* assumes all PARAMETER values are doubles.)
* If this crsWKT is a MCIDAS NAV, use McidasSpatialFactory instead.
*/
//e.printStackTrace();
Pattern p = Pattern.compile("PROJCS\\[\"MCIDAS\\sAREA\\s(.*)\"");
Matcher m = p.matcher(crsWKT);
m.find();
if ( m.groupCount() == 1 ) {
String type = m.group(1);
//System.out.println("FOUND PROJCS:"+m.group(0)+":"+type);
p = Pattern.compile("\\[\"NAV_BLOCK_BASE64\",\\s\"(.*)\"\\]");
m = p.matcher(crsWKT);
boolean found = m.find();
//System.out.println(m.group());
//System.out.println(m.groupCount()+m.group(1));
if ( found ) {
String navBlock = m.group(1);
crsObject = McidasSpatialFactory.getInstance().constructCRS(type, navBlock);
}
else {
crsObject = null;
}
}
else {
crsObject = null;
}
crsObject = McidasSpatialFactory.getInstance()
.constructCRSfromWKT(crsWKT);
}
}
return crsObject;
@ -466,7 +446,7 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
public void setStdlat1(Float stdlat1) {
this.stdlat1 = stdlat1;
}
public Float getStdlat2() {
return stdlat2;
}
@ -541,73 +521,78 @@ public class McidasMapCoverage extends PersistableDataObject implements ISpatial
this.ny = ny;
}
/**
* @return the upperLeftElement
*/
public int getUpperLeftElement() {
return upperLeftElement;
}
* @return the upperLeftElement
*/
public int getUpperLeftElement() {
return upperLeftElement;
}
/**
* @param upperLeftElement the upperLeftElement to set
*/
public void setUpperLeftElement(int upperLeftElement) {
this.upperLeftElement = upperLeftElement;
}
/**
* @param upperLeftElement
* the upperLeftElement to set
*/
public void setUpperLeftElement(int upperLeftElement) {
this.upperLeftElement = upperLeftElement;
}
/**
* @return the upperLeftLine
*/
public int getUpperLeftLine() {
return upperLeftLine;
}
/**
* @return the upperLeftLine
*/
public int getUpperLeftLine() {
return upperLeftLine;
}
/**
* @param upperLeftLine the upperLeftLine to set
*/
public void setUpperLeftLine(int upperLeftLine) {
this.upperLeftLine = upperLeftLine;
}
/**
* @param upperLeftLine
* the upperLeftLine to set
*/
public void setUpperLeftLine(int upperLeftLine) {
this.upperLeftLine = upperLeftLine;
}
/**
* @return the elementRes
*/
public int getElementRes() {
return elementRes;
}
/**
* @return the elementRes
*/
public int getElementRes() {
return elementRes;
}
/**
* @param elementRes the elementRes to set
*/
public void setElementRes(int elementRes) {
this.elementRes = elementRes;
}
/**
* @param elementRes
* the elementRes to set
*/
public void setElementRes(int elementRes) {
this.elementRes = elementRes;
}
/**
* @return the lineRes
*/
public int getLineRes() {
return lineRes;
}
/**
* @return the lineRes
*/
public int getLineRes() {
return lineRes;
}
/**
* @param lineRes the lineRes to set
*/
public void setLineRes(int lineRes) {
this.lineRes = lineRes;
}
/**
* @param lineRes
* the lineRes to set
*/
public void setLineRes(int lineRes) {
this.lineRes = lineRes;
}
public String getCrsWKT() {
public String getCrsWKT() {
return crsWKT;
}
public void setCrsWKT(String crsWKT) {
//TODO new 2.6 version of geotools adds \r\n to long String parameters in WKT format
// this temp hack removes the extraneous characters, but we may want to investigate
// using a specific formatter to keep this consistent and in our control
// TODO new 2.6 version of geotools adds \r\n to long String parameters
// in WKT format
// this temp hack removes the extraneous characters, but we may want to
// investigate
// using a specific formatter to keep this consistent and in our control
this.crsWKT = crsWKT.replaceAll("\r\n", "");
//this.crsWKT = crsWKT;
// this.crsWKT = crsWKT;
}
public Polygon getLocation() {

View file

@ -9,6 +9,7 @@
* ------------ ---------- ----------- --------------------------
* 10/2009 144 T. Lee Created
* 12/2009 144 T. Lee Migrated to TO11D6
* 11/2013 1066 G. Hull constructCRSfromWKT (from McidasMapCoverage)
*
* </pre>
*
@ -18,6 +19,9 @@
package gov.noaa.nws.ncep.common.dataplugin.mcidas;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import gov.noaa.nws.ncep.common.dataplugin.mcidas.dao.McidasMapCoverageDao;
import org.apache.commons.codec.binary.Base64;
@ -28,6 +32,7 @@ import org.geotools.referencing.operation.DefaultMathTransformFactory;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.NoSuchIdentifierException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.crs.ProjectedCRS;
import org.opengis.referencing.operation.MathTransform;
@ -408,6 +413,30 @@ public class McidasSpatialFactory {
return new String(coded);
}
public ProjectedCRS constructCRSfromWKT( String crsWKT) {
Pattern p = Pattern.compile("PROJCS\\[\"MCIDAS\\sAREA\\s(.*)\"");
Matcher m = p.matcher(crsWKT);
m.find();
ProjectedCRS crsObject=null;
if ( m.groupCount() == 1 ) {
String type = m.group(1);
//System.out.println("FOUND PROJCS:"+m.group(0)+":"+type);
p = Pattern.compile("\\[\"NAV_BLOCK_BASE64\",\\s\"(.*)\"\\]");
m = p.matcher(crsWKT);
boolean found = m.find();
//System.out.println(m.group());
//System.out.println(m.groupCount()+m.group(1));
if ( found ) {
String navBlock = m.group(1);
crsObject = McidasSpatialFactory.getInstance().constructCRS(type, navBlock);
}
}
return crsObject;
}
public ProjectedCRS constructCRS(String type, String encoded) {
ParameterValueGroup pvg = null;

View file

@ -167,6 +167,6 @@ public class NcscatRecord extends PersistablePluginDataObject {
@Override
public String getPluginName() {
return "ncsat";
return "ncscat";
}
}

View file

@ -3,388 +3,490 @@
*/
package gov.noaa.nws.ncep.edex.common.metparameters.parameterconversion;
import java.util.Comparator;
import java.util.List;
import gov.noaa.nws.ncep.edex.common.metparameters.Amount;
import gov.noaa.nws.ncep.edex.common.metparameters.PressureLevel;
import gov.noaa.nws.ncep.edex.common.metparameters.WetBulbPotentialTemp;
import gov.noaa.nws.ncep.edex.common.metparameters.parameterconversion.PRLibrary.InvalidValueException;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer2;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import javax.measure.unit.NonSI;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import gov.noaa.nws.ncep.edex.common.metparameters.AirTemperature;
import gov.noaa.nws.ncep.edex.common.metparameters.Amount;
import gov.noaa.nws.ncep.edex.common.metparameters.DewPointTemp;
import gov.noaa.nws.ncep.edex.common.metparameters.PressureLevel;
import gov.noaa.nws.ncep.edex.common.metparameters.WetBulbPotentialTemp;
////import gov.noaa.nws.ncep.edex.common.metparameters.parameterconversion.PRLibrary.InvalidRangeException;
import gov.noaa.nws.ncep.edex.common.metparameters.parameterconversion.PRLibrary.InvalidValueException;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer;
import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer2;
/**
* @author archana
*
*
*/
public final class PSLibrary {
/**
* Computes the cross totals index
* @param td850 - dewpoint at 850 mb ( in Celsius )
* @param t500 - temperature at 500 mb ( in Celsius )
* @return the difference between the dewpoint and the temperature if neither of them are missing
* and RMISSD ( -9999 ) otherwise.
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount psCtot ( Amount td850, Amount t500) {
/**
* Computes the cross totals index
*
* @param td850
* - dewpoint at 850 mb ( in Celsius )
* @param t500
* - temperature at 500 mb ( in Celsius )
* @return the difference between the dewpoint and the temperature if
* neither of them are missing and RMISSD ( -9999 ) otherwise.
* @throws InvalidValueException
* @throws NullPointerException
*/
/*
* Compute the cross totals index by subtracting 500 mb
* temperature from the 850 mb dewpoint.
*/
if ( !PRLibrary.checkNullOrInvalidValue( td850 )
|| ! PRLibrary.checkNullOrInvalidValue( t500 ) ){
return new Amount ( Unit.ONE );
}
Amount psCtot = new Amount( td850.getValue().floatValue() - t500.getValue().floatValue() , Unit.ONE );
return psCtot;
}
/**
* Computes low, middle, and high elevation Haines indices
* from the temperature and the dewpoint.
* @param tc1 - temperature ( in Celsius )
* @param tc2 - temperature ( in Celsius )
* @param dwpc - dewpoint ( in Celsius )
* @param itype - Haines index:
* 1- Low
* 2 - Middle
* 3 - High
*
* @return
* @throws InvalidValueException
* @throws NullPointerException
*/
public static Amount psHans ( Amount tc1Amt, Amount tc2Amt, Amount dwpcAmt, Amount itypeAmt) {
Amount pshans =new Amount();
if ( ! PRLibrary.checkNullOrInvalidValue( tc1Amt )
|| !PRLibrary.checkNullOrInvalidValue( tc2Amt )
|| !PRLibrary.checkNullOrInvalidValue( dwpcAmt )
|| !PRLibrary.checkNullOrInvalidValue( itypeAmt ) )
return new Amount ( Unit.ONE );
float a = GempakConstants.RMISSD;
float b = GempakConstants.RMISSD;
float tc1 = tc1Amt.getValue().floatValue();
float tc2 = tc2Amt.getValue().floatValue();
float dwpc = dwpcAmt.getValue().floatValue();
float itype = itypeAmt.getValue().floatValue();
/* Compute the Haines index*/
if ( itype == 1 ) {
a = ( ( tc2 - tc1 ) - 3 ) * ( 2 / 5 ) + 1;
b = ( ( tc1 - dwpc ) - 5 ) * ( 2 / 5 ) + 1;
}
else if ( itype == 2 ) {
a = ( ( tc1 - tc2 ) - 5 ) * ( 2 / 6 ) + 1;
b = ( ( tc1 - dwpc ) - 5 ) * ( 2 / 8 ) + 1;
}
else if ( itype == 3 ) {
a = ( ( tc1 - tc2 ) - 17 ) * ( 2 / 5 ) + 1;
b = ( ( tc1 - dwpc ) - 14 ) * ( 2 / 7 ) + 1;
}
a = ( a > 0.9f ? a : 0.9f );
a = ( a < 3.1f ? a : 3.1f );
b = ( b > 0.9f ? b : 0.9f );
b = ( b < 3.1f ? b : 3.1f );
pshans = new Amount ( a + b,Unit.ONE );
// }
return pshans;
}
public final static Amount psCtot(Amount td850, Amount t500) {
/**
*
* Computes the 'K' index
* @param t850 - 850 mb temperature ( in Celsius )
* @param t700 - 700 mb temperature ( in Celsius )
* @param t500 - 500 mb temperature ( in Celsius )
* @param td850 - 850 mb dewpoint ( in Celsius )
* @param td700 - 700 mb dewpoint ( in Celsius )
* @return returns the 'K' index if all the input values are valid and
* RMISSD ( -9999 ) otherwise
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount pskinx ( Amount t850, Amount t700, Amount t500, Amount td850, Amount td700) {
Amount pskinx = new Amount();
if ( !PRLibrary.checkNullOrInvalidValue(t850)
|| !PRLibrary.checkNullOrInvalidValue(t700)
|| !PRLibrary.checkNullOrInvalidValue(t500)
|| !PRLibrary.checkNullOrInvalidValue(td850)
|| !PRLibrary.checkNullOrInvalidValue(td700) )
return new Amount ( Unit.ONE );
pskinx = new Amount ( ( t850.getValue().floatValue() - t500.getValue().floatValue() )
+ td850.getValue().floatValue() - ( t700.getValue().floatValue() - td700.getValue().floatValue() ) , Unit.ONE);
/*
* Compute the cross totals index by subtracting 500 mb temperature from
* the 850 mb dewpoint.
*/
if (!PRLibrary.checkNullOrInvalidValue(td850)
|| !PRLibrary.checkNullOrInvalidValue(t500)) {
return new Amount(Unit.ONE);
}
Amount psCtot = new Amount(td850.getValue().floatValue()
- t500.getValue().floatValue(), Unit.ONE);
return psCtot;
}
return pskinx;
}
/**
* Computes the Showalter index
* @param t850 - 850 mb temperature ( in Celsius )
* @param td850 - 850 mb dewpoint ( in Celsius )
* @param t500 - 500 mb temperature ( in Celsius )
* @return the Showalter index if all the three input parameters are valid and the parcel temperature is computed correctly.
* Otherwise, it returns RMISSD (-9999).
*/
public final static Amount psShow ( Amount t850Amt, Amount td850Amt, Amount t500Amt ) {
float psshow = GempakConstants.RMISSD;
if ( !PRLibrary.checkNullOrInvalidValue(t850Amt)
|| !PRLibrary.checkNullOrInvalidValue(td850Amt)
|| !PRLibrary.checkNullOrInvalidValue(t500Amt) )
return new Amount ( Unit.ONE );
float p850 = 850;
float p500 = 500;
float guess = 0;
/*
* Find equivalent potential temperature at the LCL using 850 mb
* temperature and dewpoint.
*/
Amount thtlcl = PRLibrary.prThte ( new Amount ( p850, NcUnits.MILLIBAR ), t850Amt, td850Amt );
if ( !PRLibrary.checkNullOrInvalidValue(thtlcl) )
return new Amount ( Unit.ONE );
/*Find parcel temperature along pseudoadiabat at 500 mb.
* The parcel temperature tp is the temperature in Celsius at 500 mb of a parcel,
* which lies on the moist adiabat determined by the sounding at 850 mb
*/
Amount tp = PRLibrary.prTmst ( thtlcl,
new Amount( p500, NcUnits.MILLIBAR ),
new Amount ( 0, Unit.ONE ) );
/*Subtract the parcel temperature from the temperature at 500 mb, is the parcel temperature is valid*/
if ( !PRLibrary.checkNullOrInvalidValue(tp) )
return new Amount ( Unit.ONE );
t500Amt = PRLibrary.checkAndConvertInputAmountToExpectedUnits(t500Amt, SI.KELVIN);
float t500 = t500Amt.getValue().floatValue();
psshow = t500 - tp.getValue().floatValue();
/**
* Computes low, middle, and high elevation Haines indices from the
* temperature and the dewpoint.
*
* @param tc1
* - temperature ( in Celsius )
* @param tc2
* - temperature ( in Celsius )
* @param dwpc
* - dewpoint ( in Celsius )
* @param itype
* - Haines index: 1- Low 2 - Middle 3 - High
*
* @return
* @throws InvalidValueException
* @throws NullPointerException
*/
public static Amount psHans(Amount tc1Amt, Amount tc2Amt, Amount dwpcAmt,
Amount itypeAmt) {
Amount pshans = new Amount();
if (!PRLibrary.checkNullOrInvalidValue(tc1Amt)
|| !PRLibrary.checkNullOrInvalidValue(tc2Amt)
|| !PRLibrary.checkNullOrInvalidValue(dwpcAmt)
|| !PRLibrary.checkNullOrInvalidValue(itypeAmt))
return new Amount(Unit.ONE);
float a = GempakConstants.RMISSD;
float b = GempakConstants.RMISSD;
float tc1 = tc1Amt.getValue().floatValue();
float tc2 = tc2Amt.getValue().floatValue();
float dwpc = dwpcAmt.getValue().floatValue();
float itype = itypeAmt.getValue().floatValue();
/* Compute the Haines index */
if (itype == 1) {
a = ((tc2 - tc1) - 3) * (2 / 5) + 1;
b = ((tc1 - dwpc) - 5) * (2 / 5) + 1;
} else if (itype == 2) {
a = ((tc1 - tc2) - 5) * (2 / 6) + 1;
b = ((tc1 - dwpc) - 5) * (2 / 8) + 1;
} else if (itype == 3) {
a = ((tc1 - tc2) - 17) * (2 / 5) + 1;
b = ((tc1 - dwpc) - 14) * (2 / 7) + 1;
}
return new Amount ( psshow, Unit.ONE);
}
/**
* Computes the vertical totals index
* @param t850 - 850 mb temperature ( in Celsius )
* @param t500 - 500 mb temperature ( in Celsius )
* @return the vertical totals index as a difference of the temperature at 850 mb and the temperature at 500 mb, if neither value is missing.
* Else it returns RMISSD (-9999)
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount psVtot ( Amount t850, Amount t500 ) {
if ( ! PRLibrary.checkNullOrInvalidValue(t850 )
|| ! PRLibrary.checkNullOrInvalidValue(t500 ) )
return new Amount ( Unit.ONE );
return new Amount ( t850.getValue().floatValue() - t500.getValue().floatValue() , Unit.ONE );
}
/**
* Computes the total Totals index from the temperature and dewpoint at 850 mb and the temperature at 500 mb
*
* @param t850 - 850 mb temperature ( in Celsius )
* @param td850 - 850 mb dewpoint ( in Celsius )
* @param t500 - 500 mb temperature ( in Celsius )
* @return the total totals index if none of the input parameters are missing and
* RMISSD (-9999) otherwise
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount psTotl ( Amount t850, Amount td850, Amount t500 ) {
float pstotl = GempakConstants.RMISSD;
if ( !PRLibrary.checkNullOrInvalidValue(t500)
|| !PRLibrary.checkNullOrInvalidValue(td850)
|| !PRLibrary.checkNullOrInvalidValue(t850) )
return new Amount ( Unit.ONE );
/*Compute the vertical totals*/
Amount vtot = psVtot ( t850, t500 );
/*Compute the cross totals*/
Amount ctot = psCtot ( td850, t500 );
a = (a > 0.9f ? a : 0.9f);
a = (a < 3.1f ? a : 3.1f);
b = (b > 0.9f ? b : 0.9f);
b = (b < 3.1f ? b : 3.1f);
pshans = new Amount(a + b, Unit.ONE);
// }
return pshans;
}
if ( !PRLibrary.checkNullOrInvalidValue( vtot )
|| ! PRLibrary.checkNullOrInvalidValue( ctot ) )
return new Amount ( Unit.ONE );
pstotl = vtot.getValue().floatValue() + ctot .getValue().floatValue();
/**
*
* Computes the 'K' index
*
* @param t850
* - 850 mb temperature ( in Celsius )
* @param t700
* - 700 mb temperature ( in Celsius )
* @param t500
* - 500 mb temperature ( in Celsius )
* @param td850
* - 850 mb dewpoint ( in Celsius )
* @param td700
* - 700 mb dewpoint ( in Celsius )
* @return returns the 'K' index if all the input values are valid and
* RMISSD ( -9999 ) otherwise
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount pskinx(Amount t850, Amount t700, Amount t500,
Amount td850, Amount td700) {
Amount pskinx = new Amount();
if (!PRLibrary.checkNullOrInvalidValue(t850)
|| !PRLibrary.checkNullOrInvalidValue(t700)
|| !PRLibrary.checkNullOrInvalidValue(t500)
|| !PRLibrary.checkNullOrInvalidValue(td850)
|| !PRLibrary.checkNullOrInvalidValue(td700))
return new Amount(Unit.ONE);
pskinx = new Amount(
(t850.getValue().floatValue() - t500.getValue().floatValue())
+ td850.getValue().floatValue()
- (t700.getValue().floatValue() - td700.getValue()
.floatValue()), Unit.ONE);
return new Amount ( pstotl, Unit.ONE );
}
/**
* Computes the SWEAT index. Winds must be input in m/sec
* @param t850 - 850 mb temperature
* @param td850 - 850 mb dewpoint
* @param t500 - 500 mb temperature
* @param spd850 - 850 mb windspeed ( in m/sec )
* @param spd500 - 500 mb windspeed ( in m/sec )
* @param dir850 - 850 mb wind direction
* @param dir500 - 500 mb wind direction
* @return the SWEAT index if none of the inputs are missing and RMISSD ( -9999 ) otherwise
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount psSwet ( Amount t850, Amount td850, Amount t500,
Amount spd850, Amount spd500,
Amount dir850, Amount dir500 ) {
float pssweat = GempakConstants.RMISSD;
if ( !PRLibrary.checkNullOrInvalidValue( t500 )
|| !PRLibrary.checkNullOrInvalidValue( td850 )
|| !PRLibrary.checkNullOrInvalidValue( t500 )
|| !PRLibrary.checkNullOrInvalidValue( spd850 )
|| !PRLibrary.checkNullOrInvalidValue( spd500 )
|| !PRLibrary.checkNullOrInvalidValue( dir850 )
|| !PRLibrary.checkNullOrInvalidValue( dir500 ) )
return new Amount ( Unit.ONE );
/*
* (Non-Javadoc):
* All computations are from
* Miller, R.C., 1972: Notes on Severe Storm Forecasting Procedures of
* the Air Force Global Weather Central, AWS Tech. Report 200
*/
/*Convert meters per second to knots*/
Amount skt850 = PRLibrary.checkAndConvertInputAmountToExpectedUnits(spd850, NonSI.KNOT) ;
Amount skt500 = PRLibrary.checkAndConvertInputAmountToExpectedUnits(spd500, NonSI.KNOT) ;
/* Compute the total totals index. If < 49, set term to zero.*/
float total = psTotl ( t850, td850, t500 ).getValue().floatValue();
float term2 = total - 49;
if ( total < 49 )
term2 = 0;
/* Compute shear term.*/
float dif = dir500.getValue().floatValue() - dir850.getValue().floatValue();
float s = ( float ) ( Math.sin ( dif * GempakConstants.DTR ) );
float shear = 125 * ( s + 0.2f );
/*Make various wind checks.*/
float dir850Val = dir850.getValue().floatValue();
float dir500Val = dir500.getValue().floatValue();
float skt500Val = skt500.getValue().floatValue();
float skt850Val = skt850.getValue().floatValue();
if ((dir850Val < 130.) || (dir850Val > 250.))
shear = 0;
if ((dir500Val < 210.) || (dir500Val > 310.))
shear = 0;
if ((skt500Val < 15.) || (skt850Val < 15. ))
shear = 0;
if (dif <= 0)
shear = 0;
/*Check for sub-zero dewpoint*/
float dwp850 = td850.getValue().floatValue();
if ( dwp850 < 0 )
dwp850 = 0;
/*Calculate SWEAT index*/
pssweat = 12 * dwp850 + 20 * term2 + 2 * skt850Val + skt500Val + shear;
return new Amount ( pssweat , Unit.ONE);
}
/**
* Finds the most unstable level of a sounding from the surface to the input pressure level.
* @param listOfNcSoundingLayer - the list of NcSoundingLayer to search
* @param plev - input pressure level
* @return the most unstable level of a sounding from the surface to the input pressure level (plev),
* if plev is not -1 and all computations fall through correctly.Else it returns an empty NcSoundingLayer object
* @throws Exception
*/
public static NcSoundingLayer2 psUstb(List<NcSoundingLayer2> listOfNcSoundingLayer, PressureLevel plev ) throws Exception{
//TODO: update to find pressure value between 2 levels
NcSoundingLayer2 outputNcSoundingLayer = new NcSoundingLayer2();
class PressureComparator implements Comparator < NcSoundingLayer2>{
public int compare(NcSoundingLayer2 n1, NcSoundingLayer2 n2){
return Float.compare(n2.getPressure().getValue().floatValue(), n1.getPressure().getValue().floatValue());
}
}
if ( listOfNcSoundingLayer != null && listOfNcSoundingLayer.size() > 0 ){
if ( listOfNcSoundingLayer.size() > 1 )
Collections.sort(listOfNcSoundingLayer, new PressureComparator() );
NcSoundingLayer2 surfaceLevelNcSoundingLayer = listOfNcSoundingLayer.get( 0 );
PressureLevel pressureAtSurfaceLevel = surfaceLevelNcSoundingLayer.getPressure();
NcSoundingLayer2 topLevelNcSoundingLayer = PCLibrary.pcFtop( listOfNcSoundingLayer );
PressureLevel pressureAtTopLevel = topLevelNcSoundingLayer.getPressure();
float plevVal = plev.getValue().floatValue();
float presAtSurfaceLevelValue = pressureAtSurfaceLevel.getValue().floatValue();
float presAtTopLevelVal = pressureAtTopLevel.getValue().floatValue();
if( plevVal > presAtSurfaceLevelValue)
return outputNcSoundingLayer;
else if ( plevVal == -1 || plevVal <= presAtTopLevelVal )
plev = pressureAtTopLevel;
return pskinx;
}
/**
* Computes the Showalter index
*
* @param t850
* - 850 mb temperature ( in Celsius )
* @param td850
* - 850 mb dewpoint ( in Celsius )
* @param t500
* - 500 mb temperature ( in Celsius )
* @return the Showalter index if all the three input parameters are valid
* and the parcel temperature is computed correctly. Otherwise, it
* returns RMISSD (-9999).
*/
public final static Amount psShow(Amount t850Amt, Amount td850Amt,
Amount t500Amt) {
float psshow = GempakConstants.RMISSD;
if (!PRLibrary.checkNullOrInvalidValue(t850Amt)
|| !PRLibrary.checkNullOrInvalidValue(td850Amt)
|| !PRLibrary.checkNullOrInvalidValue(t500Amt))
return new Amount(Unit.ONE);
float p850 = 850;
float p500 = 500;
float guess = 0;
/*
* Find equivalent potential temperature at the LCL using 850 mb
* temperature and dewpoint.
*/
Amount thtlcl = PRLibrary.prThte(new Amount(p850, NcUnits.MILLIBAR),
t850Amt, td850Amt);
if (!PRLibrary.checkNullOrInvalidValue(thtlcl))
return new Amount(Unit.ONE);
/*
* Find parcel temperature along pseudoadiabat at 500 mb. The parcel
* temperature tp is the temperature in Celsius at 500 mb of a parcel,
* which lies on the moist adiabat determined by the sounding at 850 mb
*/
Amount tp = PRLibrary.prTmst(thtlcl,
new Amount(p500, NcUnits.MILLIBAR), new Amount(0, Unit.ONE));
/*
* Subtract the parcel temperature from the temperature at 500 mb, is
* the parcel temperature is valid
*/
if (!PRLibrary.checkNullOrInvalidValue(tp))
return new Amount(Unit.ONE);
t500Amt = PRLibrary.checkAndConvertInputAmountToExpectedUnits(t500Amt,
SI.KELVIN);
float t500 = t500Amt.getValue().floatValue();
psshow = t500 - tp.getValue().floatValue();
return new Amount(psshow, Unit.ONE);
}
/**
* Computes the vertical totals index
*
* @param t850
* - 850 mb temperature ( in Celsius )
* @param t500
* - 500 mb temperature ( in Celsius )
* @return the vertical totals index as a difference of the temperature at
* 850 mb and the temperature at 500 mb, if neither value is
* missing. Else it returns RMISSD (-9999)
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount psVtot(Amount t850, Amount t500) {
if (!PRLibrary.checkNullOrInvalidValue(t850)
|| !PRLibrary.checkNullOrInvalidValue(t500))
return new Amount(Unit.ONE);
return new Amount(t850.getValue().floatValue()
- t500.getValue().floatValue(), Unit.ONE);
}
/**
* Computes the total Totals index from the temperature and dewpoint at 850
* mb and the temperature at 500 mb
*
* @param t850
* - 850 mb temperature ( in Celsius )
* @param td850
* - 850 mb dewpoint ( in Celsius )
* @param t500
* - 500 mb temperature ( in Celsius )
* @return the total totals index if none of the input parameters are
* missing and RMISSD (-9999) otherwise
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount psTotl(Amount t850, Amount td850, Amount t500) {
float pstotl = GempakConstants.RMISSD;
if (!PRLibrary.checkNullOrInvalidValue(t500)
|| !PRLibrary.checkNullOrInvalidValue(td850)
|| !PRLibrary.checkNullOrInvalidValue(t850))
return new Amount(Unit.ONE);
/* Compute the vertical totals */
Amount vtot = psVtot(t850, t500);
/* Compute the cross totals */
Amount ctot = psCtot(td850, t500);
if (!PRLibrary.checkNullOrInvalidValue(vtot)
|| !PRLibrary.checkNullOrInvalidValue(ctot))
return new Amount(Unit.ONE);
pstotl = vtot.getValue().floatValue() + ctot.getValue().floatValue();
return new Amount(pstotl, Unit.ONE);
}
/**
* Computes the SWEAT index. Winds must be input in m/sec
*
* @param t850
* - 850 mb temperature
* @param td850
* - 850 mb dewpoint
* @param t500
* - 500 mb temperature
* @param spd850
* - 850 mb windspeed ( in m/sec )
* @param spd500
* - 500 mb windspeed ( in m/sec )
* @param dir850
* - 850 mb wind direction
* @param dir500
* - 500 mb wind direction
* @return the SWEAT index if none of the inputs are missing and RMISSD (
* -9999 ) otherwise
* @throws InvalidValueException
* @throws NullPointerException
*/
public final static Amount psSwet(Amount t850, Amount td850, Amount t500,
Amount spd850, Amount spd500, Amount dir850, Amount dir500) {
float pssweat = GempakConstants.RMISSD;
if (!PRLibrary.checkNullOrInvalidValue(t500)
|| !PRLibrary.checkNullOrInvalidValue(td850)
|| !PRLibrary.checkNullOrInvalidValue(t500)
|| !PRLibrary.checkNullOrInvalidValue(spd850)
|| !PRLibrary.checkNullOrInvalidValue(spd500)
|| !PRLibrary.checkNullOrInvalidValue(dir850)
|| !PRLibrary.checkNullOrInvalidValue(dir500))
return new Amount(Unit.ONE);
/*
* (Non-Javadoc): All computations are from Miller, R.C., 1972: Notes on
* Severe Storm Forecasting Procedures of the Air Force Global Weather
* Central, AWS Tech. Report 200
*/
/* Convert meters per second to knots */
Amount skt850 = PRLibrary.checkAndConvertInputAmountToExpectedUnits(
spd850, NonSI.KNOT);
Amount skt500 = PRLibrary.checkAndConvertInputAmountToExpectedUnits(
spd500, NonSI.KNOT);
/* Compute the total totals index. If < 49, set term to zero. */
float total = psTotl(t850, td850, t500).getValue().floatValue();
float term2 = total - 49;
if (total < 49)
term2 = 0;
/* Compute shear term. */
float dif = dir500.getValue().floatValue()
- dir850.getValue().floatValue();
float s = (float) (Math.sin(dif * GempakConstants.DTR));
float shear = 125 * (s + 0.2f);
/* Make various wind checks. */
float dir850Val = dir850.getValue().floatValue();
float dir500Val = dir500.getValue().floatValue();
float skt500Val = skt500.getValue().floatValue();
float skt850Val = skt850.getValue().floatValue();
if ((dir850Val < 130.) || (dir850Val > 250.))
shear = 0;
if ((dir500Val < 210.) || (dir500Val > 310.))
shear = 0;
if ((skt500Val < 15.) || (skt850Val < 15.))
shear = 0;
if (dif <= 0)
shear = 0;
/* Check for sub-zero dewpoint */
float dwp850 = td850.getValue().floatValue();
if (dwp850 < 0)
dwp850 = 0;
/* Calculate SWEAT index */
pssweat = 12 * dwp850 + 20 * term2 + 2 * skt850Val + skt500Val + shear;
return new Amount(pssweat, Unit.ONE);
}
/**
* Finds the most unstable level of a sounding from the surface to the input
* pressure level.
*
* @param listOfNcSoundingLayer
* - the list of NcSoundingLayer to search
* @param plev
* - input pressure level
* @return the most unstable level of a sounding from the surface to the
* input pressure level (plev), if plev is not -1 and all
* computations fall through correctly.Else it returns an empty
* NcSoundingLayer object
* @throws Exception
*/
public static NcSoundingLayer2 psUstb(
List<NcSoundingLayer2> listOfNcSoundingLayer, PressureLevel plev)
throws Exception {
// System.out.println(" PSLibrary/psUstb !!!!!!!!! ");
// TODO: update to find pressure value between 2 levels
NcSoundingLayer2 outputNcSoundingLayer = new NcSoundingLayer2();
class PressureComparator implements Comparator<NcSoundingLayer2> {
public int compare(NcSoundingLayer2 n1, NcSoundingLayer2 n2) {
return Float.compare(n2.getPressure().getValue().floatValue(),
n1.getPressure().getValue().floatValue());
}
}
// System.out.println(" PSLibrary/psUstb 1 ");
if (listOfNcSoundingLayer != null && listOfNcSoundingLayer.size() > 0) {
if (listOfNcSoundingLayer.size() > 1)
Collections.sort(listOfNcSoundingLayer,
new PressureComparator());
// System.out.println(" PSLibrary/psUstb 2 ");
NcSoundingLayer2 surfaceLevelNcSoundingLayer = listOfNcSoundingLayer
.get(0);
PressureLevel pressureAtSurfaceLevel = surfaceLevelNcSoundingLayer
.getPressure();
NcSoundingLayer2 topLevelNcSoundingLayer = PCLibrary
.pcFtop(listOfNcSoundingLayer);
PressureLevel pressureAtTopLevel = topLevelNcSoundingLayer
.getPressure();
float plevVal = plev.getValue().floatValue();
float presAtSurfaceLevelValue = pressureAtSurfaceLevel.getValue()
.floatValue();
float presAtTopLevelVal = pressureAtTopLevel.getValue()
.floatValue();
if (plevVal > presAtSurfaceLevelValue)
return outputNcSoundingLayer;
else if (plevVal == -1 || plevVal <= presAtTopLevelVal)
plev = pressureAtTopLevel;
// System.out.println(" PSLibrary/psUstb 3 ");
int sizeOfList = listOfNcSoundingLayer.size();
boolean done = false;
int lev = 0;
float eps = GempakConstants.RMISSD;
while (!done && lev < sizeOfList) {
NcSoundingLayer2 currNcSoundingLayer = listOfNcSoundingLayer
.get(lev);
// System.out.println(" PSLibrary/psUstb 4 ");
Amount pressure = new Amount(currNcSoundingLayer.getPressure()
.getValue(), NcUnits.MILLIBAR);
Amount tmpc = new Amount(currNcSoundingLayer.getTemperature()
.getValue(), SI.CELSIUS);
Amount dwpc = new Amount(currNcSoundingLayer.getDewpoint()
.getValue(), SI.CELSIUS);
if (pressure.hasValidValue() && tmpc.hasValidValue()
&& dwpc.hasValidValue()) {
WetBulbPotentialTemp thwc = new WetBulbPotentialTemp();
// System.out.println(" PSLibrary/thwc " +
// thwc.doubleValue()
// + " pressure " + pressure.doubleValue() + " tmpc "
// + tmpc.doubleValue() + " dwpc "
// + dwpc.doubleValue());
thwc.setValue(PRLibrary.prThwc(pressure, tmpc, dwpc));
if (thwc.getValue().floatValue() > eps
&& (pressure.getValue().floatValue() >= plevVal)) {
eps = thwc.getValue().floatValue();
outputNcSoundingLayer.setPressure(currNcSoundingLayer
.getPressure());
outputNcSoundingLayer
.setTemperature(currNcSoundingLayer
.getTemperature());
outputNcSoundingLayer.setDewpoint(currNcSoundingLayer
.getDewpoint());
outputNcSoundingLayer.setWindSpeed(currNcSoundingLayer
.getWindSpeed());
outputNcSoundingLayer
.setWindDirection(currNcSoundingLayer
.getWindDirection());
outputNcSoundingLayer.setWindU(currNcSoundingLayer
.getWindU());
outputNcSoundingLayer.setWindV(currNcSoundingLayer
.getWindV());
outputNcSoundingLayer.setGeoHeight(currNcSoundingLayer
.getGeoHeight());
outputNcSoundingLayer.setOmega(currNcSoundingLayer
.getOmega());
outputNcSoundingLayer
.setSpecificHumidity(currNcSoundingLayer
.getSpecificHumidity());
// System.out.println("Outdat: "
// + outputNcSoundingLayer.getPressure().getValueAs(
// NcUnits.MILLIBAR ).floatValue() + " "
// + outputNcSoundingLayer.getTemperature().getValueAs(
// SI.CELSIUS ).floatValue() + " "
// + outputNcSoundingLayer.getDewpoint().getValueAs(
// SI.CELSIUS ).floatValue() + " "
// + outputNcSoundingLayer.getWindSpeed().getValueAs(
// SI.METERS_PER_SECOND ).floatValue() + " "
// +
// outputNcSoundingLayer.getWindDirection().getValueAs(
// NonSI.DEGREE_ANGLE ).floatValue() + " "
// + outputNcSoundingLayer.getGeoHeight().getValueAs(
// SI.METER ).floatValue() );
}
}
// System.out.println("Pressure value is " +
// pressure.getValue().floatValue() + " " +
// pressure.getUnit().toString() );
// System.out.println("lev is " + lev );
lev++;
if (pressure.hasValidValue()
&& pressure.getValue().floatValue() <= plevVal) {
done = true;
break;
}
}
}
//System.out.println("PSLibrary/psUstb Outdat: "
// + outputNcSoundingLayer.getPressure().getValue().floatValue()
// + " "
// + outputNcSoundingLayer.getTemperature().getValue()
// .floatValue()
// + " "
// + outputNcSoundingLayer.getDewpoint().getValue().floatValue()
// + " "
// + outputNcSoundingLayer.getWindSpeed().getValue().floatValue()
// + " "
// + outputNcSoundingLayer.getWindDirection().getValue()
// .floatValue() + " "
// + outputNcSoundingLayer.getGeoHeight().getValue().floatValue());
return outputNcSoundingLayer;
}
int sizeOfList = listOfNcSoundingLayer.size();
boolean done = false;
int lev = 0;
float eps = GempakConstants.RMISSD;
while ( !done && lev < sizeOfList){
NcSoundingLayer2 currNcSoundingLayer = listOfNcSoundingLayer.get( lev );
Amount pressure = new Amount ( currNcSoundingLayer.getPressure().getValue(), NcUnits.MILLIBAR );
Amount tmpc = new Amount ( currNcSoundingLayer.getTemperature().getValue(), SI.CELSIUS );
Amount dwpc = new Amount ( currNcSoundingLayer.getDewpoint().getValue(), SI.CELSIUS );
if ( pressure.hasValidValue() && tmpc.hasValidValue() && dwpc.hasValidValue() ){
WetBulbPotentialTemp thwc = new WetBulbPotentialTemp();
thwc.setValue( PRLibrary.prThwc ( pressure, tmpc, dwpc ) );
if ( thwc.getValue().floatValue() > eps && ( pressure.getValue().floatValue() >= plevVal ) ){
eps = thwc.getValue().floatValue();
outputNcSoundingLayer.setPressure( currNcSoundingLayer.getPressure() );
outputNcSoundingLayer.setTemperature( currNcSoundingLayer.getTemperature() );
outputNcSoundingLayer.setDewpoint( currNcSoundingLayer.getDewpoint() );
outputNcSoundingLayer.setWindSpeed( currNcSoundingLayer.getWindSpeed() );
outputNcSoundingLayer.setWindDirection( currNcSoundingLayer.getWindDirection() );
outputNcSoundingLayer.setWindU( currNcSoundingLayer.getWindU() );
outputNcSoundingLayer.setWindV( currNcSoundingLayer.getWindV() );
outputNcSoundingLayer.setGeoHeight( currNcSoundingLayer.getGeoHeight() );
outputNcSoundingLayer.setOmega( currNcSoundingLayer.getOmega() );
outputNcSoundingLayer.setSpecificHumidity( currNcSoundingLayer.getSpecificHumidity() );
// System.out.println("Outdat: "
// + outputNcSoundingLayer.getPressure().getValueAs( NcUnits.MILLIBAR ).floatValue() + " "
// + outputNcSoundingLayer.getTemperature().getValueAs( SI.CELSIUS ).floatValue() + " "
// + outputNcSoundingLayer.getDewpoint().getValueAs( SI.CELSIUS ).floatValue() + " "
// + outputNcSoundingLayer.getWindSpeed().getValueAs( SI.METERS_PER_SECOND ).floatValue() + " "
// + outputNcSoundingLayer.getWindDirection().getValueAs( NonSI.DEGREE_ANGLE ).floatValue() + " "
// + outputNcSoundingLayer.getGeoHeight().getValueAs( SI.METER ).floatValue() );
}
}
// System.out.println("Pressure value is " + pressure.getValue().floatValue() + " " + pressure.getUnit().toString() );
// System.out.println("lev is " + lev );
lev++;
if ( pressure.hasValidValue() && pressure.getValue().floatValue() <= plevVal ){
done = true;
break;
}
}
}
System.out.println("From PS_USTB Outdat: "
+ outputNcSoundingLayer.getPressure().getValue().floatValue() + " "
+ outputNcSoundingLayer.getTemperature().getValue().floatValue() + " "
+ outputNcSoundingLayer.getDewpoint().getValue().floatValue() + " "
+ outputNcSoundingLayer.getWindSpeed().getValue().floatValue() + " "
+ outputNcSoundingLayer.getWindDirection().getValue().floatValue() + " "
+ outputNcSoundingLayer.getGeoHeight().getValue().floatValue() );
return outputNcSoundingLayer;
}
}

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<NcInventoryDefinition xmlns:ns2="group" xmlns:ns3="http://www.example.org/productType">
<inventoryName>QSCT</inventoryName>
<inventoryParameters>pluginName,dataTime</inventoryParameters>
<baseConstraints>
<mapping key="reportType">
<constraint constraintValue="quikscat%" constraintType="LIKE"/>
</mapping>
<mapping key="pluginName">
<constraint constraintValue="ncscat" constraintType="EQUALS"/>
</mapping>
</baseConstraints>
</NcInventoryDefinition>

View file

@ -18,6 +18,7 @@ import com.raytheon.edex.plugin.AbstractDecoder;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.edex.decodertools.core.DecoderTools;
import com.raytheon.uf.edex.decodertools.time.TimeTools;
/**
@ -261,7 +262,10 @@ public class McidasDecoder extends AbstractDecoder {
record.setAreaName(areaName);
String fileName = "";
if (headers != null) {
fileName = (String) headers.get("traceId");
// fileName = (String) headers.get("traceId");
File ingestFile = new File(
(String) headers.get(DecoderTools.INGEST_FILE_NAME));
fileName = ingestFile.getName();
}
record.setInputFileName(fileName);

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<requestPatterns xmlns:ns2="group">
<regex>^MANUAL INGEST.*</regex>
<regex>^MOSAIC.*</regex>
</requestPatterns>

View file

@ -2,6 +2,10 @@
<ncgribModelNameMap>
<mapping>
<entry>
<key>ecavg_.*</key>
<value>ecensDerv</value>
</entry>
<entry>
<key>gens_cmce.*_cmc_geavg.*</key>
<value>cmceDerv</value>
@ -219,4 +223,4 @@
<value>sref40Derv</value>
</entry>
</mapping>
</ncgribModelNameMap>
</ncgribModelNameMap>

View file

@ -15,7 +15,7 @@
<bean id="ncscatDistRegistry" factory-bean="distributionSrv"
factory-method="register">
<constructor-arg value="ncscat" />
<constructor-arg value="jms-dist:queue:Ingest.ncscat" />
<constructor-arg value="jms-dist:queue:Ingest.Ncscat" />
</bean>
<bean id="ncscatCamelRegistered" factory-bean="contextManager"

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<requestPatterns xmlns:ns2="group">
<regex>^NCSCAT.*</regex>
</requestPatterns>

View file

@ -13,7 +13,7 @@
<bean id="ntransDistRegistry" factory-bean="distributionSrv"
factory-method="register">
<constructor-arg value="ntrans" />
<constructor-arg value="jms-dist:queue:Ingest.ntrans" />
<constructor-arg value="jms-dist:queue:Ingest.Ntrans" />
</bean>
<bean id="ntransCamelRegistered" factory-bean="contextManager"

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<requestPatterns xmlns:ns2="group">
<regex>^NTRANS.*</regex>
</requestPatterns>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<requestPatterns xmlns:ns2="group">
<regex>^SXI_*</regex>
<regex>^SIMPLE*</regex>
</requestPatterns>

View file

@ -1,191 +0,0 @@
ADDSTN YES
AFOSFL
AIRM
ANOTLN
ANOTYP
AWPSFL
ANLYSS 4/2;2;2;2
AREA @dca;iad;bwi
ATCF
BORDER 1
BOXLIN
BUFRFIL
CENTER
CINT 0
CLEAR YES
CLRBAR
CNTRFL
COLORS 1
COLUMN 1
CONTUR 0
CPYFIL
CSIG
CTLFLG YES
CTYPE C
CURVE 2
CXSTNS
DATTIM 18-20
DELTAN
DELTAX
DELTAY
DEVICE XW
DTAAREA
EDGEOPTS
ENCY
EXTEND 2;2;2;2
FHOUR
FILTER YES
FINT 0
FLINE 10-20
FXYTBL
GAMMA 0.3
GAREA WV
IJSKIP
GBDIAG
GBFILE
GBTBLS
GDATTIM LAST
GDEFIL GDLIST.FIL
GDFILE $GEMDATA/HRCBOB.GRD
GDNUM LIST
GDOUTF
GDPFUN TMPC
GFUNC TMPC
GGLIMS
GGVGF
GLEVEL 500
GPACK
GPOINT IAD
GRDAREA
GRDHDR
GRDLBL 0
GRDNAM
GRDTYP S
GSKIP
GUESS
GUESFUN
GVCORD PRES
GVECT WND
G2DIAG
G2DRT
G2IDS
G2IS
G2PDT
G2TBLS
HILO
HISTGRD NO
HLSYM
HRCN
IDNTYP STID
IMCBAR
INDXFL
INFO
ISIG
KXKY 10;10
LAT
LATLON
LEVELS 500
LINE 3
LOCI
LON
LSTALL YES
LSTPRM
LTNG
LUTFIL
MAP 1
$MAPFIL HIPOWO.CIA
MARKER 0
MAXGRD 200
MIXRLN 0
MSCALE 0
MRGDAT YES
NCON
NPASS 2
NTRACE 5
OUTFIL
OUTPUT t
OVERWR NO
PANEL 0
PDSEXT NO
PIXRES 1
PLUS
POSN 0
PRBTYP
PROJ MER
PTYPE LOG
QCNTL
QSCT
RADFIL
REGION VIEW
REFVEC
$RESPONDYES
SATFIL
FAXFIL
SAVFIL
SCALE 999
SEARCH 20
SFEFIL SFLIST.FIL
SFFILE /export-2/cdbbkp/ldmcdb/data/decoders/hrly/20110530.hrly
SFFSRC
SFOUTF
SFPARM dset
SFPRMF METAR.PACK
SHAPE
SHIPFL NO
SHRTTL
SKIP 0
SKPMIS y
SNBUFR
SNEFIL SNLIST.FIL
SNFILE $GEMDATA/HRCBOB.SND
SNOUTF
SNPARM ;TMPC;;HGHT;DWPC;BRBM
SNPRMF SNMERG.PACK
SOURCE SF
STATION BWI
STNCOL 1
STNDEX SHOW
STNFIL SFSTNS.TBL
STNPLT
STNTYP A
STREAM
STRMID
SVRL
TAXIS
TCMG
TEXT 1
THTALN 0
THTELN 0
TIMSTN 1/0
TITLE 1
TRACE1 TMPF;DWPF:3/2;3
TRACE2 PMSL/4
TRACE3 SKNT;GUST;DARR/1
TRACE4 VSBY/7
TRACE5 CLDS;;WSYM/6
TRAK1
TRAK2
TRAKE
TXTCOL
TXTFIL
TXTLOC
TXTYPE
TYPE C
UKAFIL
VCOORD PRES
VGFILE
WARN
WATCH
WIND BM1
WINPOS 1
WSTM
XAXIS
YAXIS
WOU
WCN
WCP
WSAT
FHR
TAG
STAT
ASCT

View file

@ -1,7 +0,0 @@
SFFILE /export-2/cdbbkp/ldmcdb/data/decoders/hrly/20110530.hrly
AREA @dca;iad;bwi
DATTIM 18-20
OUTPUT t
SKPMIS y
IDNTYP STID
SFPARM dset

View file

@ -259,6 +259,9 @@ public class FINT {
public static List<Double> parseFINT(String fint, int zoomLevelIndex, float minValue, float maxValue) {
if (fint.equals("0"))
fint = "";
List<Double> fvalues = null;
Double fmin = new Double(minValue);
Double fmax = new Double(maxValue);

View file

@ -8,7 +8,7 @@ package gov.noaa.nws.ncep.gempak.parameters.intext;
* TEXT is the size, font, text width and hardware/software flag for
* graphics text separated with slashes:
*
* text size / font / width / hw flag
* text size / font / width/ border / rotation / justification / / hw flag
*
* The size may be a real number multiplier for the default text
* size. If the size is zero or unspecified, the current size
@ -107,11 +107,12 @@ package gov.noaa.nws.ncep.gempak.parameters.intext;
* ------------ ---------- ----------- --------------------------
* Nov 30,2010 363 X. Guo Initial Creation
* Dec 06,2010 X. Guo Add symbol size
* Sep 09, 2013 1036 S. Gurung Added border, justification, rotation and textStyle
*
* </pre>
* @author xguo
* @version 1
* @see $GEMPAK/help/hlx/txt.hl2 */
* @see $GEMPAK/help/hlx/text.hl2 */
public class TextStringParser {
@ -131,7 +132,19 @@ public class TextStringParser {
private int width;
//Text HW flag
private String hwflg;
private String hwflg;
//Text border
private int border;
//Text justification
private char justification;
//Text rotation
private char rotation;
//Text style (normal/bold/italic)
private int textStyle;
//Parse Flag
private boolean isTextStringParsed;
@ -139,6 +152,18 @@ public class TextStringParser {
//expression
private String textExpre = "((-|\\+)?[0-9]+(\\.[0-9]+)?)+";
//font expression
private String fontExpre = "[1-3]+";
//border expression
private String borderExpre = "[1-2][1-3][1]";
//rotation expression
private String rotExpre = "s|n|S|N";
//justification expression
private String justExpre = "c|C|r|R|l|L";
/**
* The default constructor <code>HILOStringParser</code> generates a single
**/
@ -184,7 +209,7 @@ public class TextStringParser {
String textStr = txtStr + "/";
/*
* check and see if the input string with 4 strings separated by slashes
* check and see if the input string with 4 or 7 strings separated by slashes
*/
while (( pos = textStr.indexOf("/", start)) >= 0 ) {
if ( pos != start ) {
@ -198,8 +223,14 @@ public class TextStringParser {
}
}
else if ( cnt == 1 ) { //parse font
if ( tmp.matches(textExpre) ) {
setTextFont (checkFontSize(Integer.valueOf(tmp)));
if ( tmp.matches(fontExpre) ) {
if (tmp.length()==1){
setTextFont (checkFontSize(Integer.valueOf(tmp)));
}
else {
setTextFont (checkFontSize(Integer.valueOf(tmp.substring(1,2))));
setTextStyle(Integer.valueOf(tmp.substring(0,1)));
}
}
else {
setTextFont (1);
@ -207,13 +238,31 @@ public class TextStringParser {
}
else if ( cnt == 2 ) { //parse width
if ( tmp.matches(textExpre) ) {
setTextWidth (Integer.valueOf(tmp));
setTextWidth (Math.round(Float.valueOf(tmp)));
}
else {
setTextWidth (2);
}
}
else if ( cnt == 3 ) { // parse hw flag
else if (cnt == 3 && (tmp.equalsIgnoreCase("HW") || tmp.equalsIgnoreCase("SW"))) { // parse hw flag for HLSYM
setTextHWFlag (tmp);
}
else if ( cnt == 3 ) { // parse border
if ( tmp.matches(borderExpre) && tmp.length() == 3) {
setTextBorder (Integer.valueOf(tmp));
}
}
else if ( cnt == 4 ) { // parse rotation
if ( tmp.matches(rotExpre) && tmp.length() == 1) {
setTextRotation (tmp.toUpperCase().charAt(0));
}
}
else if ( cnt == 5 ) { // parse justification
if ( tmp.matches(justExpre) && tmp.length() == 1) {
setTextJustification (tmp.toUpperCase().charAt(0));
}
}
else if ( cnt == 6 ) { // parse hw flag
setTextHWFlag (tmp);
}
else {
@ -236,6 +285,10 @@ public class TextStringParser {
font = 1;
width = 2;
hwflg = "HW";
border = 000;
rotation = 'S';
justification = 'C';
textStyle = 0;
}
/**
@ -307,6 +360,51 @@ public class TextStringParser {
public String getTextHWFlag () {
return hwflg;
}
/**
* Set Text border
*/
private void setTextBorder ( int border ) {
this.border = border;
}
/**
* Get Text border
*/
public int getTextBorder () {
return border;
}
/**
* Set Text justification
*/
private void setTextJustification ( char justification ) {
this.justification = justification;
}
/**
* Get Text justification
*/
public char getTextJustification () {
return justification;
}
/**
* Set Text rotation
*/
private void setTextRotation ( char rotation ) {
this.rotation = rotation;
}
/**
* Get Text rotation
*/
public char getTextRotation () {
return rotation;
}
/**
* Get parse status
*/
@ -319,7 +417,27 @@ public class TextStringParser {
*/
public String getInputTextString () {
return inputTxtStr;
}
/**
* Get textStyle
*
* 0 Normal
* 1 Italic
* 2 Bold
* 3 Italic-Bold
*/
public int getTextStyle() {
return textStyle;
}
/**
* Set textStyle
*/
public void setTextStyle(int textStyle) {
this.textStyle = textStyle;
}
/**
* Convert size name to CAVE number
* Name GEMPAK Size CAVE Size
@ -338,8 +456,7 @@ public class TextStringParser {
float [] range = {0.714f, 0.857f, 1.000f, 1.286f, 1.714f, 2.429f };
String [] name = {"TINY","SMALL","MEDIUM","LARGE","HUGE","GIANT"};
for ( int i = 0; i < fontsize.length-1; i ++ ) {
for ( int i = 0; i <= fontsize.length-1; i ++ ) {
String txtName1 = textName.substring(0, 1);
String name1 = name[i].substring(0, 1);
if ( textName.toUpperCase().compareTo(name[i]) == 0 ||
@ -369,9 +486,33 @@ public class TextStringParser {
int sizev = 14;
int [] fontsize = {10, 12, 14, 18, 24, 34 };
float [] range = {0.714f, 0.857f, 1.000f, 1.286f, 1.714f, 2.429f };
int len = range.length;
int len = range.length;
if ( value <= range[len-1] ) {
for ( int i = 0; i < len-1; i ++ ) {
if ( value <= range[len-1] ) {
if ( ( range[i] <= value ) && ( value <= range[i+1]) ) {
if ( ( value - range[i] ) <= ( range[i+1] - value ) ) {
sizev = fontsize[i] ;
sizes = range[i] ;
}
else {
sizev = fontsize[i+1] ;
sizes = range[i+1] ;
}
break;
}
} else if (value == fontsize[i]) {
sizev = fontsize[i];
sizes = range[i];
break;
} else {
sizev = fontsize[len-1] ;
sizes = range[len-1] ;
}
}
/*if ( value <= range[len-1] ) {
for ( int i = 0; i < len-1; i ++ ) {
if ( ( range[i] <= value ) && ( value <= range[i+1]) ) {
if ( ( value - range[i] ) <= ( range[i+1] - value ) ) {
@ -389,7 +530,7 @@ public class TextStringParser {
else {
sizev = fontsize[len-1] ;
sizes = range[len-1] ;
}
}*/
setTextSize (sizev );
setSymbolMarkerSize (sizes);
}

View file

@ -126,9 +126,8 @@ void mean_wind(float pbot, float ptop, float *mnu, float *mnv,
/* mnv - V-Component of mean wind (kt) */
/*************************************************************/
{
float pinc, usum, vsum, wgt, w1, num, p, ix1;
float pinc, usum, vsum, wgt, w1, num, i, ix1, p;
float sfctemp, sfcdwpt, sfcpres, lower, upper;
int i;
Parcel pcl;
*wdir = RMISSD;
@ -169,7 +168,7 @@ void mean_wind(float pbot, float ptop, float *mnu, float *mnv,
else {
num = wgt = usum = vsum = 0;
p = pbot;
for (i = 0; i <= 20; i++) {
for (i=0;i<=20;i++) {
w1 = p;
usum = usum + (i_wndu(p, I_PRES) * w1);
vsum = vsum + (i_wndv(p, I_PRES) * w1);
@ -204,9 +203,8 @@ void mean_wind_npw(float pbot, float ptop, float *mnu, float *mnv,
/* mnv - V-Component of mean wind (kt) */
/*************************************************************/
{
float pinc, usum, vsum, wgt, w1, num, p, ix1;
float pinc, usum, vsum, wgt, w1, num, i, ix1;
float sfctemp, sfcdwpt, sfcpres, lower, upper;
int i;
Parcel pcl;
*wdir = RMISSD;
@ -246,19 +244,17 @@ void mean_wind_npw(float pbot, float ptop, float *mnu, float *mnv,
}
else {
num = wgt = usum = vsum = 0;
p = pbot;
for (i = 0; i <= 20; i++) {
w1 = p;
usum = usum + i_wndu(p, I_PRES);
vsum = vsum + i_wndv(p, I_PRES);
p -= pinc;
wgt = wgt + w1;
for (i = pbot; i >= ptop; i -= pinc) {
w1 = 1;
usum = usum + i_wndu(i, I_PRES);
vsum = vsum + i_wndv(i, I_PRES);
//wgt = wgt + w1;
num++;
}
}
*mnu = (usum / wgt);
*mnv = (vsum / wgt);
*mnu = (usum / num);
*mnv = (vsum / num);
if (qc(*mnu) && qc(*mnv)) {
*wdir = angle(*mnu, *mnv);
@ -283,9 +279,8 @@ void sr_wind(float pbot, float ptop, float stdir, float stspd,
/* mnv - V-Component of mean wind (kt) */
/*************************************************************/
{
float pinc, usum, vsum, wgt, w1, num, ix1, stu, stv, p;
float pinc, usum, vsum, wgt, w1, num, i, ix1, stu, stv;
short idx;
int i;
/* ----- Calculate Storm motion vectors ----- */
stu = ucomp(stdir, stspd);
@ -312,16 +307,20 @@ void sr_wind(float pbot, float ptop, float stdir, float stspd,
((i_wndu(ptop, I_PRES) - stu) * ptop);
vsum = ((i_wndv(pbot, I_PRES) - stv) * pbot) +
((i_wndv(ptop, I_PRES) - stv) * ptop);
/*usum = ((ucomp(i_wdir(pbot, I_PRES), i_wspd(pbot, I_PRES)) - stu) * pbot) +
((ucomp(i_wdir(ptop, I_PRES), i_wspd(ptop, I_PRES)) - stu) * ptop);
vsum = ((vcomp(i_wdir(pbot, I_PRES), i_wspd(pbot, I_PRES)) - stv) * pbot) +
((vcomp(i_wdir(ptop, I_PRES), i_wspd(ptop, I_PRES)) - stv) * ptop);*/
wgt = pbot + ptop;
}
else {
num = wgt = usum = vsum = 0;
p = pbot;
for (i = 0; i <= 20 ; i++) {
w1 = p;
usum = usum + ((i_wndu(p, I_PRES) - stu) * w1);
vsum = vsum + ((i_wndv(p, I_PRES) - stv) * w1);
p -= pinc;
for (i = pbot; i >= ptop; i -= pinc) {
w1 = i;
usum = usum + ((i_wndu(i, I_PRES) - stu) * w1);
vsum = vsum + ((i_wndv(i, I_PRES) - stv) * w1);
/*usum = usum + ((ucomp(i_wdir(i, I_PRES), i_wspd(i, I_PRES)) - stu) * w1);
vsum = vsum + ((vcomp(i_wdir(i, I_PRES), i_wspd(i, I_PRES)) - stv) * w1);*/
wgt = wgt + w1;
num++;
}
@ -377,6 +376,10 @@ void wind_shear(float pbot, float ptop, float *shu, float *shv,
/* 10/9/07 RLT edit */
ubot = i_wndu(pbot, I_PRES);
vbot = i_wndv(pbot, I_PRES);
/*ubot = ucomp((i_wdir(pbot, I_PRES)), (i_wspd(pbot, I_PRES)));
vbot = vcomp((i_wdir(pbot, I_PRES)), (i_wspd(pbot, I_PRES)));
printf("\n ubot = %7.1f vbot = %7.1f\n", ubot, vbot);*/
}
if (ptop == -1) { ptop = i_pres(agl(3000.0)); }
@ -387,6 +390,15 @@ void wind_shear(float pbot, float ptop, float *shu, float *shv,
/* ----- Calculate Vector Difference ----- */
*shu = i_wndu(ptop, I_PRES) - ubot;
*shv = i_wndv(ptop, I_PRES) - vbot;
/* *shu = ucomp((i_wdir(ptop, I_PRES)), (i_wspd(ptop, I_PRES))) - ubot;
*shv = vcomp((i_wdir(ptop, I_PRES)), (i_wspd(ptop, I_PRES))) - vbot; */
/*printf( "TOP: %7.1f %7.1f %7.1f %7.1f %7.1f\nBOT: %7.1f %7.1f %7.1f %7.1f %7.1f\nANS: %7.1f %7.1f %7.1f %7.1f\n",
ptop, i_wdir(ptop, I_PRES), i_wspd(ptop, I_PRES), i_wndu(ptop, I_PRES), i_wndv(ptop, I_PRES), pbot,
angle(ubot, vbot), speed(ubot, vbot), i_wndu(pbot, I_PRES), i_wndv(pbot, I_PRES), angle(*shu, *shv),
speed(*shu, *shv), *shu, *shv);*/
if (qc(*shu) && qc(*shv)) {
*sdir = angle(*shu, *shv);
*smag = speed(*shu, *shv);
@ -503,12 +515,10 @@ float helicity(float lower, float upper, float sdir, float sspd,
srv2 = kt_to_mps(vcomp(sndg[i][idxd], sndg[i][idxs]) - cy);
lyrh = (sru2 * srv1) - (sru1 * srv2);
if (lyrh > 0.0) {
if (lyrh > 0.0)
*phel += lyrh;
}
else {
else
*nhel += lyrh;
}
sru1 = sru2;
srv1 = srv2;
}
@ -517,14 +527,17 @@ float helicity(float lower, float upper, float sdir, float sspd,
/* ----- Finish with interpolated top layer ----- */
sru2 = kt_to_mps(i_wndu(i_pres(msl(upper)), I_PRES) - cx);
srv2 = kt_to_mps(i_wndv(i_pres(msl(upper)), I_PRES) - cy);
lyrh = (sru2 * srv1) - (sru1 * srv2);
if (lyrh > 0.0) {
if (lyrh > 0.0)
*phel += lyrh;
}
else {
else
*nhel += lyrh;
}
/*
fprintf(stderr, "helicity: layer: %.1f:%.1f phel: %.1f nhel: %.1f\n",
lower, upper, *phel, *nhel);
*/
return (*phel + *nhel);
}

View file

@ -72,6 +72,7 @@ public class NsharpWxMath {
*/
public static double getPressureYFromTemp(double temp, double tempX) {
double pressureY;
temp -= tempOffset; //TT605593
pressureY = (tempX - (temp * 0.54))/0.90692;
return pressureY;
}

View file

@ -291,7 +291,7 @@ public class NsharpSkewTPaneBackground extends NsharpGenericPaneBackground {
presslinesNumbersShape.addLineSegment(lines);
//System.out.println("lines="+ lines[0] + "; "+ lines[1]);
//System.out.println("x1="+world.mapX(NsharpConstants.left)+"y1=" +world.mapY(coor.y)+"x2="+world.mapX(NsharpConstants.right)+"y2="+
// world.mapY(coor.y));
// world.mapY(coor.y));
}
IExtent ext = desc.getRenderableDisplay().getExtent();
double xmin = ext.getMinX(); //Extent's viewable envelope min x and y
@ -540,6 +540,7 @@ public class NsharpSkewTPaneBackground extends NsharpGenericPaneBackground {
double xmax = ext.getMaxX(); //Extent's viewable envelope min x and y
double ymax = ext.getMaxY();
double ymin = ext.getMinY();
//System.out.println(" xmin="+xmin+ " xmax="+ xmax+ " ymax="+ymax+" ymin="+ymin);
double dispX = xmin + 20 * currentZoomLevel;
double dispY = ymax - 20 * currentZoomLevel;
//We are getting Y (pressure) level for plotting Temp number, therefore dispX here is not important for the
@ -567,10 +568,9 @@ public class NsharpSkewTPaneBackground extends NsharpGenericPaneBackground {
tempGap= 5;
else if(currentZoomLevel <=0.75)
tempGap= 8;
/*tempGap = (int) ((currentZoomLevel * 10) /1);
if((currentZoomLevel * 10) %1 != 0)
tempGap++;*/
for (int i = /*70*/(int)lowTempMax+tempOffset; i >= /*-70+*/(int)lowTempMin+tempOffset; i -= tempGap) {
//TT605593 assume temp range is from -100 to 100 at ground level
for (int i = 100; i >= -100; i -= tempGap) {
// for (int i = /*70*/(int)lowTempMax+tempOffset; i >= /*-70+*/(int)lowTempMin+tempOffset; i -= tempGap) {
Coordinate coorS = NsharpWxMath.getSkewTXY(dispPressure, i);
double startX1 = world.mapX(coorS.x);
double startY1 = world.mapY(coorS.y);
@ -591,8 +591,12 @@ public class NsharpSkewTPaneBackground extends NsharpGenericPaneBackground {
if((dispPressure -NsharpConstants.MIN_PRESSURE) <10)
dispPressure = NsharpConstants.MIN_PRESSURE+5*currentZoomLevel;
// top temp number
for (int i = (int)topTempMax+tempOffset; i >= (int)topTempMin+tempOffset; i -= tempGap) {
// top temp number.TT605593
//Chin: without zooming, highest level temp is assume around 70 degree lower than ground
// Also, to make sure top temp number is in sync with lower temp number, when consider tempGap
int topTMax = 100- (( 70 / tempGap ) +1) * tempGap;
for (int i = topTMax; i >= topTMax - 200; i -= tempGap) {
//for (int i = (int)topTempMax+tempOffset; i >= (int)topTempMin+tempOffset; i -= tempGap) {
Coordinate coorEnd1 = NsharpWxMath.getSkewTXY(dispPressure, i);
double endX1 = world.mapX(coorEnd1.x);
double endY1 = world.mapY(coorEnd1.y);
@ -613,24 +617,25 @@ public class NsharpSkewTPaneBackground extends NsharpGenericPaneBackground {
Coordinate coorEnd = NsharpWxMath.getSkewTXY(100, i);
dispX=world.mapX(coorEnd.x);
dispY=world.mapY(coorEnd.y);
//System.out.println("temp x="+dispX+" y="+dispY);
if(dispX>xmax){
// when temp line's top point's x coordinate is greater than view xman, the line will not be plotted.
// Can not find a solution for that now.
// therefore, we have to find this temp line's top point's Y coordinate at xman position.
// In other words, find the intersection point of temp line with skewT rectangle's right side line.
dispX = xmax-5;
coorEnd = world.unMap(dispX, 0);
dispX = xmax-20; // need to minus some number. Otherwise, it wont be plotted.
//TT605593
coorEnd = world.unMap(xmax, 0);
double py= NsharpWxMath.getPressureYFromTemp(i, coorEnd.x);
dispY = world.mapY(py);
}
double [][] tlines = {{world.mapX(coorStart.x), world.mapY(coorStart.y)},
{dispX, dispY}};
//System.out.println("temp="+i+" "+world.mapX(coorStart.x)+ "," +world.mapY(coorStart.y)+ " ;"
// +dispX+ "," + dispY);
//System.out.println("temp="+i+" wLx="+world.mapX(coorStart.x)+" sLx="+coorStart.x+ ",wLy=" +world.mapY(coorStart.y)+ " ;wHx="
// +dispX+" sHx="+coorEnd.x+",wHy=" + dispY);
temperatureLineShape.addLineSegment(tlines);
}
temperatureLineShape.compile();
//System.out.println("lower min"+ lowTempMin+ " lower nax "+ lowTempMax+ " upper min "+ topTempMin + " topTempMax "+ topTempMax);
}
//@SuppressWarnings("deprecation")
@ -666,6 +671,7 @@ public class NsharpSkewTPaneBackground extends NsharpGenericPaneBackground {
target.drawWireframeShape(tempNumbersShape, NsharpConstants.color_white, 1, LineStyle.DEFAULT, smallFont);
drawPressureLineNumber(target);
target.clearClippingPlane();
}
//this function is used for printing
public void paintForPrint( WGraphics world, GC gc){

View file

@ -13,8 +13,8 @@
-->
<CcfpTimes>
<Time issue="1500" valid1="1700" valid2="1900" valid3="2100" />
<Time issue="1900" valid1="2100" valid2="2300" valid3="0100" />
<Time issue="2300" valid1="0100" valid2="0300" valid3="0500" />
<Time issue="0300" valid1="0500" valid2="0700" />
<Time issue="1500" valid1="1900" valid2="2100" valid3="2300" />
<Time issue="1900" valid1="2300" valid2="0100" valid3="0300" />
<Time issue="2300" valid1="0300" valid2="0500" valid3="0700" />
<Time issue="0300" valid1="0700" valid2="0900" />
</CcfpTimes>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This xml file is used to provide Contours attributes information, including
the parameter name, level, and forecast hour.
the parameter name, level, forecast hour, and cint.
It is also used to select a list of symbols/markers that will show up
in the Contours attributes GUI for quick access. The first 15 symbols/markers
@ -40,6 +40,48 @@
<label text="f072"/>
</contoursInfo>
<!--
CINT for a given parameter and/or level, in format of:
(1) contourInterval/minimumContourValue/maximumContourValue OR
(2) contourVal1;contourVal2;...;contourValn
See $GEMPAK/help/hlx/cint.hl2
When in format (1), the number of decimal points is decided by the maximum number of
decimal points found in the cint, e.g., if cint = 10/0/100, then the all contour
value will be integer; if cint = 10/0/100.00, then the all contour value will have two
decimal points (0.00, 10.00, ....)
You can specify a cint value for a parm for all its levels with {level = ""}.
-->
<contoursInfo name="Cint">
<cint parm="HGMT" level="" value="10/0/100" />
<cint parm="HGMT" level="1000" value="10/0/100" />
<cint parm="HGMT" level="850" value="10/0/100" />
<cint parm="HGMT" level="700" value="10/0/100" />
<cint parm="HGMT" level="500" value="10/0/100" />
<cint parm="HGMT" level="300" value="10/0/100" />
<cint parm="HGMT" level="200" value="10/0/100" />
<cint parm="HGMT" level="100" value="10/0/100" />
<!-- -->
<cint parm="TEMP" value="10/0/100" />
<cint parm="TEMP" level="1000" value="10/0/100" />
<cint parm="TEMP" level="850" value="10/0/100" />
<cint parm="TEMP" level="700" value="10/0/100" />
<cint parm="TEMP" level="500" value="10/0/100" />
<cint parm="TEMP" level="300" value="10/0/100" />
<cint parm="TEMP" level="200" value="10/0/100" />
<cint parm="TEMP" level="100" value="10/0/100" />
<!-- -->
<cint parm="PRES" level="1000" value="10/0/100" />
<cint parm="PRES" level="850" value="10/0/100" />
<cint parm="PRES" level="700" value="10/0/100" />
<cint parm="PRES" level="500" value="10/0/100" />
<cint parm="PRES" level="300" value="10/0/100" />
<cint parm="PRES" level="200" value="10/0/100" />
<cint parm="PRES" level="100" value="10/0/100" />
</contoursInfo>
<!-- The following are symbols and markers defined in pgen/plugin.xml.
Change the value of "quickAccess" to "true" if you want it to appear on the

View file

@ -382,6 +382,14 @@
<patternId>LINE_SOLID</patternId>
<linePattern hasArrowHead="false" name="Solid Line"/>
</patternEntry>
<patternEntry>
<patternId>KINK_LINE_1</patternId>
<linePattern hasArrowHead="false" name="Kink Line with open arrow head"/>
</patternEntry>
<patternEntry>
<patternId>KINK_LINE_2</patternId>
<linePattern hasArrowHead="false" name="Kink Line with filled arrow head"/>
</patternEntry>
<patternEntry>
<patternId>STORM_TRACK</patternId>
<linePattern hasArrowHead="false" name="Storm Track"/>

View file

@ -10013,7 +10013,7 @@
</ns3:PgenObjects>
</ns3:PgenClass>
<ns3:PgenSave outputFile="SAB_Precip.DDMMYYYY.HH.xml" saveLayers="false" autoSave="true" autoSaveFreq="5"/>
</ns3:ProductType>
</ns3:ProductType>
<ns3:ProductType Name="" Type="Convective Outlook" Subtype="None">
<ns3:PgenControls>
<ns3:Name>Open</ns3:Name>
@ -10094,19 +10094,19 @@
<ns3:Name>Outlook</ns3:Name>
</ns3:PgenObjects>
</ns3:PgenClass>
<ns3:PgenLayer Name="hail" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=HAIL" Name="hail" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="torn" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=TORN" Name="torn" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="wind" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=WIND" Name="wind" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="catg" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=OUTLOOK" Name="catg" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="pr2cat" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=OUTLOOK;outlook format flag=false" Name="pr2cat" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenSave outputFile="Convective_Outlook.DDMMYYYY.HH.xml" saveLayers="false" autoSave="true" autoSaveFreq="5"/>
@ -10186,16 +10186,16 @@
<ns3:Name>Outlook</ns3:Name>
</ns3:PgenObjects>
</ns3:PgenClass>
<ns3:PgenLayer Name="fire" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=FIREOUTL" Name="fire" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="cat" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=EXT_FIRE" Name="cat" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="dryt" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=TSTMOLK" Name="dryt" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="wind" OnOff="false" MonoColor="false" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=WIND" Name="wind" OnOff="false" MonoColor="false" Filled="false">
<ns3:Color blue="0" red="255" green="255" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenSave outputFile="Fire_Weather_Outlook.DDMMYYYY.HH.xml" saveLayers="false" autoSave="true" autoSaveFreq="5"/>
@ -10233,6 +10233,7 @@
<ns3:Name>Add Point Alt</ns3:Name>
<ns3:Name>Distance</ns3:Name>
<ns3:Name>IncDec</ns3:Name>
<ns3:Name>Clip</ns3:Name>
</ns3:PgenActions>
<ns3:PgenClass Name="Any">
<ns3:PgenObjects/>
@ -10247,10 +10248,13 @@
<ns3:Name>Outlook</ns3:Name>
</ns3:PgenObjects>
</ns3:PgenClass>
<ns3:PgenLayer Name="FIRE" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=FIREOUTL" Name="FIRE" OnOff="true" MonoColor="true" Filled="true">
<ns3:Color blue="139" red="139" green="0" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenSave outputFile="Fire_Weather_Outlook.Day1.DDMMYYYY.HH.xml" saveLayers="false" autoSave="true" autoSaveFreq="5"/>
<ns3:ClipFlag>false</ns3:ClipFlag>
<ns3:ClipBoundsTable>cpcus_bnd</ns3:ClipBoundsTable>
<ns3:ClipBoundsName>CPC_US</ns3:ClipBoundsName>
</ns3:ProductType>
<ns3:ProductType Name="" Type="Fire Weather Outlook" Subtype="Day2">
<ns3:PgenControls>
@ -10300,7 +10304,7 @@
<ns3:Name>Outlook</ns3:Name>
</ns3:PgenObjects>
</ns3:PgenClass>
<ns3:PgenLayer Name="FIRE" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=FIREOUTL" Name="FIRE" OnOff="true" MonoColor="true" Filled="true">
<ns3:Color blue="139" red="139" green="0" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenSave outputFile="Fire_Weather_Outlook.Day2.DDMMYYYY.HH.xml" saveLayers="false" autoSave="true" autoSaveFreq="5"/>
@ -10353,10 +10357,10 @@
<ns3:Name>Outlook</ns3:Name>
</ns3:PgenObjects>
</ns3:PgenClass>
<ns3:PgenLayer Name="FIRE D1" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=FIREOUTL" Name="FIRE D1" OnOff="true" MonoColor="true" Filled="true">
<ns3:Color blue="139" red="139" green="0" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="FIRE D2" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=FIREOUTL" Name="FIRE D2" OnOff="true" MonoColor="true" Filled="true">
<ns3:Color blue="139" red="139" green="0" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenSave outputFile="Fire_Weather_Outlook.Day1-2.DDMMYYYY.HH.xml" saveLayers="false" autoSave="true" autoSaveFreq="5"/>
@ -10409,25 +10413,25 @@
<ns3:Name>Outlook</ns3:Name>
</ns3:PgenObjects>
</ns3:PgenClass>
<ns3:PgenLayer Name="D3" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=OUTLOOK" Name="D3" OnOff="false" MonoColor="true" Filled="true">
<ns3:Color blue="255" red="255" green="0" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="D4" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=OUTLOOK" Name="D4" OnOff="false" MonoColor="true" Filled="true">
<ns3:Color blue="0" red="255" green="0" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="D5" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=OUTLOOK" Name="D5" OnOff="false" MonoColor="true" Filled="true">
<ns3:Color blue="238" red="145" green="44" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="D6" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=OUTLOOK" Name="D6" OnOff="false" MonoColor="true" Filled="true">
<ns3:Color blue="0" red="0" green="139" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="D7" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=OUTLOOK" Name="D7" OnOff="false" MonoColor="true" Filled="true">
<ns3:Color blue="139" red="16" green="78" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="D8" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=OUTLOOK" Name="D8" OnOff="false" MonoColor="true" Filled="true">
<ns3:Color blue="38" red="139" green="71" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenLayer Name="CAT" OnOff="false" MonoColor="true" Filled="false">
<ns3:PgenLayer MetaInfo="outlook type=EXT_FIRE" Name="CAT" OnOff="false" MonoColor="true" Filled="true">
<ns3:Color blue="139" red="139" green="0" alpha="255"/>
</ns3:PgenLayer>
<ns3:PgenSave outputFile="Fire_Weather_Outlook.Day3-8.DDMMYYYY.HH.xml" saveLayers="false" autoSave="true" autoSaveFreq="5"/>

View file

@ -313,6 +313,16 @@
<Point Lat="19.282701554968984" Lon="-112.48852999239747"/>
<Point Lat="19.853243101176776" Lon="-108.33312442667157"/>
</Line>
<Line pgenType="KINK_LINE_1" pgenCategory="Lines" lineWidth="2.0" sizeScale="1.0" smoothFactor="0" closed="false" filled="false" fillPattern="SOLID" flipSide="false" arrowHeadType="OPEN" kinkPosition="0.5">
<Color red="255" green="0" blue="0" alpha="255"/>
<Point Lat="42.216395906820196" Lon="-110.94870254887984"/>
<Point Lat="40.16867459395568" Lon="-100.55653112449869"/>
</Line>
<Line pgenType="KINK_LINE_2" pgenCategory="Lines" lineWidth="2.0" sizeScale="1.0" smoothFactor="0" closed="false" filled="false" fillPattern="SOLID" flipSide="false" arrowHeadType="FILLED" kinkPosition="0.5">
<Color red="255" green="0" blue="0" alpha="255"/>
<Point Lat="37.577991351665105" Lon="-111.39813436950983"/>
<Point Lat="36.413201252941406" Lon="-99.82243392673534"/>
</Line>
<Symbol pgenCategory="Symbol" pgenType="PRESENT_WX_088" lineWidth="2.0" sizeScale="1.0" clear="true">
<Color red="0" green="255" blue="0" alpha="255"/>
<Color red="0" green="255" blue="0" alpha="255"/>

View file

@ -9,16 +9,16 @@
Change Log:
B. Yin/Chugach 04/10 Initial Coding
B. Yin/SGT 11/13 Remove leading space at each line (TTR884)
-->
<xsl:variable name="newline"><xsl:text>
</xsl:text></xsl:variable>
</xsl:text></xsl:variable>
<xsl:template match="Outlook">
<xsl:value-of select="$newline"/>
<xsl:value-of select="@days"/>
<xsl:value-of select="@days"/>
<xsl:value-of select="$newline"/>
<xsl:value-of select="@forecaster"/>
<xsl:value-of select="@forecaster"/>
<xsl:value-of select="$newline"/>
<xsl:value-of select="substring(@issueTime,9,2)"/>

View file

@ -10,15 +10,13 @@
SUMMIT ELEV: </xsl:text>
<xsl:value-of select="translate(@elev, $smallcase, $uppercase)"/><xsl:text>&#13;&#10;</xsl:text>
<xsl:text>
ADVISORY NR: </xsl:text>
ADVISORY NR: </xsl:text>
<xsl:value-of select="@year"/><xsl:if test="string-length(@year) > 0">/</xsl:if><xsl:value-of select="@advNum"/><xsl:text>&#13;&#10;</xsl:text>
INFO SOURCE: <xsl:if test="not(contains( @infoSource, 'NOT AVBL'))" ><xsl:value-of select="substring-after(@infoSource,':::')"/><xsl:text>&#xA0;</xsl:text></xsl:if><xsl:text>&#13;&#10;</xsl:text>
ERUPTION DETAILS: <xsl:if test="not(contains( @erupDetails, 'NOT AVBL'))" ><xsl:value-of select="translate(substring-after(@erupDetails,':::'), $smallcase, $uppercase)"/><xsl:text>&#13;&#10;</xsl:text></xsl:if>
INFO SOURCE: <xsl:value-of select="substring-before(@infoSource,':::')"/><xsl:text>&#xA0;</xsl:text><xsl:value-of select="translate(@addInfoSource, $smallcase, $uppercase)"/><xsl:text>&#13;&#10;</xsl:text>
ERUPTION DETAILS: <xsl:value-of select="translate(substring-before(@erupDetails,':::'), $smallcase, $uppercase)"/><xsl:text>&#13;&#10;</xsl:text>
RMK: <xsl:value-of select="substring-after(@remarks,':::')"/><xsl:text>&#13;&#10;</xsl:text>
NXT ADVISORY: <xsl:value-of select="substring-after(@nextAdv,':::')"/><xsl:text>&#13;&#10;</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View file

@ -83,7 +83,11 @@
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
<xsl:text>TORNADOES...HAIL TO </xsl:text>
<xsl:if test="@watchType = 'TORNADO'">
<xsl:text>TORNADOES...</xsl:text>
</xsl:if>
<xsl:text>HAIL TO </xsl:text>
<xsl:value-of select="@hailSize"/>
<xsl:text> INCHES IN DIAMETER...THUNDERSTORM WIND</xsl:text>
@ -102,7 +106,9 @@
<xsl:text>TEST </xsl:text>
</xsl:if>
<xsl:text>TORNADO WATCH AREA IS APPROXIMATELY ALONG AND </xsl:text>
<xsl:value-of select="@watchType"/>
<xsl:text>WATCH AREA IS APPROXIMATELY ALONG AND </xsl:text>
<xsl:value-of select="@halfWidthSm"/>
<xsl:text> STATUTE</xsl:text>
<xsl:value-of select="$newline"/>
@ -197,7 +203,9 @@
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
<xsl:text>REMEMBER...A TORNADO WATCH MEANS CONDITIONS ARE FAVORABLE FOR</xsl:text>
<xsl:text>REMEMBER...A </xsl:text>
<xsl:value-of select="@watchType"/>
<xsl:text> WATCH MEANS CONDITIONS ARE FAVORABLE FOR</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:text>TORNADOES AND SEVERE THUNDERSTORMS IN AND CLOSE TO THE WATCH</xsl:text>
<xsl:value-of select="$newline"/>
@ -228,7 +236,11 @@
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
<xsl:text>AVIATION...TORNADOES AND A FEW SEVERE THUNDERSTORMS WITH HAIL</xsl:text>
<xsl:text>AVIATION...</xsl:text>
<xsl:if test="@watchType = 'TORNADO'">
<xsl:text>TORNADOES AND </xsl:text>
</xsl:if>
<xsl:text>A FEW SEVERE THUNDERSTORMS WITH HAIL</xsl:text>
<xsl:value-of select="$newline"/>
<xsl:text>SURFACE AND ALOFT TO </xsl:text>
<xsl:value-of select="@hailSize"/>

View file

@ -12,6 +12,8 @@
Change Log:
B. Yin/Chugach 03/10 Initial Coding
B. Yin/SGT 12/13 TTR 904 change county list string
-->
<xsl:variable name="newline"><xsl:text>
@ -33,8 +35,9 @@
<xsl:if test="@issueStatus = 'Test'">
<xsl:text> TEST </xsl:text>
</xsl:if>
<xsl:text>TORNADO WATCH #</xsl:text>
<xsl:value-of select="@watchType"/>
<xsl:text> WATCH #</xsl:text>
<xsl:value-of select="@watchNumber"/>
<xsl:text> HAS BEEN ISSUED BY THE NWS STORM PREDICTION CENTER</xsl:text>
@ -63,8 +66,14 @@
<xsl:value-of select="$newline"/>
<xsl:text>. </xsl:text>
<xsl:value-of select="$stName"/>
<xsl:text> COUNTIES INCLUDED ARE </xsl:text>
<xsl:value-of select="$newline"/>
<xsl:choose>
<xsl:when test="$stName='LOUISIANA'">
<xsl:text> PARISHES INCLUDED ARE </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text> COUNTIES INCLUDED ARE </xsl:text>
</xsl:otherwise>
</xsl:choose> <xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
<xsl:call-template name="getCountiesInState">
<xsl:with-param name="state" select="."/>

View file

@ -38,8 +38,8 @@
<xsl:if test="@issueStatus = 'Test'">
<xsl:text>TEST...</xsl:text>
</xsl:if>
<xsl:text>TORNADO WATCH OUTLINE UPDATE FOR WT </xsl:text>
<xsl:value-of select="@watchType"/>
<xsl:text> WATCH OUTLINE UPDATE FOR WT </xsl:text>
<xsl:value-of select="@watchNumber"/>
<xsl:if test="@issueStatus = 'Test'">
<xsl:text>...TEST</xsl:text>
@ -52,7 +52,8 @@
<xsl:value-of select="$newline"/>
<xsl:value-of select="$newline"/>
<xsl:text>TORNADO WATCH </xsl:text>
<xsl:value-of select="@watchType"/>
<xsl:text> WATCH </xsl:text>
<xsl:value-of select="@watchNumber"/>
<xsl:text> IS IN EFFECT UNTIL </xsl:text>
<xsl:value-of select="@expTime"/>

View file

@ -10,6 +10,8 @@
Change Log:
B. Yin/Chugach 03/10 Initial Coding
B. Yin/SGT 12/13 TTR 904 change county list string
-->
<xsl:variable name="newline"><xsl:text>
@ -34,7 +36,7 @@
<xsl:call-template name="fmtDateTime">
<xsl:with-param name="date" select="'X'"/>
</xsl:call-template>
<xsl:value-of select="$newline"/>
<xsl:text>VALID TIME: </xsl:text>
<xsl:call-template name="fmtDateTime">
@ -121,10 +123,10 @@
<xsl:value-of select="@watchAreaNm"/>
<xsl:value-of select="$newline"/>
<xsl:text> UGC State County Name Lat/Lon FIPS WFO</xsl:text>
<xsl:text> UGC State County Name Lat/Lon FIPS WFO </xsl:text>
<xsl:value-of select="$newline"/>
<xsl:for-each select="Counties">
<xsl:value-of select="."/>
<xsl:value-of select="substring(.,1,56)"/>
<xsl:value-of select="$newline"/>
</xsl:for-each>

View file

@ -12,6 +12,7 @@
Change Log:
B. Yin/Chugach 05/10 Initial Coding
B. Yin/SGT 12/13 TTR 904 change county list string
-->
<xsl:template name="getCoastalWaters">
@ -20,7 +21,7 @@
<xsl:for-each select="/Products/Product/Layer/DrawableElement/DECollection/DrawableElement/WatchBox/Counties[substring(.,8,2) = $state]">
<xsl:value-of select="$newline"/>
<!-- get the county string -->
<xsl:variable name="zonestr" select="substring(.,52)"/>
<xsl:variable name="zonestr" select="substring(.,57)"/>
<xsl:call-template name="wrapText">
<xsl:with-param name="str" select="$zonestr"/>
<xsl:with-param name="charPerLine" select="65"/>

View file

@ -12,6 +12,8 @@
Change Log:
B. Yin/Chugach 03/10 Initial Coding
B. Yin/SGT 12/13 TTR 904 change county list string
-->
<xsl:template name="getStateLine">
@ -20,12 +22,9 @@
<xsl:value-of select="$state"/>
<xsl:text>C</xsl:text>
<xsl:for-each select="/Products/Product/Layer/DrawableElement/WatchBox/Counties[substring(.,8,2) = $state]">
<xsl:for-each select="/Products/Product/Layer/DrawableElement/DECollection/DrawableElement/WatchBox/Counties[substring(.,8,2) = $state]">
<xsl:value-of select="substring(.,4,3)"/>
<xsl:text>-</xsl:text>
<xsl:if test="position() mod 14 = 0 and not(position() = last())">
<xsl:value-of select="$newline"/>
</xsl:if>
</xsl:for-each>
</xsl:template>

View file

@ -24,6 +24,11 @@
id="gov.noaa.nws.ncep.ui.pgen.rsc.PgenDualDraw"
name="Pgen Dual Point Drawing">
</command>
<command
categoryId="gov.noaa.nws.ncep.viz.ui.modalTool"
id="gov.noaa.nws.ncep.ui.pgen.rsc.PgenKinkLineDraw"
name="Pgen Kink Line Drawing">
</command>
<command
categoryId="gov.noaa.nws.ncep.viz.ui.modalTool"
id="gov.noaa.nws.ncep.ui.pgen.rsc.PgenMultiDraw"
@ -328,6 +333,10 @@
class="gov.noaa.nws.ncep.ui.pgen.tools.PgenDualPointDrawingTool"
commandId="gov.noaa.nws.ncep.ui.pgen.rsc.PgenDualDraw">
</handler>
<handler
class="gov.noaa.nws.ncep.ui.pgen.tools.PgenKinkLineDrawingTool"
commandId="gov.noaa.nws.ncep.ui.pgen.rsc.PgenKinkLineDraw">
</handler>
<handler
class="gov.noaa.nws.ncep.ui.pgen.tools.PgenMultiPointDrawingTool"
commandId="gov.noaa.nws.ncep.ui.pgen.rsc.PgenMultiDraw">
@ -2963,6 +2972,18 @@
className="Arc"
commandId="gov.noaa.nws.ncep.ui.pgen.rsc.PgenDualDraw"
icon="icons/cirsolid.gif" />
<object
name="KINK_LINE_1"
label="Kink_Line_Open"
className="Lines"
commandId="gov.noaa.nws.ncep.ui.pgen.rsc.PgenKinkLineDraw"
icon="icons/kinkln1.gif" />
<object
name="KINK_LINE_2"
label="Kink_Line_Fill"
className="Lines"
commandId="gov.noaa.nws.ncep.ui.pgen.rsc.PgenKinkLineDraw"
icon="icons/kinkln2.gif" />
<object
name="Arrow"
label="Arrow"

View file

@ -11,69 +11,84 @@ import org.osgi.framework.BundleContext;
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "gov.noaa.nws.ncep.ui.pgen";
// The plug-in ID
public static final String PLUGIN_ID = "gov.noaa.nws.ncep.ui.pgen";
// The shared instance
private static Activator plugin;
private IPreferenceStore myprefs = null;
/**
* The constructor
*/
public Activator() {
}
// The shared instance
private static Activator plugin;
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
private IPreferenceStore myprefs = null;
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* The constructor
*/
public Activator() {
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore()
*/
@Override
public IPreferenceStore getPreferenceStore() {
/*
* First time, set defaults for the PGEN preference store
*/
if ( myprefs == null ) {
myprefs = super.getPreferenceStore();
myprefs.setDefault( PgenPreferences.P_OPR_DIR, PgenPreferences.V_OPR_DIR);
myprefs.setDefault( PgenPreferences.P_WORKING_DIR, PgenPreferences.V_WORKING_DIR);
myprefs.setDefault( PgenPreferences.P_RECOVERY_DIR, PgenPreferences.V_RECOVERY_DIR);
myprefs.setDefault( PgenPreferences.P_AUTO_FREQ, 5);
myprefs.setDefault( PgenPreferences.P_MAX_DIST, 30);
myprefs.setDefault( PgenPreferences.P_PGEN_MODE, PgenMode.SINGLE.toString() );
myprefs.setDefault( PgenPreferences.P_LAYER_LINK, false );
myprefs.setDefault( PgenPreferences.P_COMP_COORD, PgenPreferences.CED_COMP_COORD);
}
return myprefs;
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
* )
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore()
*/
@Override
public IPreferenceStore getPreferenceStore() {
/*
* First time, set defaults for the PGEN preference store
*/
if (myprefs == null) {
myprefs = super.getPreferenceStore();
myprefs.setDefault(PgenPreferences.P_OPR_DIR,
PgenPreferences.V_OPR_DIR);
myprefs.setDefault(PgenPreferences.P_WORKING_DIR,
PgenPreferences.V_WORKING_DIR);
myprefs.setDefault(PgenPreferences.P_RECOVERY_DIR,
PgenPreferences.V_RECOVERY_DIR);
myprefs.setDefault(PgenPreferences.P_AUTO_FREQ, 5);
myprefs.setDefault(PgenPreferences.P_MAX_DIST, 30);
myprefs.setDefault(PgenPreferences.P_PGEN_MODE,
PgenMode.SINGLE.toString());
myprefs.setDefault(PgenPreferences.P_LAYER_LINK, false);
myprefs.setDefault(PgenPreferences.P_COMP_COORD,
PgenPreferences.CED_COMP_COORD);
myprefs.setDefault(PgenPreferences.P_AUTOPLACE_TEXT, false);
myprefs.setDefault(PgenPreferences.P_LAYER_MERGE, 4);
}
return myprefs;
}
}

View file

@ -0,0 +1,453 @@
/*
* gov.noaa.nws.ncep.ui.pgen
*
* November 2013
*
* This code has been developed by the NCEP/SIB for use in the AWIPS2 system.
*/
package gov.noaa.nws.ncep.ui.pgen;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryCollection;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LineString;
import com.vividsolutions.jts.geom.LinearRing;
import com.vividsolutions.jts.geom.Point;
import com.vividsolutions.jts.geom.Polygon;
import com.vividsolutions.jts.geom.impl.CoordinateArraySequence;
/**
* A utility class used to place a text box and its associated point arrow
* in/around its associated polygon without intersecting the polygon and other
* geometries on the visible screen.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 4, 2013 TTR 752 jwu Initial creation
*
* </pre>
*
* @author jwu
* @version 1.0
*/
public class PgenAutoPlacement {
private static final double START_ANGLE = 45.0;;
private PgenRangeRecord textBox;
private PgenRangeRecord polygonBox;
private PgenRangeRecord arrowBox;
private List<PgenRangeRecord> activeRanges;
private PgenRangeRecord screenBox;
private boolean checkCenter;
private double angleIncrement;
private double distIncrement;
private GeometryFactory gf;
/**
* @param textBox
* @param arrowBox
* @param activeRanges
* @param screenBox
* @param checkCenter
* @param angleIncrement
* @param distIncrement
*/
public PgenAutoPlacement(PgenRangeRecord textBox,
PgenRangeRecord polygonBox, PgenRangeRecord arrowBox,
List<PgenRangeRecord> activeRanges, PgenRangeRecord screenBox,
boolean checkCenter, double angleIncrement, double distIncrement) {
super();
this.textBox = textBox;
this.polygonBox = polygonBox;
this.arrowBox = arrowBox;
this.activeRanges = activeRanges;
this.screenBox = screenBox;
this.checkCenter = checkCenter;
this.angleIncrement = angleIncrement;
this.distIncrement = distIncrement;
gf = new GeometryFactory();
}
/**
* @param textBox
* the textBox to set
*/
public void setTextBox(PgenRangeRecord textBox) {
this.textBox = textBox;
}
/**
* @param polygonBox
* the polygonBox to set
*/
public void setPolygonBox(PgenRangeRecord polygonBox) {
this.polygonBox = polygonBox;
}
/**
* @param activeRanges
* the activeRanges to set
*/
public void setActiveRanges(List<PgenRangeRecord> activeRanges) {
this.activeRanges = activeRanges;
}
/**
* @param screenBox
* the screenBox to set
*/
public void setScreenBox(PgenRangeRecord screenBox) {
this.screenBox = screenBox;
}
/**
* @param checkCenter
* the checkCenter to set
*/
public void setCheckCenter(boolean checkCenter) {
this.checkCenter = checkCenter;
}
/**
* @param angleIncrement
* the angleIncrement to set
*/
public void setAngleIncrement(double angleIncrement) {
this.angleIncrement = angleIncrement;
}
/**
* @param distIncrement
* the distIncrement to set
*/
public void setDistIncrement(double distIncrement) {
this.distIncrement = distIncrement;
}
/**
* Generate a JTS polygon from a set of points.
*
* @param points
* array of points
* @return
*/
public static Geometry pointsToGeometry(Coordinate[] points,
boolean closed, GeometryFactory gf) {
Geometry geom;
if (points == null || points.length == 0) {
geom = null;
} else if (points.length == 1) {
CoordinateArraySequence cas = new CoordinateArraySequence(points);
geom = new Point(cas, new GeometryFactory());
} else if (points.length == 2) {
geom = pointsToLineString(points, gf);
} else {
if (closed) {
geom = pointsToPolygon(points, gf);
} else {
geom = pointsToLineString(points, gf);
}
}
return geom;
}
/**
* Generate a JTS polygon from a set of points.
*
* @param pots
* list of points
* @return
*/
public static Geometry pointsToGeometry(List<Coordinate> pts,
boolean closed, GeometryFactory gf) {
if (pts == null || pts.size() == 0)
return null;
Coordinate[] points = new Coordinate[pts.size()];
pts.toArray(points);
return pointsToGeometry(points, closed, gf);
}
/**
* Generate a JTS LineString from a set of points.
*
* @param points
* array of points
* @return
*/
public static Geometry pointsToLineString(Coordinate[] points,
GeometryFactory gf) {
CoordinateArraySequence cas = new CoordinateArraySequence(points);
return new LineString(cas, gf);
}
/**
* Generate a JTS polygon from a set of points.
*
* It is assumed that the first point is not repeated at the end in the
* input array of point.
*
* @param points
* array of points
* @return
*/
public static Polygon pointsToPolygon(Coordinate[] points,
GeometryFactory gf) {
Coordinate[] coords = Arrays.copyOf(points, points.length + 1);
coords[coords.length - 1] = coords[0];
CoordinateArraySequence cas = new CoordinateArraySequence(coords);
LinearRing ring = new LinearRing(cas, gf);
Polygon polygon = new Polygon(ring, null, gf);
return polygon;
}
/**
* Find a location to place the text box so the box won't intersect its
* linked polygon and all other geometries.
*
* @param points
* array of points
* @return PgenRangeRecord
*/
public PgenRangeRecord[] placeTextBox() {
PgenRangeRecord[] newrr = new PgenRangeRecord[2];
Geometry textgeo = pointsToGeometry(textBox.getExtent(), true, gf);
Geometry textgeo1 = pointsToGeometry(textBox.getExtentWithoutBuffer(),
true, gf);
// Geometry ccfpbox = pointsToGeometry(polygonBox.getExtent(), gf);
Geometry ccfpgeo = pointsToGeometry(polygonBox.getPoints(), true, gf);
GeometryCollection gc = buildGC(activeRanges, gf);
// Place the text in the centroid of the CCFP polygon.
newrr[0] = this.textBox;
newrr[1] = new PgenRangeRecord(); // no arrow needed.
if (checkCenter && textgeo1.within(ccfpgeo)) {
if (gc == null || (gc != null && !gc.intersects(textgeo1))) {
// newrr[0] = this.textBox;
// newrr[1] = new PgenRangeRecord(); // no arrow needed.
return newrr;
}
}
// Start from the center direction to find the first location.
double screenWidth = screenBox.getExtent().get(1).x
- screenBox.getExtent().get(0).x;
// remember the start location (center)
PgenRangeRecord startLoc = textBox.copy();
// angleIncrement = 5.0;
// distIncrement = 1.25;
double unit = screenWidth * distIncrement / 100;
// Find how many round of horizontal increments needed to reach the
// farest of the screen.
double maxDist = textBox.maxExtention(screenBox);
int nrounds = (int) (maxDist / unit) + 1;
// Find the number of trials in one round.
int numOfRotations = (int) (360 / angleIncrement + 0.05);
double radius = 0;
double ang, xdir, ydir;
boolean firstAvailable = false;
for (int jj = 0; jj < nrounds; jj++) {
radius = unit + jj * unit; // distance increment
for (int ii = 0; ii < numOfRotations; ii++) {
ang = Math.toRadians(START_ANGLE - ii * angleIncrement); // anti-clockwise
xdir = radius * Math.cos(ang);
ydir = radius * Math.sin(ang);
// Move box and make sure it is visible in screen.
PgenRangeRecord newBox = moveTextBox(startLoc, xdir, ydir);
PgenRangeRecord newArrow = new PgenRangeRecord(); // no arrow
// needed.;
if (!newBox.within(screenBox))
continue;
/*
* check if the box intersects the polygon and then check if it
* intersects all other geometries. Remember the first box that
* found outside of the polygon.
*/
textgeo = pointsToGeometry(newBox.getExtent(), true, gf);
boolean insideCcfp = textgeo.within(ccfpgeo);
if (insideCcfp || !textgeo.intersects(ccfpgeo)) {
// if ( !textgeo.intersects(ccfpgeo)) {
if (!insideCcfp) {
newArrow = findArrow(newBox, ccfpgeo, gc);
}
// Remember the first one.
if (!firstAvailable) {
newrr[0] = newBox.copy();
newrr[1] = newArrow.copy();
firstAvailable = true;
}
if (gc == null || (gc != null && !gc.intersects(textgeo))) {
/*
* to do - let's check if the arrow does not intersect
* with other geometries, except the CCFP polygon and
* the text box?
*/
if (!insideCcfp
&& (gc != null && gc.getNumGeometries() > 0)) {
Geometry arrowgeo = pointsToGeometry(
newArrow.getPoints(), false, gf);
boolean validArrow = true;
for (int kk = 0; kk < gc.getNumGeometries(); kk++) {
if (arrowgeo.intersects(gc.getGeometryN(kk))) {
validArrow = false;
break;
}
}
if (!validArrow) {
continue;
}
}
newrr[0] = newBox;
newrr[1] = newArrow;
return newrr;
}
}
}
}
return newrr;
}
/*
* Move the text box (range record) as specified.
*/
private PgenRangeRecord moveTextBox(PgenRangeRecord rr, double xinc,
double yinc) {
PgenRangeRecord newrr = rr.copy();
for (Coordinate pt : newrr.getExtent()) {
pt.x += xinc;
pt.y += yinc;
}
for (Coordinate pt : newrr.getPoints()) {
pt.x += xinc;
pt.y += yinc;
}
return newrr;
}
/*
* Put all geometries that need to be checked agaist into a
* GeometryCollection.
*/
private GeometryCollection buildGC(List<PgenRangeRecord> ranges,
GeometryFactory gf) {
GeometryCollection ngc = null;
List<Geometry> rangeGeos = new ArrayList<Geometry>();
for (PgenRangeRecord rr : ranges) {
if (rr.getPoints() != null && rr.getPoints().size() > 0) {
if (rr.getPoints().size() > 1) {
rangeGeos.add(pointsToGeometry(rr.getPoints(),
rr.isClosed(), gf));
} else {
Geometry ego = pointsToGeometry(rr.getExtent(), true, gf);
if (ego != null) {
rangeGeos
.add(pointsToGeometry(rr.getExtent(), true, gf));
}
}
}
}
if (rangeGeos.size() > 0) {
ngc = new GeometryCollection(
rangeGeos.toArray(new Geometry[rangeGeos.size()]), gf);
}
return ngc;
}
/*
* Find an arrow that will not intersect with a list of geometries.
*/
private PgenRangeRecord findArrow(PgenRangeRecord textBox,
Geometry polygonGeo, GeometryCollection gc) {
// First use arrow from text centroid to polygon centroid.
List<Coordinate> arrow = new ArrayList<Coordinate>();
Point polyCenter = polygonGeo.getCentroid();
Coordinate textCenter = textBox.getPoints().get(0);
arrow.add(textCenter);
arrow.add(new Coordinate(polyCenter.getX(), polyCenter.getY()));
// Now starts from the intersection point of the arrow with the text
Geometry arrowGeo = pointsToGeometry(arrow, false, gf);
Geometry textGeo = pointsToGeometry(textBox.getExtentWithoutBuffer(),
true, gf);
Geometry interPt = arrowGeo.intersection(textGeo);
arrow.remove(0);
if (interPt.getNumPoints() > 1) {
arrow.add(0, interPt.getCoordinates()[1]);
} else {
arrow.add(0, interPt.getCoordinates()[0]);
}
Geometry firstArrowGeo = pointsToGeometry(arrow, false, gf);
return new PgenRangeRecord(firstArrowGeo.getCoordinates(), false);
// if (gc == null
// || (gc != null && gc.getNumGeometries() > 0 && firstArrowGeo
// .intersects(gc))) {
// return new PgenRangeRecord(firstArrowGeo.getCoordinates());
// } else {
// return new PgenRangeRecord(firstArrowGeo.getCoordinates());
// }
}
}

View file

@ -36,8 +36,10 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
* 02/10/11 ? B. Yin Add maximum distance to be selected
* 02/11 #405 J. Wu Added P_WORKING_DIR.
* 05/11 ? J. Wu Added P_COMP_COORD
* 08/11 #335 J. Wu Added P_BASE_DIR
* 04/29 #977 S. Gilbert PGEN Database support
* 08/11 #335 J. Wu Added P_BASE_DIR
* 04/12 #977 S. Gilbert PGEN Database support
* 11/13 TTR752 J. Wu Added P_AUTOPLACE_TEXT
* 12/13 TTR776 J. Wu Added P_LAYER_MERGE
*
* </pre>
*
@ -77,6 +79,13 @@ public class PgenPreferences extends FieldEditorPreferencePage implements
// public final static String CED_COMP_COORD = "ced/0;0;0|KS+";
public final static String STR_COMP_COORD = "str/90;-97;0|19.00;-119.00;47.00;-56.00";
// Preference to place text box automatically (CCFP);
public final static String P_AUTOPLACE_TEXT = "PGEN_AUTOPLACE_TEXT";
private BooleanFieldEditor autoPlaceText;
public final static String P_LAYER_MERGE = "P_LAYER_MERGE";
private BooleanFieldEditor layerLink;
public PgenPreferences() {
@ -132,6 +141,21 @@ public class PgenPreferences extends FieldEditorPreferencePage implements
getFieldEditorParent());
this.addField(projCombo);
autoPlaceText = new BooleanFieldEditor(P_AUTOPLACE_TEXT,
"&Text Auto Placement (where applicable)",
BooleanFieldEditor.DEFAULT, getFieldEditorParent());
this.addField(autoPlaceText);
ComboFieldEditor layerMerge = new ComboFieldEditor(P_LAYER_MERGE,
"&Default Action for PGEN Layer Merge:", new String[][] {
{ "Take no action", "0" },
{ "Add all as new layers", "2" },
{ "Replace all like name layers", "3" },
{ "Merge all like name layers", "4" },
{ "Merge all into active layer", "5" }, },
getFieldEditorParent());
this.addField(layerMerge);
}
/*
@ -170,7 +194,15 @@ public class PgenPreferences extends FieldEditorPreferencePage implements
}
}
} else if (event.getSource() instanceof ComboFieldEditor) {
GfaClip.getInstance().updateGfaBoundsInGrid();
String prefname = ((ComboFieldEditor) event.getSource())
.getPreferenceName();
if (prefname.equals(P_COMP_COORD)) {
GfaClip.getInstance().updateGfaBoundsInGrid();
} else if (prefname.equals(P_LAYER_MERGE)) {
String nvalue = event.getNewValue().toString();
Activator.getDefault().getPreferenceStore()
.setValue(prefname, Integer.parseInt(nvalue));
}
} else if (event.getSource() instanceof IntegerFieldEditor) {
IntegerFieldEditor iField = (IntegerFieldEditor) event.getSource();
if (iField.getPreferenceName().equals(P_AUTO_FREQ)) {

View file

@ -0,0 +1,323 @@
/*
* gov.noaa.nws.ncep.ui.pgen
*
* November 2013
*
* This code has been developed by the NCEP/SIB for use in the AWIPS2 system.
*/
package gov.noaa.nws.ncep.ui.pgen;
import java.util.ArrayList;
import java.util.List;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Class used to hold the range record for a PGEN element.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11/13 J. Wu Initial Creation.
*
* </pre>
*
* @author J. Wu
* @version 0.1
*/
public class PgenRangeRecord {
public static final double RANGE_OFFSET = 10;
private List<Coordinate> points;
private List<Coordinate> extent;
private boolean closed;
/**
* @param extent
* @param points
*/
public PgenRangeRecord() {
super();
this.extent = new ArrayList<Coordinate>();
this.points = new ArrayList<Coordinate>();
this.closed = false;
}
/**
* @param extent
* @param points
*/
public PgenRangeRecord(List<Coordinate> points, boolean closed) {
super();
this.points = new ArrayList<Coordinate>();
this.extent = new ArrayList<Coordinate>();
if (points != null && points.size() > 0) {
for (Coordinate cc : points) {
this.points.add(new Coordinate(cc.x, cc.y));
}
this.extent.addAll(buildRangeBox(this.points, RANGE_OFFSET));
}
this.closed = closed;
}
/**
* @param extent
* @param points
*/
public PgenRangeRecord(Coordinate[] points, boolean closed) {
super();
this.points = new ArrayList<Coordinate>();
this.extent = new ArrayList<Coordinate>();
if (points != null && points.length > 0) {
for (Coordinate cc : points) {
this.points.add(new Coordinate(cc.x, cc.y));
}
this.extent.addAll(buildRangeBox(this.points, RANGE_OFFSET));
}
this.closed = closed;
}
/**
* @param extent
* @param points
*/
public PgenRangeRecord(List<Coordinate> extent, List<Coordinate> points,
boolean closed) {
super();
this.extent = extent;
this.points = points;
this.closed = closed;
}
/**
* @return the extent
*/
public List<Coordinate> getExtent() {
return extent;
}
/**
* @return the extent
*/
public List<Coordinate> getExtentWithoutBuffer() {
List<Coordinate> rngBox = new ArrayList<Coordinate>();
rngBox.add(new Coordinate(this.extent.get(0).x + RANGE_OFFSET,
this.extent.get(0).y - PgenRangeRecord.RANGE_OFFSET));
rngBox.add(new Coordinate(this.extent.get(1).x - RANGE_OFFSET,
this.extent.get(1).y - RANGE_OFFSET));
rngBox.add(new Coordinate(this.extent.get(2).x - RANGE_OFFSET,
this.extent.get(2).y + RANGE_OFFSET));
rngBox.add(new Coordinate(this.extent.get(3).x + RANGE_OFFSET,
this.extent.get(3).y + RANGE_OFFSET));
return rngBox;
}
/**
* @param extent
* the extent to set
*/
public void setExtent(List<Coordinate> extent) {
this.extent = extent;
}
/**
* @param extent
* @param points
*/
public void setRange(List<Coordinate> extent, List<Coordinate> points,
boolean closed) {
this.extent = extent;
this.points = points;
this.closed = closed;
}
/**
* @return the points
*/
public List<Coordinate> getPoints() {
return points;
}
/**
* @param points
* the points to set
*/
public void setPoints(List<Coordinate> points) {
this.points = points;
}
/**
* @return the closed flag
*/
public boolean isClosed() {
return closed;
}
/**
* @param closed
* the closed to set
*/
public void setClosed(boolean closed) {
this.closed = closed;
}
/**
* @param points
* the points to set
*/
public void setPointsOnly(List<Coordinate> points, boolean closed) {
if (points != null) {
if (points != null && points.size() > 0) {
for (Coordinate cc : points) {
this.points.add(new Coordinate(cc.x, cc.y));
}
this.extent.addAll(buildRangeBox(this.points, RANGE_OFFSET));
}
}
this.closed = closed;
}
/**
* @param extent
* @param points
*/
public static List<Coordinate> buildRangeBox(List<Coordinate> points,
double buffer) {
List<Coordinate> rangeBox = new ArrayList<Coordinate>();
// Find the extent in x, y direction.
double max_x = points.get(0).x;
double max_y = points.get(0).y;
double min_x = points.get(0).x;
double min_y = points.get(0).y;
for (Coordinate pp : points) {
max_x = Math.max(max_x, pp.x);
min_x = Math.min(min_x, pp.x);
max_y = Math.max(max_y, pp.y);
min_y = Math.min(min_y, pp.y);
}
// Add buffer
max_x += buffer;
min_x -= buffer;
max_y += buffer;
min_y -= buffer;
// Build a rectangle (start from lower_left, go counter clockwise.
rangeBox.add(new Coordinate(min_x, max_y));
rangeBox.add(new Coordinate(max_x, max_y));
rangeBox.add(new Coordinate(max_x, min_y));
rangeBox.add(new Coordinate(min_x, min_y));
return rangeBox;
}
/**
* @return the max in x direction
*/
public double getMaxx() {
if (extent != null && extent.size() > 2) {
return Math.max(extent.get(0).x, extent.get(2).x);
} else {
return Double.NaN;
}
}
/**
* @return the min in x direction
*/
public double getMinx() {
if (extent != null && extent.size() > 2) {
return Math.min(extent.get(0).x, extent.get(2).x);
} else {
return Double.NaN;
}
}
/**
* @return the max in y direction
*/
public double getMaxy() {
if (extent != null && extent.size() > 2) {
return Math.max(extent.get(0).y, extent.get(2).y);
} else {
return Double.NaN;
}
}
/**
* @return the min in y direction
*/
public double getMiny() {
if (extent != null && extent.size() > 2) {
return Math.min(extent.get(0).y, extent.get(2).y);
} else {
return Double.NaN;
}
}
/**
* Check if this record is within another record.
*/
public boolean within(PgenRangeRecord rr) {
return (this.getMaxx() < rr.getMaxx() && this.getMinx() > rr.getMinx()
&& this.getMaxy() < rr.getMaxy() && this.getMiny() > rr
.getMiny());
}
/**
* Get the farest distance this record can placed within another record.
*/
public double maxExtention(PgenRangeRecord rr) {
double maxd = Double.MIN_VALUE;
for (int ii = 0; ii < extent.size(); ii++) {
maxd = Math.max(
maxd,
(extent.get(ii).x - rr.getExtent().get(ii).x)
* (extent.get(ii).x - rr.getExtent().get(ii).x)
+ (extent.get(ii).y - rr.getExtent().get(ii).y)
* (extent.get(ii).y - rr.getExtent().get(ii).y));
}
return Math.sqrt(maxd);
}
/**
* Deep copy
*/
public PgenRangeRecord copy() {
PgenRangeRecord newprr = new PgenRangeRecord();
if (this.points != null && this.points.size() > 0) {
for (Coordinate cc : this.points) {
newprr.getPoints().add(new Coordinate(cc.x, cc.y));
}
}
if (this.extent != null && this.extent.size() > 0) {
for (Coordinate cc : this.extent) {
newprr.getExtent().add(new Coordinate(cc.x, cc.y));
}
}
newprr.closed = closed;
return newprr;
}
}

View file

@ -8,9 +8,23 @@
package gov.noaa.nws.ncep.ui.pgen.attrdialog;
import java.util.ArrayList;
import java.awt.Color;
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
import gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.VaaCloudDlg;
import gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.VolcanoVaaAttrDlg;
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
import gov.noaa.nws.ncep.ui.pgen.elements.DECollection;
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
import gov.noaa.nws.ncep.ui.pgen.elements.Jet;
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
import gov.noaa.nws.ncep.ui.pgen.sigmet.AbstractSigmet;
import gov.noaa.nws.ncep.ui.pgen.sigmet.Sigmet;
import java.awt.Color;
import java.util.ArrayList;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
@ -21,26 +35,14 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.ui.editor.AbstractEditor;
import gov.noaa.nws.ncep.ui.pgen.PgenUtil;
import gov.noaa.nws.ncep.ui.pgen.rsc.PgenResource;
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
import gov.noaa.nws.ncep.ui.pgen.elements.DECollection;
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
import gov.noaa.nws.ncep.ui.pgen.elements.Jet;
//import gov.noaa.nws.ncep.viz.ui.display.NCMapEditor;
import gov.noaa.nws.ncep.ui.pgen.sigmet.*;
import gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.*;
/**
* This class is the abstract class that all PGEN attribute dialogs
* extend from.
* This class is the abstract class that all PGEN attribute dialogs extend from.
*
* <pre>
* SOFTWARE HISTORY
@ -62,454 +64,492 @@ import gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.*;
* 03/13 #928 B. Yin Make the button bar smaller.
* 04/13 #874 B. Yin Handle collection when OK is pressed for multi-selection.
* 04/13 TTR399 J. Wu Make the dialog compact
*
*
* </pre>
*
* @author B. Yin
* @author B. Yin
*/
//public abstract class AttrDlg extends CaveJFACEDialog implements IAttribute {
// public abstract class AttrDlg extends CaveJFACEDialog implements IAttribute {
public abstract class AttrDlg extends Dialog implements IAttribute {
public static int ctrlBtnWidth = 70;
public static int ctrlBtnHeight = 28;
// public static int ctrlBtnWidth = 90;
// public static int ctrlBtnHeight = 30;
/**
* A handler to the current PGEN drawing layer, which is used to
* get the selected element.
*/
protected PgenResource drawingLayer = null;
/**
* A handler to the current map editor. The map editor is used to
* redraw the drawing layer when user click on 'OK'.
*/
// protected NCMapEditor mapEditor = null;
protected AbstractEditor mapEditor = null;
protected String pgenCategory = null;
protected String pgenType = null;
protected static final int CHK_WIDTH = 16;
protected static final int CHK_HEIGHT = 28;
protected static String mouseHandlerName = null;
protected static AbstractDrawableComponent de = null;
protected Point shellLocation;
/**
* AttrDlg constructor
* @param parShell
* @throws VizException
*/
public AttrDlg(Shell parShell) throws VizException {
public static int ctrlBtnWidth = 70;
public static int ctrlBtnHeight = 28;
// public static int ctrlBtnWidth = 90;
// public static int ctrlBtnHeight = 30;
/**
* A handler to the current PGEN drawing layer, which is used to get the
* selected element.
*/
protected PgenResource drawingLayer = null;
/**
* A handler to the current map editor. The map editor is used to redraw the
* drawing layer when user click on 'OK'.
*/
protected AbstractEditor mapEditor = null;
protected String pgenCategory = null;
protected String pgenType = null;
protected static final int CHK_WIDTH = 16;
protected static final int CHK_HEIGHT = 28;
protected static String mouseHandlerName = null;
protected static AbstractDrawableComponent de = null;
protected Point shellLocation;
/**
* AttrDlg constructor
*
* @param parShell
* @throws VizException
*/
public AttrDlg(Shell parShell) throws VizException {
super(parShell);
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE );
}
this.setShellStyle(SWT.TITLE | SWT.MODELESS | SWT.CLOSE);
@Override
public void createButtonsForButtonBar(Composite parent){
((GridLayout)parent.getLayout()).verticalSpacing = 0;
((GridLayout)parent.getLayout()).marginHeight = 3;
super.createButtonsForButtonBar(parent);
this.getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
this.getButton(IDialogConstants.OK_ID).setEnabled(false);
this.getButton(IDialogConstants.CANCEL_ID).setLayoutData( new GridData(ctrlBtnWidth,ctrlBtnHeight));
this.getButton(IDialogConstants.OK_ID).setLayoutData( new GridData(ctrlBtnWidth,ctrlBtnHeight));
}
@Override
public Control createButtonBar(Composite parent){
Control bar = super.createButtonBar(parent);
GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.heightHint = ctrlBtnHeight + 5;
bar.setLayoutData(gd);
return bar;
}
/*
* Called when "X" button on window is clicked.
* @see org.eclipse.jface.window.Window#handleShellCloseEvent()
*/
@Override
public void handleShellCloseEvent() {
drawingLayer.removeSelected();
drawingLayer.removeGhostLine();
super.handleShellCloseEvent();
PgenUtil.setSelectingMode();
}
public abstract void setAttrForDlg(IAttribute ia);
/**
* Sets the PGEN drawing layer
* @param dl
*/
public void setDrawingLayer( PgenResource dl ){
this.drawingLayer = dl;
}
/**
* Sets the map editor
* @param me
*/
// public void setMapEditor( NCMapEditor me ){
public void setMapEditor( AbstractEditor me ){
this.mapEditor = me;
}
/**
* Updates the selected element and redraws the PGEN layer.
*/
public void okPressed(){
/*
* JetBarb/Jet/Hash/JetText cannot be multi-selected and they are
* separated from those that can be multi-selected.
*/
DrawableElement de = drawingLayer.getSelectedDE();
if ( de != null &&
( de instanceof Jet.JetBarb ||
de instanceof Jet.JetHash ||
de instanceof Jet.JetText ||
de instanceof Jet.JetLine ) ){
DrawableElement newEl = (DrawableElement)de.copy();
//for jet barb, we need replace the whole jet for undo working
if ( de instanceof Jet.JetBarb ){
DECollection wind = (DECollection) de.getParent();
if ( wind != null && wind.getCollectionName().equalsIgnoreCase("WindInfo")){
DECollection parent = (DECollection) wind.getParent();
if( parent != null && parent.getCollectionName().equalsIgnoreCase("jet")){
Jet oldJet = (Jet)parent;
Jet newJet = oldJet.copy();
DECollection newWind = wind.copy();
newJet.replace(newJet.getNearestComponent(((Jet.JetBarb)de).getLocation()), newWind);
drawingLayer.replaceElement(oldJet, newJet);
newWind.replace(newWind.getNearestComponent(((Jet.JetBarb)de).getLocation()), newEl);
if (newEl instanceof Jet.JetBarb ){
newEl.update(this);
((Jet.JetBarb) newEl).setSpeed(((Jet.JetBarb)newEl).getSpeed());
JetAttrDlg.getInstance(this.getShell()).updateBarbTemplate( (Jet.JetBarb)newEl );
}
}
}
}
else {
newEl.update(this);
drawingLayer.replaceElement(de, newEl);
//reset the jet line attributes
if ( de instanceof Jet.JetLine){
AbstractDrawableComponent adc = AttrSettings.getInstance().getSettings().get( "JET" );
if ( adc instanceof Jet ){
((Jet)adc).getJetLine().update(this);
}
}
else if ( de instanceof Jet.JetHash ){
JetAttrDlg.getInstance(this.getShell()).updateHashTemplate((Jet.JetHash)newEl );
}
else if ( de instanceof Jet.JetText ){
JetAttrDlg.getInstance(this.getShell()).updateFlTemplate((Jet.JetText)newEl );
}
}
drawingLayer.removeSelected();
drawingLayer.setSelected(newEl);
}
else {
ArrayList<AbstractDrawableComponent> adcList = null;
ArrayList<AbstractDrawableComponent> newList = new ArrayList<AbstractDrawableComponent>() ;
// get the list of selected elements
if ( drawingLayer != null ) {
adcList = (ArrayList<AbstractDrawableComponent>) drawingLayer.getAllSelected();
}
if ( adcList != null && !adcList.isEmpty() ){
DrawableElement newEl = null;
//loop through the list and update attributes
for ( AbstractDrawableComponent adc : adcList){
DrawableElement el = adc.getPrimaryDE();
if ( el != null ){
// Create a copy of the currently selected element
newEl = (DrawableElement)el.copy();
// Update the new Element with these current attributes
newEl.update(this);
if ( adc instanceof DECollection && el.getParent() == adc ){
//for collections
DECollection dec = (DECollection) adc.copy();
dec.remove(dec.getPrimaryDE());
dec.add(0, newEl);
newList.add(dec);
}
else {
newList.add(newEl);
}
}
}
if ( newEl != null ){
AttrSettings.getInstance().setSettings( newEl );
}
ArrayList<AbstractDrawableComponent> oldList = new ArrayList<AbstractDrawableComponent>(adcList);
drawingLayer.replaceElements(null, oldList, newList);
}
drawingLayer.removeSelected();
//set new elements as selected
for ( AbstractDrawableComponent adc : newList ){
drawingLayer.addSelected(adc);
}
}
if ( mapEditor != null ) {
mapEditor.refresh();
}
}
/**
* Removes ghost line, handle bars, and closes the dialog
*/
public void cancelPressed(){
drawingLayer.removeSelected();
drawingLayer.removeGhostLine();
super.cancelPressed();
}
/**
* Set the location of the dialog
*/
public int open(){
if ( this.getShell() == null ){
this.create();
}
if(shellLocation == null){
this.getShell().setLocation(this.getShell().getParent().getLocation());
} else {
getShell().setLocation(shellLocation);
}
final Shell shell = this.getShell();
// When the editor pane is being activated, the tool manager will re-activate all tools and thus
// the PGEN attribute dialog will re-open. However if the PGEN palette gets activated by a mouse
// click (or mouse over) before the attribute dialog is open, you will get an exception that
// activates PGEN palette in the middle of activating the editor. The reason why this happens is that
// the shell open() method forces the display to dispatch the click event on PGEN palette, which
// activates the PGEN palette.
// To prevent this happens, the super.open() method must be invoked after the editor has been activated.
// We put super.open() in the UI thread, which is the same thread the activation is running, so that
// it is invoked after the activation. --bingfan 8/10/12
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
// while (Display.getDefault().readAndDispatch()) {
//wait for events to finish before continue
// }
if (!( shell == null || shell.isDisposed() )) { // make sure the dialog is not closed
AttrDlg.super.open();
}
}
});
return OK;
}
/**
* Save location of the dialog.
*/
public boolean close() {
if(getShell() != null){
Rectangle bounds = getShell().getBounds();
shellLocation = new Point(bounds.x, bounds.y);
}
return super.close();
}
/**
* Enables the 'OK' button and the 'Cancel' button
*/
public void enableButtons(){
this.getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
this.getButton(IDialogConstants.OK_ID).setEnabled(true);
}
/**
* Sets the Pgen type, which will be used when creating an new
* element from the 'Place symbol' button
* @param pgenType
*/
public void setPgenType( String pgenType ){
this.pgenType = pgenType;
}
/**
* Sets the Pgen type, which will be used when creating an new
* element from the 'Place symbol' button
* @param pgenType
*/
public void setPgenCategory( String pgenCategory ){
this.pgenCategory = pgenCategory;
}
/**
* Common interface for ISinglePoint and IMultiPoint.
*/
public Color[] getColors(){
return null;
}
public float getLineWidth(){
return 1.0f;
}
public double getSizeScale(){
return 1.0;
}
public String getType(){
return null;
}
//to be override by subclasses
public void setType(String type){
}
/**
@Override
public void createButtonsForButtonBar(Composite parent) {
((GridLayout) parent.getLayout()).verticalSpacing = 0;
((GridLayout) parent.getLayout()).marginHeight = 3;
super.createButtonsForButtonBar(parent);
this.getButton(IDialogConstants.CANCEL_ID).setEnabled(false);
this.getButton(IDialogConstants.OK_ID).setEnabled(false);
this.getButton(IDialogConstants.CANCEL_ID).setLayoutData(
new GridData(ctrlBtnWidth, ctrlBtnHeight));
this.getButton(IDialogConstants.OK_ID).setLayoutData(
new GridData(ctrlBtnWidth, ctrlBtnHeight));
}
@Override
public Control createButtonBar(Composite parent) {
Control bar = super.createButtonBar(parent);
GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
gd.heightHint = ctrlBtnHeight + 5;
bar.setLayoutData(gd);
return bar;
}
/*
* Called when "X" button on window is clicked.
*
* @see org.eclipse.jface.window.Window#handleShellCloseEvent()
*/
@Override
public void handleShellCloseEvent() {
drawingLayer.removeSelected();
drawingLayer.removeGhostLine();
super.handleShellCloseEvent();
PgenUtil.setSelectingMode();
}
public abstract void setAttrForDlg(IAttribute ia);
/**
* Sets the PGEN drawing layer
*
* @param dl
*/
public void setDrawingLayer(PgenResource dl) {
this.drawingLayer = dl;
}
/**
* Sets the map editor
*
* @param me
*/
// public void setMapEditor( NCMapEditor me ){
public void setMapEditor(AbstractEditor me) {
this.mapEditor = me;
}
/**
* Updates the selected element and redraws the PGEN layer.
*/
public void okPressed() {
/*
* JetBarb/Jet/Hash/JetText cannot be multi-selected and they are
* separated from those that can be multi-selected.
*/
DrawableElement de = drawingLayer.getSelectedDE();
if (de != null
&& (de instanceof Jet.JetBarb || de instanceof Jet.JetHash
|| de instanceof Jet.JetText || de instanceof Jet.JetLine)) {
DrawableElement newEl = (DrawableElement) de.copy();
// for jet barb, we need replace the whole jet for undo working
if (de instanceof Jet.JetBarb) {
DECollection wind = (DECollection) de.getParent();
if (wind != null
&& wind.getCollectionName()
.equalsIgnoreCase("WindInfo")) {
DECollection parent = (DECollection) wind.getParent();
if (parent != null
&& parent.getCollectionName().equalsIgnoreCase(
"jet")) {
Jet oldJet = (Jet) parent;
Jet newJet = oldJet.copy();
DECollection newWind = wind.copy();
newJet.replace(newJet
.getNearestComponent(((Jet.JetBarb) de)
.getLocation()), newWind);
drawingLayer.replaceElement(oldJet, newJet);
newWind.replace(newWind
.getNearestComponent(((Jet.JetBarb) de)
.getLocation()), newEl);
if (newEl instanceof Jet.JetBarb) {
newEl.update(this);
((Jet.JetBarb) newEl)
.setSpeed(((Jet.JetBarb) newEl).getSpeed());
JetAttrDlg.getInstance(this.getShell())
.updateBarbTemplate((Jet.JetBarb) newEl);
}
}
}
} else {
newEl.update(this);
drawingLayer.replaceElement(de, newEl);
// reset the jet line attributes
if (de instanceof Jet.JetLine) {
AbstractDrawableComponent adc = AttrSettings.getInstance()
.getSettings().get("JET");
if (adc instanceof Jet) {
((Jet) adc).getJetLine().update(this);
}
} else if (de instanceof Jet.JetHash) {
JetAttrDlg.getInstance(this.getShell()).updateHashTemplate(
(Jet.JetHash) newEl);
} else if (de instanceof Jet.JetText) {
JetAttrDlg.getInstance(this.getShell()).updateFlTemplate(
(Jet.JetText) newEl);
}
}
drawingLayer.removeSelected();
drawingLayer.setSelected(newEl);
} else {
ArrayList<AbstractDrawableComponent> adcList = null;
ArrayList<AbstractDrawableComponent> newList = new ArrayList<AbstractDrawableComponent>();
// get the list of selected elements
if (drawingLayer != null) {
adcList = (ArrayList<AbstractDrawableComponent>) drawingLayer
.getAllSelected();
}
if (adcList != null && !adcList.isEmpty()) {
DrawableElement newEl = null;
// loop through the list and update attributes
for (AbstractDrawableComponent adc : adcList) {
DrawableElement el = adc.getPrimaryDE();
if (el != null) {
// Create a copy of the currently selected element
newEl = (DrawableElement) el.copy();
// Update the new Element with these current attributes
newEl.update(this);
if (adc instanceof DECollection
&& el.getParent() == adc) {
// for collections
DECollection dec = (DECollection) adc.copy();
dec.remove(dec.getPrimaryDE());
dec.add(0, newEl);
newList.add(dec);
} else {
newList.add(newEl);
}
}
}
if (newEl != null) {
AttrSettings.getInstance().setSettings(newEl);
}
ArrayList<AbstractDrawableComponent> oldList = new ArrayList<AbstractDrawableComponent>(
adcList);
drawingLayer.replaceElements(null, oldList, newList);
}
drawingLayer.removeSelected();
// set new elements as selected
for (AbstractDrawableComponent adc : newList) {
drawingLayer.addSelected(adc);
}
}
if (mapEditor != null) {
mapEditor.refresh();
}
}
/**
* Removes ghost line, handle bars, and closes the dialog
*/
public void cancelPressed() {
drawingLayer.removeSelected();
drawingLayer.removeGhostLine();
super.cancelPressed();
}
/**
* Set the location of the dialog
*/
public int open() {
if (this.getShell() == null) {
this.create();
}
if (shellLocation == null) {
this.getShell().setLocation(
this.getShell().getParent().getLocation());
} else {
getShell().setLocation(shellLocation);
}
final Shell shell = this.getShell();
// When the editor pane is being activated, the tool manager will
// re-activate all tools and thus
// the PGEN attribute dialog will re-open. However if the PGEN palette
// gets activated by a mouse
// click (or mouse over) before the attribute dialog is open, you will
// get an exception that
// activates PGEN palette in the middle of activating the editor. The
// reason why this happens is that
// the shell open() method forces the display to dispatch the click
// event on PGEN palette, which
// activates the PGEN palette.
// To prevent this happens, the super.open() method must be invoked
// after the editor has been activated.
// We put super.open() in the UI thread, which is the same thread the
// activation is running, so that
// it is invoked after the activation. --bingfan 8/10/12
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
// while (Display.getDefault().readAndDispatch()) {
// wait for events to finish before continue
// }
if (!(shell == null || shell.isDisposed())) { // make sure the
// dialog is not
// closed
AttrDlg.super.open();
}
}
});
return OK;
}
/**
* Save location of the dialog.
*/
public boolean close() {
if (getShell() != null) {
Rectangle bounds = getShell().getBounds();
shellLocation = new Point(bounds.x, bounds.y);
}
return super.close();
}
/**
* Enables the 'OK' button and the 'Cancel' button
*/
public void enableButtons() {
this.getButton(IDialogConstants.CANCEL_ID).setEnabled(true);
this.getButton(IDialogConstants.OK_ID).setEnabled(true);
}
/**
* Sets the Pgen type, which will be used when creating an new element from
* the 'Place symbol' button
*
* @param pgenType
*/
public void setPgenType(String pgenType) {
this.pgenType = pgenType;
}
/**
* Sets the Pgen type, which will be used when creating an new element from
* the 'Place symbol' button
*
* @param pgenType
*/
public void setPgenCategory(String pgenCategory) {
this.pgenCategory = pgenCategory;
}
/**
* Common interface for ISinglePoint and IMultiPoint.
*/
public Color[] getColors() {
return null;
}
public float getLineWidth() {
return 1.0f;
}
public double getSizeScale() {
return 1.0;
}
public String getType() {
return null;
}
// to be override by subclasses
public void setType(String type) {
}
/**
* Add a horizontal separator to the display.
*/
public static void addSeparator(Composite top ) {
public static void addSeparator(Composite top) {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
Label sepLbl = new Label(top, SWT.SEPARATOR | SWT.HORIZONTAL);
sepLbl.setLayoutData(gd);
}
public void setMouseHandlerName(String name){
mouseHandlerName = name;
}
public void setDrawableElement(AbstractDrawableComponent adc){
if ( adc instanceof DrawableElement ){
DrawableElement de = (DrawableElement)adc;
if("INTL_SIGMET".equals(pgenType)){
((SigmetAttrDlg)this).setSigmet(de);
((SigmetAttrDlg)this).copyEditableAttrToSigmetAttrDlg((Sigmet)de);
}else if("VOLC_SIGMET".equals(pgenType)){
((VolcanoVaaAttrDlg)this).setVolcano(de);
}else if("VACL_SIGMET".equals(pgenType)){
((VaaCloudDlg)this).setSigmet(de);
} else if("SIGMET".equalsIgnoreCase(pgenCategory)){
if("CCFP_SIGMET".equals(pgenType)) {
((gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.CcfpAttrDlg)this).setAbstractSigmet(de);
return;
}
((SigmetCommAttrDlg)this).setAbstractSigmet(de);
((SigmetCommAttrDlg)this).copyEditableAttrToSigmetAttrDlg((AbstractSigmet)de);
}
else {
AttrDlg.de = de;
}
}
else {
AttrDlg.de = adc;
}
}
public AbstractDrawableComponent getDrawableElement(){
return de;
public void setMouseHandlerName(String name) {
mouseHandlerName = name;
}
/**
* Set default attributes for the current pgen type.
*/
public void setDefaultAttr(){
public void setDrawableElement(AbstractDrawableComponent adc) {
if (adc instanceof DrawableElement) {
DrawableElement de = (DrawableElement) adc;
if ("INTL_SIGMET".equals(pgenType)) {
((SigmetAttrDlg) this).setSigmet(de);
((SigmetAttrDlg) this)
.copyEditableAttrToSigmetAttrDlg((Sigmet) de);
} else if ("VOLC_SIGMET".equals(pgenType)) {
((VolcanoVaaAttrDlg) this).setVolcano(de);
} else if ("VACL_SIGMET".equals(pgenType)) {
((VaaCloudDlg) this).setSigmet(de);
} else if ("SIGMET".equalsIgnoreCase(pgenCategory)) {
AbstractDrawableComponent adc = AttrSettings.getInstance().getSettings().get( pgenType );
if ( adc != null ) {
setAttr( adc );
}
if ("CCFP_SIGMET".equals(pgenType)) {
((gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.CcfpAttrDlg) this)
.setAbstractSigmet(de);
return;
}
((SigmetCommAttrDlg) this).setAbstractSigmet(de);
((SigmetCommAttrDlg) this)
.copyEditableAttrToSigmetAttrDlg((AbstractSigmet) de);
} else {
AttrDlg.de = de;
}
} else {
AttrDlg.de = adc;
}
}
public AbstractDrawableComponent getDrawableElement() {
return de;
}
/**
* Set dialog attributes with values of adc.
*/
public void setAttr( AbstractDrawableComponent adc ){
if ( adc instanceof IAttribute ){
setAttrForDlg( (IAttribute)adc);
}
* Set default attributes for the current pgen type.
*/
public void setDefaultAttr() {
AbstractDrawableComponent adc = AttrSettings.getInstance()
.getSettings().get(pgenType);
if (adc != null) {
setAttr(adc);
}
}
/**
* Set dialog attributes with values of adc.
*/
public void setAttr(AbstractDrawableComponent adc) {
if (adc instanceof IAttribute) {
setAttrForDlg((IAttribute) adc);
}
}
/**
* check if it is in 'add line' mode (for labeled lines)
*
* @return
*/
public boolean isAddLineMode(){
return false;
public boolean isAddLineMode() {
return false;
}
/**
* reset toggle buttons for labeled line dialog
*/
public void resetLabeledLineBtns(){
}
/*
* Create a GridLayout without any spacing and no equal width.
*/
protected GridLayout getCompactGridLayout(int numCol) {
return getGridLayout( numCol,false, 0, 0, 0, 0);
}
public void resetLabeledLineBtns() {
/*
* Create a GridLayout with specified numCol, equal_width, marginHeight,
* marginWidth, horizontalSpacing, and verticalSpacing
*/
protected GridLayout getGridLayout(int numCol, boolean equal_width,
int marginHeight, int marginWidth, int horizontalSpacing, int verticalSpacing) {
GridLayout gl = new GridLayout( numCol, equal_width );
}
/*
* Create a GridLayout without any spacing and no equal width.
*/
protected GridLayout getCompactGridLayout(int numCol) {
return getGridLayout(numCol, false, 0, 0, 0, 0);
}
/*
* Create a GridLayout with specified numCol, equal_width, marginHeight,
* marginWidth, horizontalSpacing, and verticalSpacing
*/
protected GridLayout getGridLayout(int numCol, boolean equal_width,
int marginHeight, int marginWidth, int horizontalSpacing,
int verticalSpacing) {
GridLayout gl = new GridLayout(numCol, equal_width);
gl.marginHeight = marginHeight;
gl.marginWidth = marginWidth;
gl.horizontalSpacing = horizontalSpacing;
gl.verticalSpacing = verticalSpacing;
return gl;
}
return gl;
}
}

View file

@ -8,14 +8,15 @@
package gov.noaa.nws.ncep.ui.pgen.attrdialog;
import gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.VaaCloudDlg;
import gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.VolcanoVaaAttrDlg;
import gov.noaa.nws.ncep.ui.pgen.elements.Track;
import gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.*;
import org.eclipse.swt.widgets.Shell;
/**
* This class is to create attribute dialogs for PGEN elements.
*
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
@ -40,205 +41,200 @@ import org.eclipse.swt.widgets.Shell;
* 02/11 #318 S. Gilbert Added Distance Display Options Dialog
* 08/11 #? B. Yin Added Pgen Inc/Dec
* 06/12 #734 J. Zeng Add SPENES
* 11/13 #1065 J. Wu Added kink lines.
* </pre>
*
* @author B. Yin
* @author B. Yin
*/
public class AttrDlgFactory {
/**
* Creates attribute dialog by invoking the getInstance() method.
*
* @param pgenCategory Category corresponding to the DE's pgenCategory specifying a
* class in the Pgen Palette.
* @param parShell parent Shell
* @return
*/
public static AttrDlg createAttrDlg( String pgenCategory, String pgenType, Shell parShell ){
if ( pgenCategory == null ) {
return null;
}
if ((pgenCategory.equalsIgnoreCase("Lines")) ||
// (pgenCategory.equalsIgnoreCase("Front")) ||
((pgenType != null) && pgenType.equalsIgnoreCase("STATUS_LINE"))) {
return LineAttrDlg.getInstance( parShell );
}
else if (pgenCategory.equalsIgnoreCase("Front")) {
return FrontAttrDlg.getInstance( parShell );
}
else if ((pgenCategory.equalsIgnoreCase("Marker")) ||
(pgenCategory.equalsIgnoreCase("Symbol")) ||
(pgenCategory.equalsIgnoreCase("Combo")) ) {
if (pgenType != null && (pgenType.equalsIgnoreCase("PRESENT_WX_201"))){
return VolcanoAttrDlg.getInstance( parShell );
}
else {
AttrDlg symDlg = LabeledSymbolAttrDlg.getInstance( parShell );
symDlg.setPgenCategory(pgenCategory);
symDlg.setPgenType(pgenType);
return symDlg;
}
}
else if ( pgenCategory.equalsIgnoreCase("Text" ) ) {
if ( pgenType != null && pgenType.equalsIgnoreCase("AVIATION_TEXT") ) {
return AvnTextAttrDlg.getInstance( parShell );
}
else if ( pgenType != null && pgenType.equalsIgnoreCase("MID_LEVEL_CLOUD") ) {
return MidLevelCloudAttrDlg.getInstance( parShell );
}
else {
return TextAttrDlg.getInstance( parShell );
}
}
/**
* Creates attribute dialog by invoking the getInstance() method.
*
* @param pgenCategory
* Category corresponding to the DE's pgenCategory specifying a
* class in the Pgen Palette.
* @param parShell
* parent Shell
* @return
*/
else if ( pgenCategory.equalsIgnoreCase("Arc" ) ) {
return ArcAttrDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase(Track.TRACK_PGEN_CATEGORY) ) {
return TrackAttrDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase(Track.TRACK_INFO_DLG_CATEGORY_NAME) ) {
return TrackExtrapPointInfoDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase( "Vector" ) ) {
return VectorAttrDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase( "Extrap" ) ) {
return PgenExtrapDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase( "Interp" ) ) {
return PgenInterpDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase( "IncDec" ) ) {
return IncDecDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase( "Distance" ) ) {
return PgenDistanceDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase( "From" ) ) {
return FromAttrDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase( "Cycle" ) ) {
return CycleDlg.getInstance( parShell );
}
else if ( pgenCategory.equalsIgnoreCase( "Prod_AIRMET" ) ) {
return GfaFormatAttrDlg.getInstance( parShell );
}
else if (pgenType != null && pgenType.equalsIgnoreCase("Jet")){
return JetAttrDlg.getInstance(parShell);
}
else if (pgenType != null && pgenType.equalsIgnoreCase("Outlook")){
return OutlookAttrDlg.getInstance(parShell);
}
else if ( pgenType != null && pgenType.equalsIgnoreCase("TCA") ) {
return TcaAttrDlg.getInstance( parShell );
}
else if ( pgenType != null && pgenType.equalsIgnoreCase("WatchBox") ) {
return WatchBoxAttrDlg.getInstance( parShell );
}
else if ((pgenType != null) && pgenType.equalsIgnoreCase("SPENES")) {
return SpenesAttrDlg.getInstance( parShell );
public static AttrDlg createAttrDlg(String pgenCategory, String pgenType,
Shell parShell) {
}
else if ( pgenType != null && pgenType.equalsIgnoreCase("TCM") ) {
return TcmAttrDlg.getInstance( parShell );
}
else if ( pgenType != null && pgenType.equalsIgnoreCase("Cloud") ) {
return CloudAttrDlg.getInstance( parShell );
}
else if ( pgenType != null && pgenType.equalsIgnoreCase("Turbulence") ) {
return TurbAttrDlg.getInstance( parShell );
}
else if ( pgenType != null && pgenType.equalsIgnoreCase("Contours") ) {
return ContoursAttrDlg.getInstance( parShell );
}
else if(pgenCategory.equalsIgnoreCase("SIGMET") ){
if(pgenType != null && pgenType.equalsIgnoreCase("INTL_SIGMET")) {
SigmetAttrDlg sigAttrDlg = SigmetAttrDlg.getInstance( parShell );
sigAttrDlg.setPgenCategory(pgenCategory);
sigAttrDlg.setPgenType(pgenType);
return sigAttrDlg;
}else if(pgenType != null && pgenType.equalsIgnoreCase("VOLC_SIGMET")){
VolcanoVaaAttrDlg vaaDlg = VolcanoVaaAttrDlg.getInstance(parShell);
vaaDlg.setPgenCategory(pgenCategory);
vaaDlg.setPgenType(pgenType);
vaaDlg.setFromSelection(true);
return vaaDlg;
}else if(pgenType != null && pgenType.equalsIgnoreCase("VACL_SIGMET")){
VaaCloudDlg vacDlg = VaaCloudDlg.getInstance(parShell);
vacDlg.setPgenCategory(pgenCategory);
vacDlg.setPgenType(pgenType);
return vacDlg;
}else if(pgenType != null && pgenType.equalsIgnoreCase("CCFP_SIGMET")){
gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.CcfpAttrDlg sigAttrDlg =
gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.CcfpAttrDlg.getInstance( parShell );
sigAttrDlg.setPgenCategory(pgenCategory);
sigAttrDlg.setPgenType(pgenType);
return sigAttrDlg;
}else {//(pgenType != null && pgenType.equalsIgnoreCase("CONV_SIGMET")) {
SigmetCommAttrDlg sigAttrDlg = SigmetCommAttrDlg.getInstance( parShell );
sigAttrDlg.setPgenCategory(pgenCategory);
sigAttrDlg.setPgenType(pgenType);
return sigAttrDlg;
}
}
else if ("GFA".equalsIgnoreCase(pgenType)){
return GfaAttrDlg.getInstance( parShell );
}
else return null;
}
if (pgenCategory == null) {
return null;
}
if ((pgenCategory.equalsIgnoreCase("Lines"))
|| ((pgenType != null) && pgenType
.equalsIgnoreCase("STATUS_LINE"))) {
if ((pgenType != null)
&& (pgenType.equalsIgnoreCase("KINK_LINE_1") || pgenType
.equalsIgnoreCase("KINK_LINE_2"))) {
return KinkLineAttrDlg.getInstance(parShell);
} else {
return LineAttrDlg.getInstance(parShell);
}
} else if (pgenCategory.equalsIgnoreCase("Front")) {
return FrontAttrDlg.getInstance(parShell);
}
else if ((pgenCategory.equalsIgnoreCase("Marker"))
|| (pgenCategory.equalsIgnoreCase("Symbol"))
|| (pgenCategory.equalsIgnoreCase("Combo"))) {
if (pgenType != null
&& (pgenType.equalsIgnoreCase("PRESENT_WX_201"))) {
return VolcanoAttrDlg.getInstance(parShell);
} else {
AttrDlg symDlg = LabeledSymbolAttrDlg.getInstance(parShell);
symDlg.setPgenCategory(pgenCategory);
symDlg.setPgenType(pgenType);
return symDlg;
}
}
else if (pgenCategory.equalsIgnoreCase("Text")) {
if (pgenType != null && pgenType.equalsIgnoreCase("AVIATION_TEXT")) {
return AvnTextAttrDlg.getInstance(parShell);
} else if (pgenType != null
&& pgenType.equalsIgnoreCase("MID_LEVEL_CLOUD")) {
return MidLevelCloudAttrDlg.getInstance(parShell);
} else {
return TextAttrDlg.getInstance(parShell);
}
}
else if (pgenCategory.equalsIgnoreCase("Arc")) {
return ArcAttrDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase(Track.TRACK_PGEN_CATEGORY)) {
return TrackAttrDlg.getInstance(parShell);
} else if (pgenCategory
.equalsIgnoreCase(Track.TRACK_INFO_DLG_CATEGORY_NAME)) {
return TrackExtrapPointInfoDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("Vector")) {
return VectorAttrDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("Extrap")) {
return PgenExtrapDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("Interp")) {
return PgenInterpDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("IncDec")) {
return IncDecDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("Distance")) {
return PgenDistanceDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("From")) {
return FromAttrDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("Cycle")) {
return CycleDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("Prod_AIRMET")) {
return GfaFormatAttrDlg.getInstance(parShell);
} else if (pgenType != null && pgenType.equalsIgnoreCase("Jet")) {
return JetAttrDlg.getInstance(parShell);
} else if (pgenType != null && pgenType.equalsIgnoreCase("Outlook")) {
return OutlookAttrDlg.getInstance(parShell);
} else if (pgenType != null && pgenType.equalsIgnoreCase("TCA")) {
return TcaAttrDlg.getInstance(parShell);
} else if (pgenType != null && pgenType.equalsIgnoreCase("WatchBox")) {
return WatchBoxAttrDlg.getInstance(parShell);
} else if ((pgenType != null) && pgenType.equalsIgnoreCase("SPENES")) {
return SpenesAttrDlg.getInstance(parShell);
} else if (pgenType != null && pgenType.equalsIgnoreCase("TCM")) {
return TcmAttrDlg.getInstance(parShell);
} else if (pgenType != null && pgenType.equalsIgnoreCase("Cloud")) {
return CloudAttrDlg.getInstance(parShell);
} else if (pgenType != null && pgenType.equalsIgnoreCase("Turbulence")) {
return TurbAttrDlg.getInstance(parShell);
} else if (pgenType != null && pgenType.equalsIgnoreCase("Contours")) {
return ContoursAttrDlg.getInstance(parShell);
} else if (pgenCategory.equalsIgnoreCase("SIGMET")) {
if (pgenType != null && pgenType.equalsIgnoreCase("INTL_SIGMET")) {
SigmetAttrDlg sigAttrDlg = SigmetAttrDlg.getInstance(parShell);
sigAttrDlg.setPgenCategory(pgenCategory);
sigAttrDlg.setPgenType(pgenType);
return sigAttrDlg;
} else if (pgenType != null
&& pgenType.equalsIgnoreCase("VOLC_SIGMET")) {
VolcanoVaaAttrDlg vaaDlg = VolcanoVaaAttrDlg
.getInstance(parShell);
vaaDlg.setPgenCategory(pgenCategory);
vaaDlg.setPgenType(pgenType);
vaaDlg.setFromSelection(true);
return vaaDlg;
} else if (pgenType != null
&& pgenType.equalsIgnoreCase("VACL_SIGMET")) {
VaaCloudDlg vacDlg = VaaCloudDlg.getInstance(parShell);
vacDlg.setPgenCategory(pgenCategory);
vacDlg.setPgenType(pgenType);
return vacDlg;
} else if (pgenType != null
&& pgenType.equalsIgnoreCase("CCFP_SIGMET")) {
gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.CcfpAttrDlg sigAttrDlg = gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.CcfpAttrDlg
.getInstance(parShell);
sigAttrDlg.setPgenCategory(pgenCategory);
sigAttrDlg.setPgenType(pgenType);
return sigAttrDlg;
} else {// (pgenType != null &&
// pgenType.equalsIgnoreCase("CONV_SIGMET")) {
SigmetCommAttrDlg sigAttrDlg = SigmetCommAttrDlg
.getInstance(parShell);
sigAttrDlg.setPgenCategory(pgenCategory);
sigAttrDlg.setPgenType(pgenType);
return sigAttrDlg;
}
} else if ("GFA".equalsIgnoreCase(pgenType)) {
return GfaAttrDlg.getInstance(parShell);
}
else
return null;
}
}

View file

@ -10,6 +10,12 @@ package gov.noaa.nws.ncep.ui.pgen.attrdialog;
import gov.noaa.nws.ncep.ui.pgen.PgenStaticDataProvider;
import gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent;
import gov.noaa.nws.ncep.ui.pgen.elements.DECollection;
import gov.noaa.nws.ncep.ui.pgen.elements.DrawableElement;
import gov.noaa.nws.ncep.ui.pgen.elements.Layer;
import gov.noaa.nws.ncep.ui.pgen.elements.Line;
import gov.noaa.nws.ncep.ui.pgen.elements.Outlook;
import gov.noaa.nws.ncep.ui.pgen.elements.Product;
import gov.noaa.nws.ncep.ui.pgen.elements.Text;
import gov.noaa.nws.ncep.ui.pgen.elements.Track;
import gov.noaa.nws.ncep.ui.pgen.file.FileTools;
@ -20,6 +26,7 @@ import gov.noaa.nws.ncep.ui.pgen.productmanage.ProductConfigureDialog;
import java.io.File;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.TimeZone;
@ -41,7 +48,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
* 08/11 ? B. Yin Put current time for Storm Track
* 11/11 ? B. Yin Load settings for different Activity Type.
* 09/12 B. Hebbard Merge changes by RTS OB12.9.1 (format only, this file)
*
* 10/13 TTR768 J. Wu Load/set default attributes for outlook labels (Text).
* </pre>
*
* @author J. Wu
@ -51,13 +58,20 @@ public class AttrSettings {
private static AttrSettings INSTANCE = null;
/**
* General Settings.
*/
private static HashMap<String, AbstractDrawableComponent> settings = null;
private static String settingsTblLocal = "." + File.separator;
public static String settingsFileName = "settings_tbl.xml";
/**
/**
* Settings for outlook.
*/
public static String outlookSettingsFileName = "outlooksettings.xml";
private static HashMap<String, AbstractDrawableComponent> outlookLineSettings = null;
private static HashMap<String, AbstractDrawableComponent> outlookLabelSettings = null;
/**
* Private constructor
*
* @throws VizException
@ -66,6 +80,8 @@ public class AttrSettings {
super();
settings = new HashMap<String, AbstractDrawableComponent>();
loadSettingsTable();
loadOutlookSettings();
}
/**
@ -97,6 +113,20 @@ public class AttrSettings {
return settings;
}
/**
* Gets the default line settings for outlook loaded from the outlooksettings.xml.
*/
public HashMap<String, AbstractDrawableComponent> getOutlookLineSettings() {
return outlookLineSettings;
}
/**
* Gets the default label (text) settings for outlook loaded from the outlooksettings.xml.
*/
public HashMap<String, AbstractDrawableComponent> getOutlookLabelSettings() {
return outlookLabelSettings;
}
/**
* @param value
* the DrawableElement to set gilbert: noticed this wasn't being
@ -125,15 +155,14 @@ public class AttrSettings {
}
/**
* Load default settings from settings_tbl.xml First try to load from user's
* local directory; if not found, load the base directory.
* Load default settings from settings_tbl.xml from localization.
*/
private void loadSettingsTable() {
/*
* Get the settings table file from localization
*/
File settingsFile = PgenStaticDataProvider.getProvider().getFile(
File settingsFile = PgenStaticDataProvider.getProvider().getFile(
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot()
+ settingsFileName);
@ -144,6 +173,9 @@ public class AttrSettings {
loadPgenSettings( settingsFile.getAbsolutePath() );
}
/**
* Load default settings defined for an PGEN activity.
*/
public void loadProdSettings( String prodName ){
if ( prodName == null || prodName.isEmpty() ){
@ -171,6 +203,9 @@ public class AttrSettings {
}
}
/**
* Read in a settings file from the input file.
*/
public boolean loadPgenSettings( String fileName ){
boolean ret = false;
@ -180,57 +215,122 @@ public class AttrSettings {
File sFile = new File( fileName );
try {
if ( sFile.canRead() ){
Products products = FileTools.read( fileName );
List<gov.noaa.nws.ncep.ui.pgen.elements.Product> prds;
prds = ProductConverter.convert( products );
for ( gov.noaa.nws.ncep.ui.pgen.elements.Product p:prds ) {
for (gov.noaa.nws.ncep.ui.pgen.elements.Layer layer : p
.getLayers()) {
for (gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent de : layer
.getDrawables()) {
String pgenID = null;
pgenID = de.getPgenType();
if ( sFile.canRead() ){
Products products = FileTools.read( fileName );
if ( pgenID != null ) {
newSettings.put( pgenID, de );
}
if ( pgenID.equalsIgnoreCase("General Text")){
((Text)de).setText(new String[]{""});
} else if (pgenID.equalsIgnoreCase("STORM_TRACK")) {
//set Track time to current time
Calendar cal1 = Calendar.getInstance(TimeZone
.getTimeZone("GMT"));
Calendar cal2 = (Calendar)cal1.clone();
cal2.add(Calendar.HOUR_OF_DAY, 1);
((Track)de).setFirstTimeCalendar( cal1);
((Track)de).setSecondTimeCalendar( cal2);
List<gov.noaa.nws.ncep.ui.pgen.elements.Product> prds;
}
}
}
}
if ( newSettings.size() > 0 ) {
settings.clear();
settings.putAll(newSettings);
ret = true;
}
}
prds = ProductConverter.convert( products );
for ( gov.noaa.nws.ncep.ui.pgen.elements.Product p:prds ) {
for (gov.noaa.nws.ncep.ui.pgen.elements.Layer layer : p
.getLayers()) {
for (gov.noaa.nws.ncep.ui.pgen.elements.AbstractDrawableComponent de : layer
.getDrawables()) {
String pgenID = null;
pgenID = de.getPgenType();
if ( pgenID != null ) {
newSettings.put( pgenID, de );
}
if ( pgenID.equalsIgnoreCase("General Text")){
((Text)de).setText(new String[]{""});
} else if (pgenID.equalsIgnoreCase("STORM_TRACK")) {
//set Track time to current time
Calendar cal1 = Calendar.getInstance(TimeZone
.getTimeZone("GMT"));
Calendar cal2 = (Calendar)cal1.clone();
cal2.add(Calendar.HOUR_OF_DAY, 1);
((Track)de).setFirstTimeCalendar( cal1);
((Track)de).setSecondTimeCalendar( cal2);
}
}
}
}
if ( newSettings.size() > 0 ) {
settings.clear();
settings.putAll(newSettings);
ret = true;
}
}
} catch (Exception e) {
ret = false;
}
return ret;
}
/**
* Load default settings from outlooksettings.xml
*
* Setting is a hash map with outlook type and label string as keys.
*/
private static void loadOutlookSettings() {
if ( outlookLineSettings == null ) {
outlookLineSettings = new HashMap<String, AbstractDrawableComponent>();
}
if ( outlookLabelSettings == null ) {
outlookLabelSettings = new HashMap<String, AbstractDrawableComponent>();
}
String settingFile = PgenStaticDataProvider.getProvider().getFileAbsolutePath(
PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + outlookSettingsFileName );
gov.noaa.nws.ncep.ui.pgen.file.Products products = FileTools.read( settingFile );
if ( products != null ){
List<Product> prds;
prds = ProductConverter.convert( products );
for ( Product p:prds ) {
for ( Layer layer:p.getLayers() ) {
Iterator<AbstractDrawableComponent> it = layer.getComponentIterator();
while( it.hasNext()){
AbstractDrawableComponent adc = it.next();
if ( adc.getName().equalsIgnoreCase("OUTLOOK")) {
Iterator<AbstractDrawableComponent> itLn = ((Outlook)adc).getComponentIterator();
while ( itLn.hasNext() ){
AbstractDrawableComponent lnGrp = itLn.next();
if ( lnGrp.getName().equalsIgnoreCase(Outlook.OUTLOOK_LABELED_LINE) ) {
String key = null;
Line ln = null;
Text txt = null;
Iterator<DrawableElement> itDe = ((DECollection)lnGrp).createDEIterator();
while( itDe.hasNext() ){
DrawableElement de = itDe.next();
if( de instanceof Text ){
txt = (Text)de;
key = ((Outlook)adc).getOutlookType() + txt.getText()[0];
}
else if ( de instanceof Line ){
ln = (Line) de;
}
}
if ( key != null && ln != null ){
outlookLineSettings.put( key, ln );
outlookLabelSettings.put( key, txt );
}
}
}
}
}
}
}
}
}
}

View file

@ -17,7 +17,6 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
@ -31,235 +30,241 @@ import com.raytheon.uf.viz.core.exception.VizException;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 07/10 ? B. Yin Initial Creation.
*
* 11/13 1065 J. Wu Adjust for changes in LineAttrDLg.
*
* </pre>
*
* @author B. Yin
* @author B. Yin
*/
public class FrontAttrDlg extends LineAttrDlg {
static private FrontAttrDlg INSTANCE = null;
private Button labelChkBox;
private Button labelColorChkBox;
private boolean lastLabelStatus;
private boolean lastUseColorStatus;
static private FrontAttrDlg INSTANCE = null;
private Button labelChkBox;
private Button labelColorChkBox;
private boolean lastLabelStatus;
private boolean lastUseColorStatus;
/**
* constructor
*
* @param parShell
* @throws VizException
*/
protected FrontAttrDlg(Shell parShell) throws VizException {
/**
* constructor
* @param parShell
* @throws VizException
*/
protected FrontAttrDlg(Shell parShell) throws VizException {
super(parShell);
}
/**
* Creates a symbol attribute dialog if the dialog does not exist
* and returns the instance. If the dialog exists, return the instance.
*
* @param parShell
* @return
*/
public static FrontAttrDlg getInstance( Shell parShell){
if ( INSTANCE == null ){
try {
INSTANCE = new FrontAttrDlg( parShell );
} catch (VizException e) {
e.printStackTrace();
}
}
return INSTANCE;
}
@Override
/**
* Creates buttons, menus, and other controls in the dialog area
*/
protected void initializeComponents() {
super.initializeComponents();
Composite inCmp = new Composite( top, SWT.NONE);
inCmp.setLayout( getGridLayout( 3, false, 0, 0, 0, 0 ) );
chkBox[ChkBox.LABEL.ordinal()] = new Button(inCmp, SWT.CHECK);
chkBox[ChkBox.LABEL.ordinal()] .setLayoutData(new GridData(CHK_WIDTH,CHK_HEIGHT));
chkBox[ChkBox.LABEL.ordinal()].addSelectionListener(new SelectionAdapter(){
/**
* Creates a symbol attribute dialog if the dialog does not exist and
* returns the instance. If the dialog exists, return the instance.
*
* @param parShell
* @return
*/
public static FrontAttrDlg getInstance(Shell parShell) {
@Override
public void widgetSelected(SelectionEvent e) {
Button btn = (Button)e.widget;
if(btn.getSelection()){
labelChkBox.setEnabled(true);
}
else {
labelChkBox.setEnabled(false);
}
}
if (INSTANCE == null) {
});
chkBox[ChkBox.LABEL.ordinal()].setVisible(false);
labelChkBox = new Button(inCmp, SWT.CHECK);
labelChkBox.setText("Label");
labelColorChkBox = new Button(inCmp, SWT.CHECK);
labelColorChkBox.setText("Use Front Color");
try {
labelChkBox.addListener( SWT.MouseUp, new Listener(){
INSTANCE = new FrontAttrDlg(parShell);
@Override
public void handleEvent(Event event) {
if (((Button)event.widget).getSelection()){
labelColorChkBox.setEnabled(true);
}
else {
labelColorChkBox.setEnabled(false);
} catch (VizException e) {
}
lastLabelStatus = ((Button)event.widget).getSelection();
}
});
labelColorChkBox.addListener( SWT.MouseUp, new Listener(){
e.printStackTrace();
@Override
public void handleEvent(Event event) {
lastUseColorStatus = ((Button)event.widget).getSelection();
}
});
if ( de != null && de.getPgenType().equalsIgnoreCase(this.pgenType)){
labelChkBox.setSelection(lastLabelStatus);
labelColorChkBox.setSelection(lastUseColorStatus);
}
else {
labelChkBox.setSelection(false);
labelColorChkBox.setSelection(false);
lastLabelStatus = false;
lastUseColorStatus = false;
}
}
/**
* Check if the label box is checked
*/
public boolean labelEnabled(){
return labelChkBox.getSelection();
}
/**
* Check if the 'Use Symbol Color' box is checked.
* @return
*/
public boolean useFrontColor(){
return labelColorChkBox.getSelection();
}
/**
* Set the 'Label' check box
* @param enabled
*/
public void setLabelChkBox( boolean enabled ){
labelChkBox.setEnabled(enabled);
}
}
if ( !labelChkBox.isEnabled() || !labelChkBox.getSelection() ){
labelColorChkBox.setEnabled(false);
}
}
@Override
public int open(){
this.create();
return INSTANCE;
}
@Override
/**
* Creates buttons, menus, and other controls in the dialog area
*/
protected void initializeComponents() {
super.initializeComponents();
Composite inCmp = new Composite(top, SWT.NONE);
inCmp.setLayout(getGridLayout(3, false, 0, 0, 0, 0));
chkBox[ChkBox.LABEL.ordinal()] = new Button(inCmp, SWT.CHECK);
chkBox[ChkBox.LABEL.ordinal()].setLayoutData(new GridData(CHK_WIDTH,
CHK_HEIGHT));
chkBox[ChkBox.LABEL.ordinal()]
.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Button btn = (Button) e.widget;
if (btn.getSelection()) {
labelChkBox.setEnabled(true);
} else {
labelChkBox.setEnabled(false);
}
}
});
chkBox[ChkBox.LABEL.ordinal()].setVisible(false);
labelChkBox = new Button(inCmp, SWT.CHECK);
labelChkBox.setText("Label");
labelColorChkBox = new Button(inCmp, SWT.CHECK);
labelColorChkBox.setText("Use Front Color");
labelChkBox.addListener(SWT.MouseUp, new Listener() {
@Override
public void handleEvent(Event event) {
if (((Button) event.widget).getSelection()) {
labelColorChkBox.setEnabled(true);
} else {
labelColorChkBox.setEnabled(false);
}
lastLabelStatus = ((Button) event.widget).getSelection();
}
});
labelColorChkBox.addListener(SWT.MouseUp, new Listener() {
@Override
public void handleEvent(Event event) {
lastUseColorStatus = ((Button) event.widget).getSelection();
}
});
if (de != null && de.getPgenType().equalsIgnoreCase(this.pgenType)) {
labelChkBox.setSelection(lastLabelStatus);
labelColorChkBox.setSelection(lastUseColorStatus);
} else {
labelChkBox.setSelection(false);
labelColorChkBox.setSelection(false);
lastLabelStatus = false;
lastUseColorStatus = false;
}
}
/**
* Check if the label box is checked
*/
public boolean labelEnabled() {
return labelChkBox.getSelection();
}
/**
* Check if the 'Use Symbol Color' box is checked.
*
* @return
*/
public boolean useFrontColor() {
return labelColorChkBox.getSelection();
}
/**
* Set the 'Label' check box
*
* @param enabled
*/
public void setLabelChkBox(boolean enabled) {
labelChkBox.setEnabled(enabled);
if (!labelChkBox.isEnabled() || !labelChkBox.getSelection()) {
labelColorChkBox.setEnabled(false);
}
}
@Override
public int open() {
this.create();
int rt = super.open();
//if current action is MultiSelect, make the check boxes visible
if ( PgenSession.getInstance().getPgenPalette().getCurrentAction()
.equalsIgnoreCase("MultiSelect")){
enableChkBoxes(true);
enableAllWidgets(false);
}
else {
enableAllWidgets(true);
enableChkBoxes(false);
}
// if current action is MultiSelect, make the check boxes visible
if (PgenSession.getInstance().getPgenPalette().getCurrentAction()
.equalsIgnoreCase("MultiSelect")) {
enableChkBoxes(true);
enableAllWidgets(false);
} else {
enableAllWidgets(true);
enableChkBoxes(false);
}
this.getShell().setText("Front Attributes");
this.getShell().setText("Front Attributes");
return rt;
}
/**
* Make the check boxes visible/invisible
* @param flag
*/
private void enableChkBoxes(boolean flag){
if(!flag) {
setAllChkBoxes();
}
for ( ChkBox chk : ChkBox.values()){
chkBox[chk.ordinal()].setVisible(flag);
}
chkBox[ChkBox.LABEL.ordinal()].setVisible(false);
return rt;
}
}
/**
* Enable/disable all widgets in the dialog
* @param flag
*/
private void enableAllWidgets(boolean flag){
colorLbl.setEnabled(flag);
patternSizeLbl.setEnabled(flag);
widthLbl.setEnabled(flag);
widthSpinnerSlider.setEnabled(flag);
smoothLbl.setEnabled(flag);
smoothLvlCbo.setEnabled(flag);
closedBtn.setEnabled(false);
filledBtn.setEnabled(false);
fillPatternLbl.setEnabled(false);
fillPatternCbo.setEnabled(false);
labelChkBox.setEnabled(flag);
/**
* Make the check boxes visible/invisible
*
* @param flag
*/
private void enableChkBoxes(boolean flag) {
}
/**
* Set all multi-selection check boxes to true.
*/
private void setAllChkBoxes(){
for ( ChkBox chk : ChkBox.values()){
chkBox[chk.ordinal()].setSelection(true);
}
}
if (!flag) {
setAllChkBoxes();
}
for (ChkBox chk : ChkBox.values()) {
if (chkBox[chk.ordinal()] != null) {
chkBox[chk.ordinal()].setSelection(true);
}
}
chkBox[ChkBox.LABEL.ordinal()].setVisible(false);
}
/**
* Enable/disable all widgets in the dialog
*
* @param flag
*/
private void enableAllWidgets(boolean flag) {
colorLbl.setEnabled(flag);
patternSizeLbl.setEnabled(flag);
widthLbl.setEnabled(flag);
widthSpinnerSlider.setEnabled(flag);
smoothLbl.setEnabled(flag);
smoothLvlCbo.setEnabled(flag);
closedBtn.setEnabled(false);
filledBtn.setEnabled(false);
fillPatternLbl.setEnabled(false);
fillPatternCbo.setEnabled(false);
labelChkBox.setEnabled(flag);
}
/**
* Set all multi-selection check boxes to true.
*/
private void setAllChkBoxes() {
for (ChkBox chk : ChkBox.values()) {
if (chkBox[chk.ordinal()] != null) {
chkBox[chk.ordinal()].setSelection(true);
}
}
}
}

View file

@ -0,0 +1,355 @@
/*
* gov.noaa.nws.ncep.ui.pgen.attrDialog.KinkLineAttrDlg
*
* Nov. 17, 2013
*
* This code has been developed by the NCEP/SIB for use in the AWIPS2 system.
*/
package gov.noaa.nws.ncep.ui.pgen.attrdialog;
import gov.noaa.nws.ncep.ui.pgen.PgenSession;
import gov.noaa.nws.ncep.ui.pgen.display.ArrowHead.ArrowHeadType;
import gov.noaa.nws.ncep.ui.pgen.display.IAttribute;
import gov.noaa.nws.ncep.ui.pgen.display.IKink;
import java.awt.Color;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.viz.core.exception.VizException;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Singleton attribute dialog for PGEN kink lines.
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11/13 TTR 850 J. Wu Initial Creation.
* 01/14 TTR 850 J. Wu Update kink position.
*
* </pre>
*
* @author J. Wu
*/
public class KinkLineAttrDlg extends LineAttrDlg implements IKink {
static private KinkLineAttrDlg INSTANCE = null;
protected static double MIN_KINK_LINE_POS = 0.25;
protected static double MAX_KINK_LINE_POS = 0.75;
protected Label kinkPosLbl;
protected gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.SpinnerSlider kinkPosSpinnerSlider = null;
/**
* constructor
*
* @param parShell
* @throws VizException
*/
protected KinkLineAttrDlg(Shell parShell) throws VizException {
super(parShell);
}
/**
* Creates a symbol attribute dialog if the dialog does not exist and
* returns the instance. If the dialog exists, return the instance.
*
* @param parShell
* @return
*/
public static KinkLineAttrDlg getInstance(Shell parShell) {
if (INSTANCE == null) {
try {
INSTANCE = new KinkLineAttrDlg(parShell);
} catch (VizException e) {
e.printStackTrace();
}
}
return INSTANCE;
}
@Override
/**
* Creates buttons, menus, and other controls in the dialog area
*/
protected void initializeComponents() {
super.createUpperComponents();
createKinkPosAttr();
super.createLowerComponents();
super.setSmoothLvl(0);
super.setLineWidth(2.0F);
super.setSizeScale(1.0);
setKinkPosition(0.5);
}
@Override
public int open() {
this.create();
int rt = super.open();
// if current action is MultiSelect, make the check boxes visible
if (PgenSession.getInstance().getPgenPalette().getCurrentAction()
.equalsIgnoreCase("MultiSelect")) {
enableChkBoxes(true);
enableAllWidgets(false);
} else {
enableAllWidgets(true);
enableChkBoxes(false);
}
this.getShell().setText("Kink Line Attributes");
return rt;
}
/**
* Make the check boxes visible/invisible
*
* @param flag
*/
private void enableChkBoxes(boolean flag) {
if (!flag) {
setAllChkBoxes();
}
for (ChkBox chk : ChkBox.values()) {
if (chkBox[chk.ordinal()] != null) {
chkBox[chk.ordinal()].setSelection(true);
}
}
chkBox[ChkBox.KINK_POSITION.ordinal()].setVisible(false);
}
/**
* Enable/disable all widgets in the dialog
*
* @param flag
*/
private void enableAllWidgets(boolean flag) {
colorLbl.setEnabled(flag);
widthLbl.setEnabled(flag);
widthSpinnerSlider.setEnabled(flag);
patternSizeLbl.setEnabled(flag);
patternSizeSpinnerSlider.setEnabled(flag);
smoothLbl.setEnabled(false);
smoothLvlCbo.setEnabled(false);
closedBtn.setEnabled(false);
filledBtn.setEnabled(false);
fillPatternLbl.setEnabled(false);
fillPatternCbo.setEnabled(false);
kinkPosLbl.setEnabled(flag);
kinkPosSpinnerSlider.setEnabled(flag);
}
/**
* Set all multi-selection check boxes to true.
*/
private void setAllChkBoxes() {
for (ChkBox chk : ChkBox.values()) {
if (chkBox[chk.ordinal()] != null) {
chkBox[chk.ordinal()].setSelection(true);
}
}
}
/**
* Create widgets for the kink position attribute
*/
private void createKinkPosAttr() {
Composite inCmp = new Composite(top, SWT.NONE);
inCmp.setLayout(getGridLayout(3, false, 0, 0, 0, 0));
chkBox[ChkBox.KINK_POSITION.ordinal()] = new Button(inCmp, SWT.CHECK);
chkBox[ChkBox.KINK_POSITION.ordinal()].setLayoutData(new GridData(
CHK_WIDTH, CHK_HEIGHT));
chkBox[ChkBox.KINK_POSITION.ordinal()]
.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Button btn = (Button) e.widget;
if (btn.getSelection()) {
kinkPosLbl.setEnabled(true);
kinkPosSpinnerSlider.setEnabled(true);
} else {
kinkPosLbl.setEnabled(false);
kinkPosSpinnerSlider.setEnabled(false);
}
}
});
chkBox[ChkBox.KINK_POSITION.ordinal()].setVisible(false);
kinkPosLbl = new Label(inCmp, SWT.LEFT);
kinkPosLbl.setText("Kink Position ");
kinkPosSpinnerSlider = new gov.noaa.nws.ncep.ui.pgen.attrdialog.vaadialog.SpinnerSlider(
inCmp, SWT.HORIZONTAL, 1);
kinkPosSpinnerSlider.setLayoutData(new GridData(140, 25));
kinkPosSpinnerSlider.setMinimum(25);
kinkPosSpinnerSlider.setMaximum(75);
kinkPosSpinnerSlider.setIncrement(5);
kinkPosSpinnerSlider.setPageIncrement(5);
kinkPosSpinnerSlider.setDigits(2);
}
protected boolean validateKinkPosition(VerifyEvent ve) {
boolean stat = false;
if (ve.widget instanceof Text) {
Text wText = (Text) ve.widget;
StringBuffer str = new StringBuffer(wText.getText());
str.replace(ve.start, ve.end, ve.text);
if (str.toString().isEmpty())
return true;
else {
try {
double value = Double.parseDouble(str.toString());
if (value >= MIN_KINK_LINE_POS
&& value <= MAX_KINK_LINE_POS) {
stat = true;
} else
stat = false;
} catch (NumberFormatException e1) {
stat = false;
}
}
}
return stat;
}
/**
* Gets the starting coordinate of the line segment
*
* @return starting Coordinate of the segment
*/
public Coordinate getStartPoint() {
return null;
}
/**
* Gets the ending coordinate of the line segment
*
* @return Ending Coordinate of the segment
*/
public Coordinate getEndPoint() {
return null;
}
/**
* Gets the color of this line
*
* @return the color
*/
public Color getColor() {
if (getColors() != null) {
return getColors()[0];
} else {
return null;
}
}
/**
* Gets the location of the kink along the line. Should be in the range 0.25
* to 0.75
*
* @return location as fraction of the way along the line.
*/
public double getKinkPosition() {
if (chkBox[ChkBox.KINK_POSITION.ordinal()].getSelection()) {
return kinkPosSpinnerSlider.getSelection() / 100.0;
} else {
return java.lang.Double.NaN;
}
}
/**
* Sets the the location of the kink along the line. Should be in the range
* 0.25 to 0.75.
*
* @param ps
* .
*/
private void setKinkPosition(double ps) {
kinkPosSpinnerSlider.setSelection((int) (ps * 100));
}
/**
* Gets the arrow head type. open or closed.
*
* @return Arrow Head type.
*/
public ArrowHeadType getArrowHeadType() {
if (pgenType != null && pgenType.equals("KINK_LINE_1")) {
return ArrowHeadType.OPEN;
} else {
return ArrowHeadType.FILLED;
}
}
/**
* Sets values of all attributes of the dialog.
*/
public void setAttrForDlg(IAttribute iattr) {
super.setAttrForDlg(iattr);
if (iattr instanceof IKink) {
IKink attr = (IKink) iattr;
double kinkPos = attr.getKinkPosition();
if (kinkPos >= 0.25 && kinkPos <= 0.75) {
this.setKinkPosition(kinkPos);
}
}
}
}

View file

@ -75,7 +75,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Fixed enable problem when dialog returns.
* 03/12 #599 Q. Zhou Fixed selecting a outlook. need to enable btns from outlookType table.
* Fixed label text combo width.
* 03/13 #928 B. Yin Removed some white space.
* 03/13 #928 B. Yin Removed some white space.
* 11/13 #1049 B. Yin Handle outlook type defined in layer.
* </pre>
*
* @author B. Yin
@ -97,6 +98,9 @@ public class OutlookAttrDlg extends AttrDlg implements IContours, ILine{
"PRESENT_WX_075", "PRESENT_WX_073|PRESENT_WX_075", "PRESENT_WX_056",
"PRESENT_WX_079", "PRESENT_WX_056|PRESENT_WX_079" };
public static final String OTLK_TYPE_IN_LAYER_META = "outlook type";
public static final String OTLK_FORMAT_FLAG_IN_LAYER_META = "outlook format flag";
//Single instance of the dialog
private static OutlookAttrDlg INSTANCE;
@ -600,6 +604,8 @@ public class OutlookAttrDlg extends AttrDlg implements IContours, ILine{
}
drawingLayer.removeSelected();
PgenUtil.loadOutlookSetContTool(ol);
addLineBtn.setEnabled( false );
delLineBtn.setEnabled( false );
}
});
@ -1480,8 +1486,32 @@ public class OutlookAttrDlg extends AttrDlg implements IContours, ILine{
*/
public void setOtlkType( String type ){
int idx = outlookCombo.indexOf(type.toUpperCase());
if ( idx < 0 ) {
idx = 0;
type = outlookCombo.getItem(idx);
}
if ( idx >= 0 ){
outlookCombo.select( outlookCombo.indexOf(type.toUpperCase()));
//disable some fields such as "Make Grid" for some outlooks
showGrid = showMakeGrid(type);
flagLabel = showLabel(type);
flagAction = showAction(type);
infoBtn.setEnabled(showGrid);
makeGridBtn.setEnabled( showGrid );
lblBtn.setEnabled(flagLabel);
txtBtn.setEnabled(flagLabel);
symbolBtn.setEnabled(flagLabel);
lnColorBtn.setEnabled(flagLabel);
addLineBtn.setEnabled(flagAction);
delLineBtn.setEnabled(flagAction);
setContBtn.setEnabled(flagAction);
showContBtn.setEnabled(flagAction);
fmtBtn.setEnabled(flagAction);
needFromLine = setFromLineFlag(type);
setDefaultLabels( this.getOutlookType());
setDefaultLineAttr( outlookCombo.getText() + txtCombo.getText());
}
@ -1907,7 +1937,7 @@ public class OutlookAttrDlg extends AttrDlg implements IContours, ILine{
//check selected DE
//Comment out because the selected outlook may not be the same type of the active layer
/* AbstractDrawableComponent selected = drawingLayer.getSelectedComp();
if ( selected != null ){
if ( selected != null )
if ( selected.getParent().getParent() instanceof Outlook ){
otlk = (Outlook)selected.getParent().getParent();
}
@ -1921,10 +1951,19 @@ public class OutlookAttrDlg extends AttrDlg implements IContours, ILine{
}
//loop through the layer
else {
*/ Iterator<AbstractDrawableComponent> it = drawingLayer.getActiveLayer().getComponentIterator();
*/
String otlkType = drawingLayer.getActiveLayer().getMetaInfoFromKey(OutlookAttrDlg.OTLK_TYPE_IN_LAYER_META);
if ( otlkType == null || otlkType.isEmpty() ){
otlkType = getOutlookType();
}
Iterator<AbstractDrawableComponent> it = drawingLayer.getActiveLayer().getComponentIterator();
while ( it.hasNext() ){
AbstractDrawableComponent adc = it.next();
if (adc instanceof Outlook && ((Outlook)adc).getOutlookType().equalsIgnoreCase(getOutlookType())){
if (adc instanceof Outlook && ((Outlook)adc).getOutlookType().equalsIgnoreCase(otlkType)){
otlk = (Outlook) adc;
break;
}

View file

@ -87,6 +87,8 @@ import com.vividsolutions.jts.geom.Polygon;
* 01/13 #966 B. Yin Added clipping functions.
* 08/13 TTR783,773 B. Yin Order outlook lines when formatting
* Added forecaster drop-down
* 11/13 #1049 B. Yin Handle outlook type defined in layer.
* 12/13 TTR800 B. Yin Use UTC time class.
*
* </pre>
*
@ -125,16 +127,16 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
//initial date and time
private DateTime initDate;
private Text initTime;
private UTCTimeText initTime;
//expiration check box and date/time widgets
private DateTime expDate;
private Text expTime;
private UTCTimeText expTime;
//forecaster name
private Combo forecasterCombo;
private static String lastForecaster = "";
/**
* Protected constructor
*/
@ -201,14 +203,14 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
Composite initDt = new Composite(top, SWT.NONE);
initDt.setLayout( new GridLayout(2, false) );
initDate = new DateTime(initDt, SWT.BORDER | SWT.DATE );
initTime = new Text(initDt, SWT.SINGLE | SWT.BORDER | SWT.CENTER);
initTime = new UTCTimeText(initDt, SWT.SINGLE | SWT.BORDER | SWT.CENTER);
FormData fd = new FormData();
fd.top = new FormAttachment(dayGrp,2, SWT.BOTTOM);
fd.left = new FormAttachment(initDate, 5, SWT.RIGHT);
initTime.setLayoutData(fd);
PgenUtil.setUTCTimeTextField(initDt, initTime,
this.getDefaultInitDT(this.getDays().replaceAll(" Fire", "")),dayGrp, 5);
initTime.setUTCTimeTextField(initDt,
this.getDefaultInitDT(this.getDays().replaceAll(" Fire", "")),dayGrp, 5, true);
setInitDt(this.getDefaultInitDT(this.getDays().replaceAll(" Fire", "")));
@ -218,15 +220,15 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
Composite expDt = new Composite(top, SWT.NONE);
expDt.setLayout( new GridLayout(2, false) );
expDate = new DateTime(expDt, SWT.BORDER | SWT.DATE );
expTime = new Text(expDt, SWT.SINGLE | SWT.BORDER | SWT.CENTER);
expTime = new UTCTimeText(expDt, SWT.SINGLE | SWT.BORDER | SWT.CENTER);
FormData fd2 = new FormData();
fd2.top = new FormAttachment(initTime, 2, SWT.BOTTOM);
fd2.top = new FormAttachment(initTime.getTextWidget(), 2, SWT.BOTTOM);
fd2.left = new FormAttachment(expDate, 5, SWT.RIGHT);
expTime.setLayoutData(fd2);
PgenUtil.setUTCTimeTextField(expDt, expTime,
this.getDefaultExpDT(this.getDays().replaceAll(" Fire", "")),dayGrp, 5);
expTime.setUTCTimeTextField(expDt,
this.getDefaultExpDT(this.getDays().replaceAll(" Fire", "")),dayGrp, 5, true);
setExpDt(this.getDefaultExpDT(this.getDays().replaceAll(" Fire", "")));
@ -299,6 +301,16 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
contBtn.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e) {
Layer layer = otlkDlg.drawingLayer.getActiveLayer();
String fmtFlag = layer.getMetaInfoFromKey(OutlookAttrDlg.OTLK_FORMAT_FLAG_IN_LAYER_META);
if ( fmtFlag.equalsIgnoreCase("false")){
MessageDialog infoDlg = new MessageDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
"Information", null, "This layer is configured not to be formatted.",
MessageDialog.INFORMATION, new String[]{"OK"}, 0);
infoDlg.open();
return;
}
long mins = (getExpTime().getTime().getTime() - getInitTime().getTime().getTime())/(1000*60);
String msg = "The duration of your outlook will be " + (int)Math.floor(mins/60) + "h " +
@ -350,8 +362,8 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
Calendar expiration = Calendar.getInstance( TimeZone.getTimeZone("GMT") );
expiration.set(expDate.getYear(), expDate.getMonth(), expDate.getDay(),
this.getHourFromTextField( expTime ),
this.getMinuteFromTextField( expTime ), 0);
expTime.getHours( ),
expTime.getMinutes(), 0);
expiration.set(Calendar.MILLISECOND, 0);
return expiration;
}
@ -363,8 +375,8 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
public Calendar getInitTime(){
Calendar init = Calendar.getInstance( TimeZone.getTimeZone("GMT") );
init.set(initDate.getYear(), initDate.getMonth(), initDate.getDay(),
this.getHourFromTextField(initTime),
this.getMinuteFromTextField(initTime), 0);
initTime.getHours(),
initTime.getMinutes());
init.set(Calendar.MILLISECOND, 0);
@ -385,85 +397,47 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
}
private void otlkAll(){
//format hail first
for ( Product pd : otlkDlg.drawingLayer.getProducts()){
for ( Layer layer : pd.getLayers() ){
Iterator<AbstractDrawableComponent> it = layer.getComponentIterator();
while ( it.hasNext() ){
AbstractDrawableComponent adc = it.next();
if ( adc.getName().equalsIgnoreCase("Outlook") &&
adc.getPgenType().equalsIgnoreCase("hail") ){
if ( msgDlg != null ){
msgDlg.close();
}
msgDlg = new OutlookFormatMsgDlg(OutlookFormatDlg.this.getParentShell(),
OutlookFormatDlg.this, (Outlook)adc, layer);
msgDlg.setBlockOnOpen(true);
msgDlg.setMessage(formatOtlk((Outlook)adc, layer));
int rt = msgDlg.open();
if ( rt == Dialog.CANCEL ) return;
/*else {
msgDlg.setOtlk((Outlook)adc);
msgDlg.setLayer( layer);
}
*/
break;
}
}
}
}
//only format active product
//format order: from current layer goes down then goes to the top if necessary
Product pd = otlkDlg.drawingLayer.getActiveProduct();
int currentLayerIdx = pd.getLayers().indexOf(otlkDlg.drawingLayer.getActiveLayer() );
//format other outlooks
for ( Product pd : otlkDlg.drawingLayer.getProducts()){
for ( Layer layer : pd.getLayers() ){
Iterator<AbstractDrawableComponent> it = layer.getComponentIterator();
Outlook lk = null;
boolean hailFound = false;
for ( int ii = 0; ii < pd.getLayers().size(); ii++ ){
//int jj = (ii+currentLayerIdx)%pd.getLayers().size();
Layer fmtLayer = pd.getLayers().get( (ii+currentLayerIdx)%pd.getLayers().size() );
String fmtFlag = fmtLayer.getMetaInfoFromKey(OutlookAttrDlg.OTLK_FORMAT_FLAG_IN_LAYER_META);
if ( fmtFlag.equalsIgnoreCase("false") ) continue;
String otlkType = fmtLayer.getMetaInfoFromKey(OutlookAttrDlg.OTLK_TYPE_IN_LAYER_META);
if ( otlkType == null || otlkType.isEmpty() ){
otlkType = "OUTLOOK";
}
//find outlook
Iterator<AbstractDrawableComponent> it = fmtLayer.getComponentIterator();
Outlook lk = null;
while ( it.hasNext() ){
AbstractDrawableComponent adc = it.next();
if ( adc.getName().equalsIgnoreCase("Outlook") &&
!adc.getPgenType().equalsIgnoreCase("hail") ){
lk = (Outlook)adc;
break;
}
else if (adc.getName().equalsIgnoreCase("Outlook") &&
adc.getPgenType().equalsIgnoreCase("hail") ){
hailFound = true;
}
} // end while loop
//skip hail since it's always done first.
if ( hailFound ) continue;
if ( msgDlg != null ){
msgDlg.close();
}
msgDlg = new OutlookFormatMsgDlg(OutlookFormatDlg.this.getParentShell(),
OutlookFormatDlg.this, lk, layer);
msgDlg.setBlockOnOpen(true);
msgDlg.setMessage(formatOtlk(lk, layer));
while ( it.hasNext() ){
AbstractDrawableComponent adc = it.next();
if ( adc.getName().equalsIgnoreCase("Outlook") &&
((Outlook)adc).getOutlookType().equalsIgnoreCase( otlkType ) ){
lk = (Outlook)adc;
break;
}
} // end while loop
if ( msgDlg != null ){
msgDlg.close();
}
msgDlg = new OutlookFormatMsgDlg(OutlookFormatDlg.this.getParentShell(),
OutlookFormatDlg.this, lk, fmtLayer);
msgDlg.setBlockOnOpen(true);
msgDlg.setMessage(formatOtlk(lk, fmtLayer));
int rt = msgDlg.open();
if ( rt == Dialog.CANCEL ) return;
/*else {
msgDlg.setOtlk((Outlook)adc);
msgDlg.setLayer( layer);
}
*/
} // end layer loop
} // end product loop
int rt = msgDlg.open();
if ( rt == Dialog.CANCEL ) return;
} //end layer loop
cleanup();
@ -499,73 +473,73 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
String.format("%1$td%1$tH%1$tMZ", getExpTime()) +"\n";
}
else {
Layer defaultLayer = otlkDlg.drawingLayer.getActiveLayer().copy();
defaultLayer.clear();
Layer defaultLayer = otlkDlg.drawingLayer.getActiveLayer().copy();
defaultLayer.clear();
Product defaultProduct = new Product();
defaultProduct.addLayer(defaultLayer);
Product defaultProduct = new Product();
defaultProduct.addLayer(defaultLayer);
String pdName = otlkDlg.drawingLayer.getActiveProduct().getType();
ProductType pt = ProductConfigureDialog.getProductTypes().get( pdName);
Polygon boundsPoly = null;
if ( pt != null && pt.getClipFlag() != null && pt.getClipFlag() ) {
boundsPoly = getBoundsPoly(pt.getClipBoundsTable(), pt.getClipBoundsName());
if ( boundsPoly != null ){
processClip( ol, defaultLayer, boundsPoly);
}
}
if (pt ==null || pt.getClipFlag() == null || !pt.getClipFlag() || boundsPoly == null ) {
//add watch collection(box and status line)
defaultLayer.addElement(this.issueOutlook(ol));
}
ArrayList<Product> prds = new ArrayList<Product>();
prds.add( defaultProduct );
Products fileProduct = ProductConverter.convert( prds );
org.w3c.dom.Document sw = null;
try{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
sw = db.newDocument();
Marshaller mar = SerializationUtil.getJaxbContext().createMarshaller();
mar.marshal( fileProduct, sw );
}catch(Exception e){
e.printStackTrace();
}
String pdName = otlkDlg.drawingLayer.getActiveProduct().getType();
ProductType pt = ProductConfigureDialog.getProductTypes().get( pdName);
DOMSource ds = new DOMSource(sw);
//get style sheet file path
String xsltPath = PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + File.separator + "xslt" + File.separator + "outlook" + File.separator + "Outlook.xlt";
Polygon boundsPoly = null;
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getStaticLocalizationFile(xsltPath);
if ( lFile != null ){
msg = PgenUtil.applyStyleSheet( ds, lFile.getFile().getAbsolutePath());
}
//show warning if there are different types of outlook in the same layer
Iterator<AbstractDrawableComponent> it = layer.getComponentIterator();
while ( it.hasNext() ){
AbstractDrawableComponent adc = it.next();
if ( adc instanceof Outlook ){
if ( !((Outlook)adc).getOutlookType().equalsIgnoreCase(ol.getOutlookType())){
MessageDialog warningDlg = new MessageDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
"Warning!", null, "More than one outlook types are found in one layer!",
MessageDialog.INFORMATION, new String[]{"OK"}, 0);
warningDlg.open();
break;
if ( pt != null && pt.getClipFlag() != null && pt.getClipFlag() ) {
boundsPoly = getBoundsPoly(pt.getClipBoundsTable(), pt.getClipBoundsName());
if ( boundsPoly != null ){
processClip( ol, defaultLayer, boundsPoly);
}
}
if (pt ==null || pt.getClipFlag() == null || !pt.getClipFlag() || boundsPoly == null ) {
//add watch collection(box and status line)
defaultLayer.addElement(this.issueOutlook(ol));
}
ArrayList<Product> prds = new ArrayList<Product>();
prds.add( defaultProduct );
Products fileProduct = ProductConverter.convert( prds );
org.w3c.dom.Document sw = null;
try{
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
sw = db.newDocument();
Marshaller mar = SerializationUtil.getJaxbContext().createMarshaller();
mar.marshal( fileProduct, sw );
}catch(Exception e){
e.printStackTrace();
}
DOMSource ds = new DOMSource(sw);
//get style sheet file path
String xsltPath = PgenStaticDataProvider.getProvider().getPgenLocalizationRoot() + File.separator + "xslt" + File.separator + "outlook" + File.separator + "Outlook.xlt";
LocalizationFile lFile = PgenStaticDataProvider.getProvider().getStaticLocalizationFile(xsltPath);
if ( lFile != null ){
msg = PgenUtil.applyStyleSheet( ds, lFile.getFile().getAbsolutePath());
}
//show warning if there are different types of outlook in the same layer
Iterator<AbstractDrawableComponent> it = layer.getComponentIterator();
while ( it.hasNext() ){
AbstractDrawableComponent adc = it.next();
if ( adc instanceof Outlook ){
if ( !((Outlook)adc).getOutlookType().equalsIgnoreCase(ol.getOutlookType())){
MessageDialog warningDlg = new MessageDialog(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
"Warning!", null, "More than one outlook types are found in one layer!",
MessageDialog.INFORMATION, new String[]{"OK"}, 0);
warningDlg.open();
break;
}
}
}
}
}
return msg;
}
@ -759,11 +733,11 @@ public class OutlookFormatDlg extends CaveJFACEDialog{
public Outlook issueOutlook( Outlook ol ){
if ( ol != null ) {
reorder(ol);
ol.setForecaster(getForecaster().toUpperCase());
ol.setDays(getDays().toUpperCase());
ol.setIssueTime(getInitTime());
ol.setExpirationTime(getExpTime());
ol.setLineInfo(generateLineInfo(ol, "new_line"));
ol.setForecaster(getForecaster().toUpperCase());
ol.setDays(getDays().toUpperCase());
ol.setIssueTime(getInitTime());
ol.setExpirationTime(getExpTime());
ol.setLineInfo(generateLineInfo(ol, "new_line"));
}
return ol;
}

View file

@ -68,6 +68,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* so that Watch can also use them.
* 03/13 #928 B. Yin Made the button bar smaller.
* 04/29 #977 S. Gilbert PGEN Database support
* 12/13 TTR800 B. Yin USe UTC time class
* </pre>
*
* @author S. Gilbert
@ -133,7 +134,7 @@ public class TcaAttrDlg extends AttrDlg implements ITca, SelectionListener {
private Combo breakpointTypes = null;
private Text validTime = null;
private UTCTimeText validTime = null;
private DateTime validDate = null;
@ -446,15 +447,14 @@ public class TcaAttrDlg extends AttrDlg implements ITca, SelectionListener {
* valid Time text field ---- REPLACED WITH DateTime WIDGETS ABOVE
*/
validTime = new Text(g1, SWT.SINGLE | SWT.BORDER | SWT.CENTER);
validTime = new UTCTimeText(g1, SWT.SINGLE | SWT.BORDER | SWT.CENTER);
fd = new FormData();
fd.top = new FormAttachment(stormNameField, 10, SWT.BOTTOM);
fd.left = new FormAttachment(validDate, 10, SWT.RIGHT);
// fd.right = new FormAttachment(stormTypes, 0, SWT.RIGHT);
validTime.setLayoutData(fd);
PgenUtil.setUTCTimeTextField(g1, validTime,
Calendar.getInstance(TimeZone.getTimeZone("GMT")),
stormNameField, 15);
validTime.setUTCTimeTextField(g1, Calendar.getInstance(TimeZone.getTimeZone("GMT")),
stormNameField, 15, true);
/*
* Advisory number label
@ -567,7 +567,7 @@ public class TcaAttrDlg extends AttrDlg implements ITca, SelectionListener {
Label timeZoneLabel = new Label(g1, SWT.NONE);
timeZoneLabel.setText("Time Zone for TCV product:");
fd = new FormData();
fd.top = new FormAttachment(validTime, 15, SWT.BOTTOM);
fd.top = new FormAttachment(validTime.getTextWidget(), 15, SWT.BOTTOM);
fd.left = new FormAttachment(stormTypes, 0, SWT.LEFT);
timeZoneLabel.setLayoutData(fd);
@ -580,7 +580,7 @@ public class TcaAttrDlg extends AttrDlg implements ITca, SelectionListener {
}
timeZoneTypes.setText(timeZoneTypes.getItem(0));
fd = new FormData();
fd.top = new FormAttachment(validTime, 10, SWT.BOTTOM);
fd.top = new FormAttachment(validTime.getTextWidget(), 10, SWT.BOTTOM);
fd.left = new FormAttachment(timeZoneLabel, 10, SWT.RIGHT);
fd.right = new FormAttachment(stormTypes, 0, SWT.RIGHT);
timeZoneTypes.setLayoutData(fd);
@ -897,7 +897,7 @@ public class TcaAttrDlg extends AttrDlg implements ITca, SelectionListener {
"Warning", null, msg, MessageDialog.ERROR,
new String[] { "OK" }, 0);
messageDlg.open();
} else if (!PgenUtil.isTimeValid(validTime.getText())) {
} else if (!validTime.isTimeValid()) {
StringBuilder msg = new StringBuilder("The Product Time ");
msg.append('"');
msg.append(validTime.getText());

View file

@ -0,0 +1,171 @@
/*
* gov.noaa.nws.ncep.ui.pgen.attrDialog.TcaAttrDlg
*
* 23 December 2013
*
* This code has been developed by the NCEP/SIB for use in the AWIPS2 system.
*/
package gov.noaa.nws.ncep.ui.pgen.attrdialog;
import java.util.Calendar;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Text;
/**
* Implementation of a text widget for UTC time
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 12/13 TTR800 B. Yin Initial Creation.
* </pre>
*
* @author B. Yin
*/
public class UTCTimeText {
private Text swtText;
public UTCTimeText(Composite parent, int style) {
swtText = new Text(parent, style);
}
/**
* Create a UTC time text widget
*/
public UTCTimeText setUTCTimeTextField( Composite parent, Calendar cal, Control topWidget, int offset, boolean addLabel ){
swtText.setTextLimit(4);
swtText.setText( getInitialTime(cal ));
swtText.addVerifyListener( new VerifyListener(){
@Override
public void verifyText(VerifyEvent ve) {
final char BACKSPACE = 0x08;
final char DELETE = 0x7F;
if ( Character.isDigit(ve.character) || Character.UNASSIGNED == ve.character ||
ve.character == BACKSPACE || ve.character == DELETE ) ve.doit = true;
else {
ve.doit = false;
Display.getCurrent().beep();
}
}} );
swtText.addModifyListener( new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
if ( isTimeValid() )
swtText.setBackground( Display.getCurrent().getSystemColor( SWT.COLOR_WHITE));
else
swtText.setBackground( Display.getCurrent().getSystemColor( SWT.COLOR_RED));
}
});
if ( addLabel ){
org.eclipse.swt.widgets.Label utcLabel = new org.eclipse.swt.widgets.Label(parent,SWT.NONE);
utcLabel.setText("UTC");
FormData fd = new FormData();
parent.setLayout( new FormLayout());
if ( topWidget != null ) fd.top = new FormAttachment(topWidget,offset, SWT.BOTTOM);
fd.left = new FormAttachment(swtText, 5, SWT.RIGHT);
utcLabel.setLayoutData(fd);
}
return this;
}
/**
* check if the input string is a valid time
*/
public boolean isTimeValid() {
String text = swtText.getText();
int time = Integer.parseInt(text);
int hour = time / 100;
int minute = time % 100;
if ( hour >= 0 && hour <= 23 &&
minute >= 00 && minute <=59 ) return true;
return false;
}
/**
* Get the time string in the format HH00 from the input calendar time.
*/
public String getInitialTime(Calendar now ) {
int minute = now.get(Calendar.MINUTE);
if ( minute >= 15 ) now.add(Calendar.HOUR_OF_DAY, 1);
int hour = now.get(Calendar.HOUR_OF_DAY);
return String.format("%02d00", hour);
}
/**
* Get the expiration hour from the validTime text widget
*/
public int getHours(){
int ret =0;
try {
String hm = swtText.getText();
ret = Integer.parseInt(hm.substring(0, hm.length()== 4 ? 2:1 ));
}
catch (Exception e ){
}
return ret;
}
/**
* Get the expiration minute from the validTime text widget
*/
public int getMinutes(){
int ret =0;
try {
String hm = swtText.getText();
ret = Integer.parseInt(hm.substring(hm.length()== 4 ? 2:1 ), hm.length()-1);
}
catch (Exception e ){
}
return ret;
}
public String getText(){
return swtText.getText();
}
public void setText(String str){
swtText.setText(str);
}
public void setTime(int hh, int mm){
swtText.setText( String.format("%1$02d%2$02d", hh,mm));
}
public void setLayoutData(Object layoutData){
swtText.setLayoutData(layoutData);
}
public Text getTextWidget(){
return swtText;
}
}

Some files were not shown because too many files have changed in this diff Show more