Merge branch 'omaha_14.3.1' into omaha_14.4.1
Conflicts: cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/Cities.xml cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Airports.xml cave/com.raytheon.uf.viz.core.maps/localization/bundles/maps/FAA/Fix.xml cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/BundleReflections.java cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/reflect/SubClassLocator.java cave/com.raytheon.uf.viz.monitor.fog/src/com/raytheon/uf/viz/monitor/fog/ui/dialogs/FogMonitoringAreaConfigDlg.java cave/com.raytheon.uf.viz.monitor.safeseas/src/com/raytheon/uf/viz/monitor/safeseas/ui/dialogs/SSMonitoringAreaConfigDlg.java cave/com.raytheon.uf.viz.monitor.snow/src/com/raytheon/uf/viz/monitor/snow/ui/dialogs/SnowMonitoringAreaConfigDlg.java cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/MenuItemComposite.java cave/com.raytheon.uf.viz.ui.menus/src/com/raytheon/uf/viz/ui/menus/widgets/tearoff/TearOffMenuDialog.java cave/com.raytheon.viz.core.gl/src/com/raytheon/viz/core/gl/ext/imaging/GLDataMappingFactory.java cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/DataManager.java cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/internal/ParmManager.java cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/CombinationsFileUtil.java cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/graphic/RadarGraphicsPage.java cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/rsc/mosaic/RadarMosaicResource.java cave/com.raytheon.viz.radar/src/com/raytheon/viz/radar/ui/xy/RadarGSMResource.java cave/com.raytheon.viz.ui.personalities.awips/src/com/raytheon/viz/ui/personalities/awips/AbstractCAVEComponent.java cave/com.raytheon.viz.ui/META-INF/MANIFEST.MF cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/colormap/ColorMapTree.java cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/ColormapComp.java cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/dialogs/ImagingDialog.java cave/com.raytheon.viz.volumebrowser/localization/menus/xml/fieldsMenus.xml cave/com.raytheon.viz.volumebrowser/localization/menus/xml/planesMenusPlanView.xml cave/com.raytheon.viz.volumebrowser/localization/volumebrowser/VbSources.xml edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryFederationManager.java edexOsgi/com.raytheon.uf.common.derivparam/utility/common_static/base/derivedParameters/definitions/TP.xml edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/IPathManager.java edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/PathManager.java edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/dao/ReplicationEventDao.java edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/RegistryFederationManager.java edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/WfsConnectionUtil.java Former-commit-id:4c56844e29
[formerly 69c52fb4a22997d0a0f9c620bd20f00b8c5fd4ce] Former-commit-id:091555cf10
This commit is contained in:
commit
da530db540
107 changed files with 3308 additions and 1729 deletions
|
@ -53,6 +53,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* Dec 11, 2013 #2624 rferrel Clear display variables when recomputing sizes.
|
||||
* Mar 27, 2014 #2879 rferrel Loading Case no longer changes Start/End times.
|
||||
* Apr 23, 2014 #3045 rferrel Changes to prevent race condition while getting labels.
|
||||
* Aug 26, 2014 #3553 rferrel Option to force update of table's display data.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -157,7 +158,7 @@ public class SizeJob extends Job {
|
|||
private boolean stopComputeSize;
|
||||
|
||||
/**
|
||||
* Priority queue for getting display data all archive/category tables.
|
||||
* Priority queue for getting display data for all archive/category tables.
|
||||
*/
|
||||
// Do not use a PriorityBlockingQueue since the load select and change
|
||||
// display methods need to be notified when the display data is available.
|
||||
|
@ -473,11 +474,11 @@ public class SizeJob extends Job {
|
|||
* @return displayData
|
||||
*/
|
||||
public List<DisplayData> changeDisplay(String archiveName,
|
||||
String categoryName, AtomicBoolean shutdown) {
|
||||
String categoryName, AtomicBoolean shutdown, boolean forceUpdate) {
|
||||
List<DisplayData> displayDatas = null;
|
||||
|
||||
// Only get data when the display really needs to be changed.
|
||||
if (!archiveName.equals(displayArchive)
|
||||
if (forceUpdate || !archiveName.equals(displayArchive)
|
||||
|| !categoryName.equals(displayCategory)) {
|
||||
|
||||
// Update visible status of current display.
|
||||
|
|
|
@ -82,6 +82,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Apr 15, 2014 3034 lvenable Added dispose checks in runAsync calls.
|
||||
* Apr 10, 2014 3023 rferrel Added setTotalSelectedSize method.
|
||||
* Apr 23, 2014 3045 rferrel Changes to prevent race condition while getting labels.
|
||||
* Aug 26, 2014 3553 rferrel Force redisplay of table after getting all display labels.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -146,6 +147,9 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
|
|||
/** Job running to populate the currently selected archive/category. */
|
||||
private Job populateTableJob = null;
|
||||
|
||||
/** Flag to indicate all labels for all tables are loaded. */
|
||||
protected volatile boolean haveAllLabels = false;
|
||||
|
||||
/**
|
||||
* @param parentShell
|
||||
*/
|
||||
|
@ -360,6 +364,9 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
|
|||
*/
|
||||
protected void createTable() {
|
||||
tableComp = new ArchiveTableComp(shell, type, this, sizeJob);
|
||||
// Indicate loading the table labels.
|
||||
tableComp
|
||||
.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
|
||||
sizeJob.addUpdateListener(this);
|
||||
}
|
||||
|
||||
|
@ -491,6 +498,13 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
|
|||
* adjust sizes on the display table.
|
||||
*/
|
||||
protected void populateTableComp() {
|
||||
populateTableComp(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param forceUpdate
|
||||
*/
|
||||
protected void populateTableComp(final boolean forceUpdate) {
|
||||
final String archiveName = getSelectedArchiveName();
|
||||
final String categoryName = getSelectedCategoryName();
|
||||
|
||||
|
@ -508,7 +522,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
|
|||
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
getCategoryTableData(archiveName, categoryName, shutdown);
|
||||
getCategoryTableData(archiveName, categoryName, shutdown,
|
||||
forceUpdate);
|
||||
|
||||
// Just populated the current table update cursor.
|
||||
if (!shutdown.get()) {
|
||||
|
@ -543,7 +558,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
|
|||
* @param shutdown
|
||||
*/
|
||||
private void getCategoryTableData(final String archiveName,
|
||||
final String categoryName, final AtomicBoolean shutdown) {
|
||||
final String categoryName, final AtomicBoolean shutdown,
|
||||
boolean forceUpdate) {
|
||||
|
||||
if (!sizeJob.isCurrentDisplay(archiveName, categoryName)) {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
@ -558,7 +574,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
|
|||
}
|
||||
|
||||
final List<DisplayData> displayDatas = sizeJob.changeDisplay(
|
||||
archiveName, categoryName, shutdown);
|
||||
archiveName, categoryName, shutdown, forceUpdate);
|
||||
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
||||
|
@ -695,6 +711,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
|
|||
.setToolTipText("Change display to show all case selections");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
showingSelected = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -838,9 +856,23 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements
|
|||
}
|
||||
|
||||
/**
|
||||
* Allows sub-class to perform updates once all the display data is loaded.
|
||||
* Perform updates once all the display data is loaded.
|
||||
*/
|
||||
abstract public void loadedAllDisplayData();
|
||||
public void loadedAllDisplayData() {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
haveAllLabels = true;
|
||||
if (showingSelected) {
|
||||
populateSelectAllTable();
|
||||
} else {
|
||||
populateTableComp(true);
|
||||
}
|
||||
tableComp.setCursor(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* When unsaved modifications this asks the user to verify the close.
|
||||
|
|
|
@ -59,6 +59,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* Apr 14, 2014 #3023 rferrel Code clean up.
|
||||
* Apr 24, 2014 #3045 rferrel Implement loadedAllDsipalyData.
|
||||
* May 28, 2014 #3171 rferrel Change retention labels.
|
||||
* Aug 26, 2014 #3553 rferrel No longer need to override loadedAllDisplayData.
|
||||
* Sep 17, 2014 #3609 rferrel Corrected spelling.
|
||||
*
|
||||
* </pre>
|
||||
|
@ -424,9 +425,4 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg {
|
|||
archiveComboSelection();
|
||||
categoryComboSelection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadedAllDisplayData() {
|
||||
// nothing to update.
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Apr 11, 2014 #3023 rferrel Configurable Threshold options.
|
||||
* Apr 23, 2014 #3045 rferrel To prevent race condition only allow a case
|
||||
* load after all labels are loaded.
|
||||
* Aug 26, 2014 #3553 rferrel loadedAllDisplayData must now call its super.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -171,9 +172,6 @@ public class CaseCreationDlg extends AbstractArchiveDlg {
|
|||
/** Manager for configurable values for the dialog. */
|
||||
private final CaseCreationManager ccManager;
|
||||
|
||||
/** Flag to indicate all labels for all tables are loaded. */
|
||||
private volatile boolean haveAllLabels = false;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
|
@ -1112,8 +1110,6 @@ public class CaseCreationDlg extends AbstractArchiveDlg {
|
|||
*/
|
||||
@Override
|
||||
public void loadedAllDisplayData() {
|
||||
haveAllLabels = true;
|
||||
|
||||
/*
|
||||
* Restore the buttons' default background color and tooltip text. The
|
||||
* buttons color is not the system standard and the tool tip text
|
||||
|
@ -1133,6 +1129,7 @@ public class CaseCreationDlg extends AbstractArchiveDlg {
|
|||
}
|
||||
}
|
||||
});
|
||||
super.loadedAllDisplayData();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<bundle>
|
||||
<displayList>
|
||||
<displays xsi:type="d2DMapRenderableDisplay"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<descriptor xsi:type="mapDescriptor">
|
||||
<resource>
|
||||
<loadProperties loadWithoutData="true">
|
||||
<capabilities />
|
||||
</loadProperties>
|
||||
<properties isSystemResource="false" isBlinking="false"
|
||||
isMapLayer="false" isHoverOn="false" isVisible="true" />
|
||||
<resourceData xsi:type="wouWcnWatchesResourceData"
|
||||
isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true"
|
||||
name="Convective Watches">
|
||||
<metadataMap>
|
||||
<mapping key="phensig">
|
||||
<constraint constraintValue="TO.A,SV.A"
|
||||
constraintType="IN" />
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="warning" constraintType="EQUALS" />
|
||||
</mapping>
|
||||
</metadataMap>
|
||||
</resourceData>
|
||||
</resource>
|
||||
</descriptor>
|
||||
</displays>
|
||||
</displayList>
|
||||
</bundle>
|
|
@ -20,8 +20,8 @@
|
|||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
<contribute xsi:type="bundleItem" file="bundles/ncepHydro/SPCWatchPlot.xml"
|
||||
menuText="SPC Watches" id="spcWatches">
|
||||
<contribute xsi:type="bundleItem" file="bundles/ncepHydro/ConvectiveWatchPlot.xml"
|
||||
menuText="Convective Watches" id="convectiveWatches">
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/ncepHydro/SvrWxPlot.xml"
|
||||
menuText="Svr Wx Plot" id="spcWxPlot">
|
||||
|
|
|
@ -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.
|
||||
-->
|
||||
<DerivedParameter abbreviation="BLI" name="Best Lifted Index" unit="K" >
|
||||
<Method name="Alias">
|
||||
<Field abbreviation="4LFTX"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?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.
|
||||
-->
|
||||
<DerivedParameter unit="" name="Max Lightning Threat (flashes/km^2)" abbreviation="LTNG">
|
||||
</DerivedParameter>
|
|
@ -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.
|
||||
-->
|
||||
<DerivedParameter abbreviation="MAXDVV" name="Max Downdraft Vertical Velocity" unit="m/s" >
|
||||
<Method name="Alias">
|
||||
<Field abbreviation="MAXDVV1hr"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
||||
|
|
@ -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.
|
||||
-->
|
||||
<DerivedParameter abbreviation="MAXUVV" name="Max Updraft Vertical Velocity" unit="m/s" >
|
||||
<Method name="Alias">
|
||||
<Field abbreviation="MAXUVV1hr"/>
|
||||
</Method>
|
||||
</DerivedParameter>
|
||||
|
|
@ -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.
|
||||
-->
|
||||
<DerivedParameter abbreviation="MXREF" name="Max 1hr CAPPI" unit="dB" >
|
||||
<Method name="Alias" >
|
||||
<Field abbreviation="MAXREF1hr" />
|
||||
</Method>
|
||||
</DerivedParameter>
|
||||
|
|
@ -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.
|
||||
-->
|
||||
<DerivedParameter abbreviation="MAXUPHL" name="Max Updraft Helicity" unit="m^2/s^2" >
|
||||
<Method name="Alias" >
|
||||
<Field abbreviation="MXUPHL1hr" />
|
||||
</Method>
|
||||
</DerivedParameter>
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<DerivedParameter abbreviation="MaxWHRRR" name="Maximum 1hr Wind Gust" unit="m/s">
|
||||
<Method levels="Surface" models="HRRR" name="Max">
|
||||
<Field abbreviation="WGS1hr" />
|
||||
<Field abbreviation="WGS" />
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<DerivedParameter abbreviation="WGS1hr" name="Max 1-hr Wind Gust Speed" unit="m/s">
|
||||
<Method name="Alias" levels="Surface">
|
||||
<Field abbreviation="WGS1hr" level="10FHAG"/>
|
||||
</Method>
|
||||
<Method name="Alias" levels="Surface">
|
||||
<Field abbreviation="WS1hr" level="10FHAG"/>
|
||||
</Method>
|
||||
<Method name="Vector" levels="Surface" >
|
||||
<Field abbreviation="MAXUW1hr" level="FHAG10" />
|
||||
<Field abbreviation="MAXVW1hr" level="FHAG10" />
|
||||
</Method>
|
||||
</DerivedParameter>
|
|
@ -44,6 +44,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
|
|||
* Jan 29, 2014 2757 skorolev Changed OK button handler.
|
||||
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
|
||||
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
|
||||
* Sep 15, 2014 2757 skorolev Removed extra dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -103,16 +104,7 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
fogConfigMgr.getAddedStations().clear();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String message3 = "No changes made.\nDo you want to exit?";
|
||||
int yesno = showMessage(shell,
|
||||
SWT.ICON_QUESTION | SWT.YES | SWT.NO, "Exit", message3);
|
||||
if (yesno == SWT.NO) {
|
||||
return;
|
||||
}
|
||||
setReturnValue(true);
|
||||
close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
|
|||
* Jan 29, 2014 2757 skorolev Changed OK button handler.
|
||||
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
|
||||
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
|
||||
* Sep 15, 2014 2757 skorolev Removed extra dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -102,16 +103,7 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
ssConfigMgr.getAddedStations().clear();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String message3 = "No changes made.\nDo you want to exit?";
|
||||
int yesno = showMessage(shell,
|
||||
SWT.ICON_QUESTION | SWT.YES | SWT.NO, "Exit", message3);
|
||||
if (yesno == SWT.NO) {
|
||||
return;
|
||||
}
|
||||
setReturnValue(true);
|
||||
close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
|
|||
* Jan 29, 2014 2757 skorolev Changed OK button handler.
|
||||
* Apr 23, 2014 3054 skorolev Fixed issue with removing a new station from list.
|
||||
* Apr 28, 2014 3086 skorolev Updated snowConfigManager.
|
||||
* Sep 15, 2014 2757 skorolev Removed extra dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -104,17 +105,8 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
|||
snowConfigMgr.getAddedStations().clear();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
String message3 = "No changes made.\nDo you want to exit?";
|
||||
int yesno = showMessage(shell,
|
||||
SWT.ICON_QUESTION | SWT.YES | SWT.NO, "Exit", message3);
|
||||
if (yesno == SWT.NO) {
|
||||
return;
|
||||
}
|
||||
setReturnValue(true);
|
||||
snowConfigMgr = null;
|
||||
close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -146,14 +146,16 @@
|
|||
<command id="com.raytheon.viz.gfe.actions.ShowProcessMonitorDialog"
|
||||
name="ShowProcessMonitorDialog">
|
||||
</command>
|
||||
<command id="com.raytheon.viz.gfe.actions.ShowDeleteSampleSetDialog"
|
||||
name="ShowDeleteSampleSetDialog">
|
||||
</command>
|
||||
<command id="com.raytheon.viz.gfe.actions.ShowLoadSampleSetDialog"
|
||||
name="ShowLoadSampleSetDialog">
|
||||
</command>
|
||||
<command id="com.raytheon.viz.gfe.actions.ShowSaveSampleSetDialog"
|
||||
name="ShowSaveSampleSetDialog">
|
||||
<command id="com.raytheon.viz.gfe.actions.ShowSaveDeleteSampleSetDialog"
|
||||
name="ShowSaveDeleteSampleSetDialog">
|
||||
<commandParameter
|
||||
id="Action"
|
||||
name="Action"
|
||||
optional="false">
|
||||
</commandParameter>
|
||||
</command>
|
||||
<command id="com.raytheon.viz.gfe.actions.ShowClearSamples"
|
||||
name="ShowClearSamples">
|
||||
|
@ -574,13 +576,6 @@
|
|||
<activeWhen>
|
||||
<reference definitionId="com.raytheon.viz.gfe.inGFEActionSet">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler class="com.raytheon.viz.gfe.actions.ShowDeleteSampleSetDialog"
|
||||
commandId="com.raytheon.viz.gfe.actions.ShowDeleteSampleSetDialog">
|
||||
<activeWhen>
|
||||
<reference definitionId="com.raytheon.viz.gfe.inGFEActionSet">
|
||||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler class="com.raytheon.viz.gfe.actions.ShowLoadSampleSetDialog"
|
||||
|
@ -590,8 +585,8 @@
|
|||
</reference>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler class="com.raytheon.viz.gfe.actions.ShowSaveSampleSetDialog"
|
||||
commandId="com.raytheon.viz.gfe.actions.ShowSaveSampleSetDialog">
|
||||
<handler class="com.raytheon.viz.gfe.actions.ShowSaveDeleteSampleSetDialog"
|
||||
commandId="com.raytheon.viz.gfe.actions.ShowSaveDeleteSampleSetDialog">
|
||||
<activeWhen>
|
||||
<reference definitionId="com.raytheon.viz.gfe.inGFEActionSet">
|
||||
</reference>
|
||||
|
@ -1349,11 +1344,19 @@
|
|||
<command commandId="com.raytheon.viz.gfe.actions.ShowClearSamples"
|
||||
label="Clear">
|
||||
</command>
|
||||
<command commandId="com.raytheon.viz.gfe.actions.ShowSaveSampleSetDialog"
|
||||
<command commandId="com.raytheon.viz.gfe.actions.ShowSaveDeleteSampleSetDialog"
|
||||
label="Save...">
|
||||
<parameter
|
||||
name="Action"
|
||||
value="Save">
|
||||
</parameter>
|
||||
</command>
|
||||
<command commandId="com.raytheon.viz.gfe.actions.ShowDeleteSampleSetDialog"
|
||||
<command commandId="com.raytheon.viz.gfe.actions.ShowSaveDeleteSampleSetDialog"
|
||||
label="Delete...">
|
||||
<parameter
|
||||
name="Action"
|
||||
value="Delete">
|
||||
</parameter>
|
||||
</command>
|
||||
<separator name="xxx" visible="true" />
|
||||
<command
|
||||
|
|
|
@ -17,6 +17,14 @@
|
|||
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
# further licensing information.
|
||||
##
|
||||
#
|
||||
# SOFTWARE HISTORY
|
||||
#
|
||||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# Sep 01, 2014 3572 randerso Fix getTopo
|
||||
#
|
||||
########################################################################
|
||||
import DatabaseID, AbsTime, JUtil
|
||||
|
||||
from com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID as JavaDatabaseID
|
||||
|
@ -116,4 +124,4 @@ class DBSSClient:
|
|||
return self._dataMgr.getOpMode().name()
|
||||
|
||||
def getTopo(self):
|
||||
return self._tmgr.getCompositeTopo().getScalarGrid().__numpy__[0]
|
||||
return self._tmgr.getCompositeTopo().__numpy__[0]
|
||||
|
|
|
@ -62,6 +62,9 @@ import com.raytheon.viz.ui.personalities.awips.AbstractAWIPSComponent;
|
|||
* which was adding an empty string into the
|
||||
* python path causing python to look in user's
|
||||
* current default directory for modules.
|
||||
* Aug 22, 2014 3500 bclement override postStartupActions()
|
||||
* Aug 29, 2014 3500 bclement removed override of postStartupActions()
|
||||
* since ProcedureXMLManager startup was moved to the CAVE subclass
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -196,4 +199,5 @@ public class GfeClient extends AbstractAWIPSComponent {
|
|||
return new HashSet<String>(Arrays.asList("-site", "-server", "-mode",
|
||||
"-time"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.eclipse.jface.action.IMenuCreator;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
|
||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord.GridType;
|
||||
|
@ -43,6 +44,7 @@ import com.raytheon.viz.ui.dialogs.ColormapComp;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 njensen Initial creation
|
||||
* Aug 11, 2010 wldougher
|
||||
* Aug 28, 2014 3516 rferrel Add separator after color map component.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -120,6 +122,7 @@ public class ChangeColorTableAction extends AbstractRightClickAction implements
|
|||
// Build a ColormapComp to get the menu from
|
||||
ColormapComp comp = new ColormapComp(parent, parms, cap);
|
||||
menu = comp.getMenu();
|
||||
new MenuItem(menu, SWT.SEPARATOR);
|
||||
}
|
||||
|
||||
ActionContributionItem aci = new ActionContributionItem(
|
||||
|
|
|
@ -1,136 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.gfe.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.viz.gfe.core.DataManager;
|
||||
import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* Action for launching delete samples dialog.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* 22JUL2008 #1275. Eric Babin Remove inadvertent dispose on parent shell.
|
||||
* Oct 24, 2012 #1287 rferrel Changes for non-blocking SampleSetDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ShowDeleteSampleSetDialog extends AbstractHandler {
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ShowDeleteSampleSetDialog.class);
|
||||
|
||||
private SampleSetDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands
|
||||
* .ExecutionEvent)
|
||||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
ArrayList<SampleId> sampleIdList = DataManager.getCurrentInstance()
|
||||
.getSampleSetManager().getInventoryAsList();
|
||||
|
||||
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
||||
|
||||
@Override
|
||||
public int compare(SampleId o1, SampleId o2) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
dialog = new SampleSetDialog(shell, sampleIdList,
|
||||
SampleSetDialog.DELETE);
|
||||
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof Integer) {
|
||||
int returnCode = (Integer) returnValue;
|
||||
doDialogClose(returnCode);
|
||||
}
|
||||
dialog = null;
|
||||
}
|
||||
});
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void doDialogClose(int returnCode) {
|
||||
if (returnCode != Window.CANCEL
|
||||
&& dialog.getSelectedSampleIdIndexes() != null) {
|
||||
List<SampleId> sampleIdList = dialog.getSamples();
|
||||
SampleId id = sampleIdList
|
||||
.get(dialog.getSelectedSampleIdIndexes()[0]);
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
if (MessageDialog.openConfirm(shell, "Delete sample set",
|
||||
"Delete selected sample set?")) {
|
||||
if (DataManager.getCurrentInstance().getSampleSetManager()
|
||||
.deleteSampleSet(id)) {
|
||||
statusHandler.handle(Priority.EVENTA, id.getName()
|
||||
+ ", Sample set deleted successfully");
|
||||
} else {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error deleting sample set, " + id.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,27 +19,17 @@
|
|||
**/
|
||||
package com.raytheon.viz.gfe.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.viz.gfe.GFEException;
|
||||
import com.raytheon.viz.gfe.core.DataManager;
|
||||
import com.raytheon.viz.gfe.core.ISampleSetManager;
|
||||
import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
|
||||
import com.raytheon.viz.gfe.dialogs.LoadSampleSetDialog;
|
||||
|
||||
/**
|
||||
* Action to launch sampele set dialog.
|
||||
|
@ -51,6 +41,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* Apr 9, 2009 1288 rjpeter Removed explicit refresh of SpatialDisplayManager.
|
||||
* Oct 24, 2012 1287 rferrel Changes for non-blocking SampleSetDialog.
|
||||
* Sep 15, 2014 3592 randerso Move logic into dialog code.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,11 +51,9 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
|||
|
||||
public class ShowLoadSampleSetDialog extends AbstractHandler {
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ShowLoadSampleSetDialog.class);
|
||||
.getHandler(ShowSaveDeleteSampleSetDialog.class);
|
||||
|
||||
private SampleSetDialog dialog;
|
||||
|
||||
private DataManager dm;
|
||||
private LoadSampleSetDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
@ -74,82 +63,26 @@ public class ShowLoadSampleSetDialog extends AbstractHandler {
|
|||
* .ExecutionEvent)
|
||||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
dm = DataManager.getCurrentInstance();
|
||||
if (dm == null) {
|
||||
return null;
|
||||
}
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
DataManager dm = DataManagerUIFactory.getCurrentInstance();
|
||||
if (dm == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((dialog == null) || (dialog.getShell() == null)
|
||||
|| dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
ArrayList<SampleId> sampleIdList = dm.getSampleSetManager()
|
||||
.getInventoryAsList();
|
||||
|
||||
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
||||
|
||||
@Override
|
||||
public int compare(SampleId o1, SampleId o2) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
dialog = new SampleSetDialog(shell, sampleIdList,
|
||||
SampleSetDialog.LOAD);
|
||||
dialog = new LoadSampleSetDialog(dm.getSampleSetManager(), shell);
|
||||
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof Integer) {
|
||||
int returnCode = (Integer) returnValue;
|
||||
doDialogClosed(returnCode);
|
||||
}
|
||||
dialog = null;
|
||||
}
|
||||
});
|
||||
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void doDialogClosed(int returnCode) {
|
||||
if (returnCode != Window.CANCEL
|
||||
&& dialog.getSelectedSampleIdIndexes() != null) {
|
||||
List<SampleId> sampleIdList = dialog.getSamples();
|
||||
ISampleSetManager.SampleSetLoadMode mode = null;
|
||||
switch (returnCode) {
|
||||
case SampleSetDialog.OK:
|
||||
mode = ISampleSetManager.SampleSetLoadMode.ADD;
|
||||
break;
|
||||
case SampleSetDialog.REMOVE:
|
||||
mode = ISampleSetManager.SampleSetLoadMode.REMOVE;
|
||||
break;
|
||||
case SampleSetDialog.REPLACE:
|
||||
mode = ISampleSetManager.SampleSetLoadMode.REPLACE;
|
||||
break;
|
||||
default:
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Load unknow return code: " + returnCode);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int index : dialog.getSelectedSampleIdIndexes()) {
|
||||
SampleId id = sampleIdList.get(index);
|
||||
try {
|
||||
dm.getSampleSetManager().loadSampleSet(id, mode);
|
||||
} catch (GFEException e) {
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
"Load failed for mode: " + mode.toString()
|
||||
+ ", sample id: " + id.toString(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.gfe.actions;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.viz.gfe.core.DataManager;
|
||||
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
|
||||
import com.raytheon.viz.gfe.dialogs.SaveDeleteSampleSetDialog;
|
||||
|
||||
/**
|
||||
* Action for launching delete samples dialog.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* Jul 28, 2008 #1275. Eric Babin Remove inadvertent dispose on parent shell.
|
||||
* Oct 24, 2012 #1287 rferrel Changes for non-blocking SampleSetDialog.
|
||||
* Sep 15, 2014 #3592 randerso Renamed class, moved logic to dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ShowSaveDeleteSampleSetDialog extends AbstractHandler {
|
||||
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ShowSaveDeleteSampleSetDialog.class);
|
||||
|
||||
private SaveDeleteSampleSetDialog dialog;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands
|
||||
* .ExecutionEvent)
|
||||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
DataManager dm = DataManagerUIFactory.getCurrentInstance();
|
||||
if (dm == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((dialog == null) || (dialog.getShell() == null)
|
||||
|| dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
String action = event.getParameter("Action");
|
||||
dialog = new SaveDeleteSampleSetDialog(dm.getSampleSetManager(),
|
||||
shell, action);
|
||||
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.gfe.actions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||
import com.raytheon.viz.gfe.core.DataManager;
|
||||
import com.raytheon.viz.gfe.core.ISampleSetManager;
|
||||
import com.raytheon.viz.gfe.dialogs.SampleSetDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* Action to show save sample set dialog.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* Oct 24, 2012 1287 rferrel Changes for non-blocking SampleSetDialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class ShowSaveSampleSetDialog extends AbstractHandler {
|
||||
private SampleSetDialog dialog;
|
||||
|
||||
private ISampleSetManager sampleMgr;
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands
|
||||
* .ExecutionEvent)
|
||||
*/
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
if (dialog == null || dialog.getShell() == null || dialog.isDisposed()) {
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
sampleMgr = DataManager.getCurrentInstance().getSampleSetManager();
|
||||
|
||||
ArrayList<SampleId> sampleIdList = sampleMgr.getInventoryAsList();
|
||||
Collections.sort(sampleIdList, new Comparator<SampleId>() {
|
||||
|
||||
@Override
|
||||
public int compare(SampleId o1, SampleId o2) {
|
||||
return o1.getName().compareTo(o2.getName());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
dialog = new SampleSetDialog(shell, sampleIdList,
|
||||
SampleSetDialog.SAVE);
|
||||
|
||||
dialog.setBlockOnOpen(false);
|
||||
dialog.setCloseCallback(new ICloseCallback() {
|
||||
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof Integer) {
|
||||
int returnCode = (Integer) returnValue;
|
||||
doDialogClose(returnCode);
|
||||
}
|
||||
dialog = null;
|
||||
}
|
||||
});
|
||||
dialog.open();
|
||||
} else {
|
||||
dialog.bringToTop();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void doDialogClose(int returnCode) {
|
||||
if ((returnCode == SampleSetDialog.OK)
|
||||
&& (dialog.getSelectedSampleIdIndexes() != null)
|
||||
&& (dialog.getSampleName() != null)) {
|
||||
sampleMgr.saveActiveSampleSet(new SampleId(dialog.getSampleName()));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -101,6 +101,7 @@ import com.raytheon.viz.gfe.textformatter.TextProductManager;
|
|||
* 09/16/2013 2033 dgilling Remove unused IToolController.
|
||||
* 12/09/2013 2367 dgilling Instantiate ProcedureJobPool here.
|
||||
* 05/22/2014 3110 randerso Attach router to edex.alerts.gfe earlier
|
||||
* 09/09/2014 3592 randerso Added call to SampleSetManager.dispose()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -291,6 +292,7 @@ public class DataManager {
|
|||
* {@link DataManagerFactory#dispose(Object)}
|
||||
*/
|
||||
void dispose() {
|
||||
sampleSetManager.dispose();
|
||||
selectTimeRangeManager.dispose();
|
||||
refManager.dispose();
|
||||
parmManager.dispose();
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 07/14/09 1995 bphillip Initial release
|
||||
* 09/01/2014 3572 randerso Removed unused inOurSite method
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -98,20 +99,6 @@ public interface IISCDataAccess {
|
|||
*/
|
||||
public String getISCSite(Point coord, GridID gid);
|
||||
|
||||
/**
|
||||
* Returns true if the coordinate (and grid id) is in our own domain. The
|
||||
* officeType for the parm and our officeType must be the same to be
|
||||
* considered "inOurSite".
|
||||
*
|
||||
* @param loc
|
||||
* The coordinate to check
|
||||
* @param gid
|
||||
* The gridID associated with the coordinate
|
||||
* @return true if coordinate is in our domain and the parm and office type
|
||||
* match
|
||||
*/
|
||||
public boolean inOurSite(Point loc, GridID gid);
|
||||
|
||||
/**
|
||||
* Returns the data point for the gridid. Will return either the data point
|
||||
* from the specified grid, or its corresponding isc grid, depending upon
|
||||
|
|
|
@ -20,13 +20,10 @@
|
|||
|
||||
package com.raytheon.viz.gfe.core;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.gfe.GFEException;
|
||||
import com.raytheon.viz.gfe.core.msgs.ISampleSetChangedListener;
|
||||
import com.raytheon.viz.gfe.edittool.GridID;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
@ -39,19 +36,43 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 30, 2008 chammack Initial creation
|
||||
* Apr 9, 2009 1288 rjpeter Added add/remove method for sample set listener
|
||||
* Apr 09, 2009 1288 rjpeter Added add/remove method for sample set listener
|
||||
* Sep 09, 2014 3592 randerso Added dispose method,
|
||||
* removed getInventoryAsList and networkNotification,
|
||||
* improved JavaDoc
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1.0
|
||||
*/
|
||||
public interface ISampleSetManager {
|
||||
/**
|
||||
* Sample Set Load Mode
|
||||
*/
|
||||
public static enum SampleSetLoadMode {
|
||||
ADD, REMOVE, REPLACE
|
||||
/**
|
||||
* Add sample set to existing sample points
|
||||
*/
|
||||
ADD,
|
||||
|
||||
/**
|
||||
* Remove sample set from existing sample points
|
||||
*/
|
||||
REMOVE,
|
||||
|
||||
/**
|
||||
* Replase existing sample points with sample set
|
||||
*/
|
||||
REPLACE
|
||||
}
|
||||
|
||||
public static final float DEFAULT_THRESHOLD = 0.0f;
|
||||
|
||||
/**
|
||||
* Dispose the SampleSetManager
|
||||
*/
|
||||
public void dispose();
|
||||
|
||||
/**
|
||||
* Returns the set of sample points for the named sample set. If the sample
|
||||
* set is not known, an empty list will be returned.
|
||||
|
@ -59,8 +80,7 @@ public interface ISampleSetManager {
|
|||
* @param setName
|
||||
* @return the locations
|
||||
*/
|
||||
public List<Coordinate> sampleSetLocations(final String setName)
|
||||
throws GFEException;
|
||||
public List<Coordinate> sampleSetLocations(final String setName);
|
||||
|
||||
/**
|
||||
* Loads the named sample set and mixes it with the active sample set in a
|
||||
|
@ -76,7 +96,7 @@ public interface ISampleSetManager {
|
|||
* @param loadMode
|
||||
*/
|
||||
public void loadSampleSet(final SampleId sampleId,
|
||||
SampleSetLoadMode loadMode) throws GFEException;
|
||||
SampleSetLoadMode loadMode);
|
||||
|
||||
/**
|
||||
* Clears all anchored samples.
|
||||
|
@ -196,15 +216,6 @@ public interface ISampleSetManager {
|
|||
*/
|
||||
public boolean deleteSampleSet(final SampleId sampleId);
|
||||
|
||||
/**
|
||||
* Input network sample notification from NetworkMgr indicating that the
|
||||
* sample set inventory has changed or the contents of a sample set has
|
||||
* changed.
|
||||
*/
|
||||
public void networkNotification(final SampleId[] anInventory,
|
||||
final SampleId[] additions, final SampleId[] deletions,
|
||||
final SampleId[] changes) throws VizException;
|
||||
|
||||
/**
|
||||
* @return the loadedSet
|
||||
*/
|
||||
|
@ -215,13 +226,6 @@ public interface ISampleSetManager {
|
|||
*/
|
||||
public SampleId[] getInventory();
|
||||
|
||||
/**
|
||||
* Return the inventory as a list
|
||||
*
|
||||
* @return the inventory
|
||||
*/
|
||||
public ArrayList<SampleId> getInventoryAsList();
|
||||
|
||||
/**
|
||||
* @return the inventory
|
||||
*/
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.viz.gfe.core.internal.SampleSetManager;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 25, 2011 njensen Initial creation
|
||||
* Sep 09, 2014 #3592 randerso Removed unused DataManager parameter to SampleSetManager constructor
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,7 +61,7 @@ public class SampleSetMgrInitJob extends Job {
|
|||
*/
|
||||
@Override
|
||||
protected IStatus run(IProgressMonitor monitor) {
|
||||
dataMgr.sampleSetManager = new SampleSetManager(dataMgr);
|
||||
dataMgr.sampleSetManager = new SampleSetManager();
|
||||
dataMgr.getInitStatus().setSampleSetMgrDone(true);
|
||||
|
||||
return Status.OK_STATUS;
|
||||
|
|
|
@ -36,7 +36,6 @@ import com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID;
|
|||
import com.raytheon.uf.common.dataplugin.gfe.discrete.DiscreteKey;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2D;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DBit;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DBoolean;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DByte;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.grid.Grid2DFloat;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.reference.ReferenceData;
|
||||
|
@ -75,6 +74,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* 07/14/09 1995 bphillip Initial release
|
||||
* 10/31/2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
|
||||
* 09/01/2014 3572 randerso Removed ourSiteMap as it was unused and the only
|
||||
* thing that used Grid2DBoolean
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -90,10 +91,6 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
|
||||
private Map<String, Grid2D<String>> siteGridMap;
|
||||
|
||||
// private Map<String, List<String>> siteIdentifiers;
|
||||
|
||||
private Grid2DBoolean ourSiteMap;
|
||||
|
||||
/**
|
||||
* Constructs a new ISCDataAccess object
|
||||
*
|
||||
|
@ -207,21 +204,6 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inOurSite(Point loc, GridID gid) {
|
||||
// must be our office type to be inOurSite
|
||||
if (!dataMgr.getOfficeType().equals(gid.getParm().getOfficeType())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.ourSiteMap.isValid(loc.x, loc.y)) {
|
||||
return this.ourSiteMap.get(loc.x, loc.y);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxValue getDataPoint(GridID gridID, Coordinate worldLoc)
|
||||
throws GFEServerException {
|
||||
|
@ -511,7 +493,7 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
"getCompositeGrid called on non-discrete parm");
|
||||
|
||||
slice.setDiscreteGrid(new Grid2DByte());
|
||||
slice.setKey(new DiscreteKey[0]);
|
||||
slice.setKeys(new DiscreteKey[0]);
|
||||
return new Grid2DBit();
|
||||
}
|
||||
|
||||
|
@ -519,7 +501,7 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
Grid2DBit ourSiteMask = null;
|
||||
if (primary == null) {
|
||||
slice.setDiscreteGrid(new Grid2DByte(nx, ny));
|
||||
slice.setKey(new DiscreteKey[0]);
|
||||
slice.setKeys(new DiscreteKey[0]);
|
||||
primary = new DiscreteGridData(gid.getParm(), slice);
|
||||
ourSiteMask = new Grid2DBit(nx, ny);
|
||||
} else {
|
||||
|
@ -536,7 +518,7 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
keys[i] = new DiscreteKey(primary.getDiscreteSlice().getKeys()[i]);
|
||||
}
|
||||
|
||||
slice.setKey(keys);
|
||||
slice.setKeys(keys);
|
||||
keys = null; // don't use this copy any more
|
||||
|
||||
// isc grid
|
||||
|
@ -580,7 +562,7 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
newKeyList[key.getValue().intValue()] = key.getKey();
|
||||
}
|
||||
|
||||
slice.setKey(newKeyList);
|
||||
slice.setKeys(newKeyList);
|
||||
return siteMask.or(ourSiteMask);
|
||||
}
|
||||
|
||||
|
@ -590,10 +572,6 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
protected void createSiteMask() {
|
||||
GridLocation gloc = dataMgr.getParmManager().compositeGridLocation();
|
||||
|
||||
// reinitialize data to empty
|
||||
ourSiteMap = new Grid2DBoolean(gloc.gridSize().x, gloc.gridSize().y);
|
||||
// siteIdentifiers = new HashMap<String, List<String>>();
|
||||
|
||||
siteGridMap = new HashMap<String, Grid2D<String>>();
|
||||
|
||||
// get list of known sites from server -- ignore any errors
|
||||
|
@ -624,7 +602,6 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
// point.
|
||||
Grid2D<String> sites = new Grid2D<String>(gloc.gridSize().x,
|
||||
gloc.gridSize().y);
|
||||
// List<String> siteIdentifiers = new ArrayList<String>();
|
||||
|
||||
for (String iscea : iscEAs) {
|
||||
|
||||
|
@ -642,7 +619,6 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
Grid2DBit bits = refDat.getGrid();
|
||||
|
||||
if (bits.isAnyBitsSet()) {
|
||||
// siteIdentifiers.add(iscea);
|
||||
|
||||
for (int y = 0; y < bits.getYdim(); y++) {
|
||||
for (int x = 0; x < bits.getXdim(); x++) {
|
||||
|
@ -652,22 +628,9 @@ public class ISCDataAccess implements IISCDataAccess {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// special mapping for our site map
|
||||
if (iscea.equals(dataMgr.getSiteID())) {
|
||||
for (int y = 0; y < bits.getYdim(); y++) {
|
||||
for (int x = 0; x < bits.getXdim(); x++) {
|
||||
if (bits.get(x, y) > 0) {
|
||||
ourSiteMap.set(x, y, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// store result in maps
|
||||
// this.siteIdentifiers.put(officeType, siteIdentifiers);
|
||||
this.siteGridMap.put(officeType, sites);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ import com.raytheon.viz.gfe.types.MutableInteger;
|
|||
* Changed handling of enabling/disabling Topo parm
|
||||
* 04/02/2014 #2969 randerso Fix error when Toop parm is unloaded.
|
||||
* 05/28/2014 #3110 randerso Remove #3105 changes
|
||||
* 09/08/2104 #3592 randerso Changed to use new pm listStaticFiles()
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -3093,11 +3094,10 @@ public class ParmManager implements IParmManager, IMessageClient {
|
|||
private List<VCModule> initVirtualCalcParmDefinitions() {
|
||||
// retrieve the inventory from the ifpServer
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
LocalizationFile[] modules = pathMgr
|
||||
.listFiles(
|
||||
pathMgr.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
|
||||
FileUtil.join("gfe", "vcmodule"),
|
||||
new String[] { "py" }, false, true);
|
||||
LocalizationFile[] modules = pathMgr.listStaticFiles(
|
||||
LocalizationType.COMMON_STATIC,
|
||||
FileUtil.join("gfe", "vcmodule"), new String[] { "py" }, false,
|
||||
true);
|
||||
|
||||
List<VCModule> definitions = new ArrayList<VCModule>(modules.length);
|
||||
for (LocalizationFile mod : modules) {
|
||||
|
@ -3106,6 +3106,7 @@ public class ParmManager implements IParmManager, IMessageClient {
|
|||
File textData = mod.getFile(true);
|
||||
|
||||
// create the VCModule
|
||||
statusHandler.debug("Loading VCModule: " + mod);
|
||||
VCModule m = new VCModule(dataManager, this, textData);
|
||||
if (!m.isValid()) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
|
|
|
@ -109,6 +109,7 @@ import com.vividsolutions.jts.geom.Envelope;
|
|||
* 06/21/2013 14983 ryu Added method for synchronous evaluation of query.
|
||||
* 08/06/2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
|
||||
* 09/30/2013 2361 njensen Use JAXBManager for XML
|
||||
* 09/08/2104 #3592 randerso Changed to use new pm listStaticFiles()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -231,9 +232,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
// load the complete list of edit areas
|
||||
List<ReferenceID> refIDs = new ArrayList<ReferenceID>();
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationContext[] ctx = pm
|
||||
.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC);
|
||||
LocalizationFile[] contents = pm.listFiles(ctx, EDIT_AREAS_DIR,
|
||||
LocalizationFile[] contents = pm.listStaticFiles(
|
||||
LocalizationType.COMMON_STATIC, EDIT_AREAS_DIR,
|
||||
new String[] { ".xml" }, false, true);
|
||||
if (contents != null) {
|
||||
for (LocalizationFile lf : contents) {
|
||||
|
@ -245,7 +245,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
}
|
||||
|
||||
// load the edit area group lists
|
||||
LocalizationFile[] groupFiles = pm.listFiles(ctx, EDIT_AREA_GROUPS_DIR,
|
||||
LocalizationFile[] groupFiles = pm.listStaticFiles(
|
||||
LocalizationType.COMMON_STATIC, EDIT_AREA_GROUPS_DIR,
|
||||
new String[] { ".txt" }, false, true);
|
||||
if (groupFiles != null) {
|
||||
for (LocalizationFile lf : groupFiles) {
|
||||
|
@ -779,8 +780,8 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
|
||||
if (lf != null) {
|
||||
try {
|
||||
refData = ReferenceData.getJAXBManager()
|
||||
.unmarshalFromXmlFile(lf.getFile().getPath());
|
||||
refData = ReferenceData.getJAXBManager().unmarshalFromXmlFile(
|
||||
lf.getFile().getPath());
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error reading xml file "
|
||||
|
@ -921,7 +922,7 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
LocalizationFile lf = pm.getLocalizationFile(ctx,
|
||||
FileUtil.join(EDIT_AREAS_DIR, refID.getName() + ".xml"));
|
||||
|
||||
if (lf != null
|
||||
if ((lf != null)
|
||||
&& (!withVerification || AccessMgr.verifyDelete(lf.getName(),
|
||||
LocalizationType.COMMON_STATIC, false))) {
|
||||
try {
|
||||
|
@ -1124,7 +1125,7 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
if (pointyTaper) {
|
||||
for (i = ll.x; i <= ur.x; i++) {
|
||||
for (j = ll.y; j <= ur.y; j++) {
|
||||
grid.set(i, j, grid.get(i, j) * taperFactor / maxDist);
|
||||
grid.set(i, j, (grid.get(i, j) * taperFactor) / maxDist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1192,7 +1193,7 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
int y = j;
|
||||
while ((x >= 0) && (y >= 0) && (x < dim.x) && (y < dim.y)
|
||||
&& bitGrid.getAsBoolean(x, y)) {
|
||||
vdist = vdist + Math.sqrt(v.x * v.x + v.y * v.y);
|
||||
vdist = vdist + Math.sqrt((v.x * v.x) + (v.y * v.y));
|
||||
x = x + v.x;
|
||||
y = y + v.y;
|
||||
}
|
||||
|
@ -1200,11 +1201,12 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
y = j;
|
||||
while ((x >= 0) && (y >= 0) && (x < dim.x) && (y < dim.y)
|
||||
&& bitGrid.getAsBoolean(x, y)) {
|
||||
avdist = avdist + Math.sqrt(av.x * av.x + av.y * av.y);
|
||||
avdist = avdist
|
||||
+ Math.sqrt((av.x * av.x) + (av.y * av.y));
|
||||
x = x + av.x;
|
||||
y = y + av.y;
|
||||
}
|
||||
if (vdist + avdist == 0) {
|
||||
if ((vdist + avdist) == 0) {
|
||||
grid.set(i, j, 0.0f);
|
||||
} else {
|
||||
grid.set(i, j, (float) (vdist / (vdist + avdist)));
|
||||
|
@ -1352,7 +1354,7 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
|
||||
/**
|
||||
* @param ref
|
||||
* @param mode2
|
||||
* @param mode
|
||||
*/
|
||||
private void setRefSet(ReferenceData ref, RefSetMode mode) {
|
||||
mode = determineMode(mode);
|
||||
|
@ -1383,7 +1385,7 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
}
|
||||
|
||||
/**
|
||||
* @param mode2
|
||||
* @param mode
|
||||
* @return
|
||||
*/
|
||||
private RefSetMode determineMode(RefSetMode mode) {
|
||||
|
@ -1666,7 +1668,7 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
LocalizationFile lf = PathManagerFactory.getPathManager()
|
||||
.getStaticLocalizationFile(filePath);
|
||||
|
||||
if (lf != null && lf.exists()) {
|
||||
if ((lf != null) && lf.exists()) {
|
||||
changes.add(refId);
|
||||
} else {
|
||||
deletions.add(refId);
|
||||
|
@ -1718,7 +1720,7 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
.getFileName());
|
||||
|
||||
// if it exists, load it
|
||||
if (lf != null && lf.exists()) {
|
||||
if ((lf != null) && lf.exists()) {
|
||||
loadGroup(lf);
|
||||
}
|
||||
checkGroupConsistency();
|
||||
|
@ -1824,7 +1826,7 @@ public class ReferenceSetManager implements IReferenceSetManager,
|
|||
|
||||
Date spedTime = dataManager.getSpatialDisplayManager()
|
||||
.getSpatialEditorTime();
|
||||
if (spedTime != null && msg.getTimeRange().contains(spedTime)) {
|
||||
if ((spedTime != null) && msg.getTimeRange().contains(spedTime)) {
|
||||
evaluateActiveRefSet(listener);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,17 +22,22 @@ package com.raytheon.viz.gfe.core.internal;
|
|||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import org.geotools.referencing.GeodeticCalculator;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleData;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||
import com.raytheon.uf.common.localization.FileUpdatedMessage;
|
||||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
|
@ -47,13 +52,12 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.util.FileUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.gfe.Activator;
|
||||
import com.raytheon.viz.gfe.GFEException;
|
||||
import com.raytheon.viz.gfe.core.DataManager;
|
||||
import com.raytheon.viz.gfe.core.ISampleSetManager;
|
||||
import com.raytheon.viz.gfe.core.msgs.ISampleSetChangedListener;
|
||||
import com.raytheon.viz.gfe.edittool.GridID;
|
||||
import com.raytheon.viz.gfe.ui.AccessMgr;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -68,13 +72,17 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Apr 9, 2009 1288 rjpeter Added ISampleSetChangedListener handling.
|
||||
* Aug 6, 2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
|
||||
* Sep 30, 2013 2361 njensen Use JAXBManager for XML
|
||||
* Sep 08, 2104 #3592 randerso Changed to use new pm listStaticFiles().
|
||||
* Reworked inventory to use a map to better handle
|
||||
* files at multiple localization levels
|
||||
* </pre>
|
||||
*
|
||||
* @author rbell
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SampleSetManager implements ISampleSetManager {
|
||||
public class SampleSetManager implements ISampleSetManager,
|
||||
ILocalizationFileObserver {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SampleSetManager.class);
|
||||
|
||||
|
@ -85,28 +93,29 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
|
||||
private SampleId loadedSet;
|
||||
|
||||
private Set<SampleId> inventory;
|
||||
private SortedMap<String, SampleId> inventory;
|
||||
|
||||
private ArrayList<Coordinate> locations;
|
||||
|
||||
private Map<String, List<Coordinate>> markerLocations;
|
||||
|
||||
private final DataManager dataManager;
|
||||
|
||||
private final Set<ISampleSetChangedListener> sampleSetChangedListeners;
|
||||
|
||||
private boolean showLatLon;
|
||||
|
||||
private IPathManager pathManager;
|
||||
|
||||
private LocalizationFile sampleSetDir;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*
|
||||
* Gets the initial sample inventory.
|
||||
*/
|
||||
public SampleSetManager(DataManager dataManager) {
|
||||
this.dataManager = dataManager;
|
||||
public SampleSetManager() {
|
||||
this.loadedSet = new SampleId();
|
||||
|
||||
this.inventory = new HashSet<SampleId>();
|
||||
this.inventory = new TreeMap<String, SampleId>();
|
||||
|
||||
this.locations = new ArrayList<Coordinate>();
|
||||
|
||||
|
@ -114,43 +123,48 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
|
||||
this.sampleSetChangedListeners = new HashSet<ISampleSetChangedListener>();
|
||||
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
this.pathManager = PathManagerFactory.getPathManager();
|
||||
|
||||
LocalizationFile[] files = pm.listFiles(
|
||||
pm.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
|
||||
SAMPLE_SETS_DIR, new String[] { ".xml" }, true, true);
|
||||
this.sampleSetDir = pathManager.getLocalizationFile(pathManager
|
||||
.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.BASE), SAMPLE_SETS_DIR);
|
||||
|
||||
for (LocalizationFile file : files) {
|
||||
String fn = LocalizationUtil.extractName(file.getName()).replace(
|
||||
// initialize the inventory
|
||||
LocalizationFile[] files = pathManager.listStaticFiles(
|
||||
LocalizationType.COMMON_STATIC, SAMPLE_SETS_DIR,
|
||||
new String[] { ".xml" }, true, true);
|
||||
|
||||
for (LocalizationFile lf : files) {
|
||||
String name = LocalizationUtil.extractName(lf.getName()).replace(
|
||||
".xml", "");
|
||||
this.inventory.add(new SampleId(fn));
|
||||
this.inventory.put(name, new SampleId(name, false, lf.getContext()
|
||||
.getLocalizationLevel()));
|
||||
}
|
||||
this.sampleSetDir.addFileUpdatedObserver(this);
|
||||
|
||||
// load default sample points
|
||||
String[] sampleSets = Activator.getDefault().getPreferenceStore()
|
||||
.getStringArray("DefaultSamples");
|
||||
if (sampleSets != null) {
|
||||
for (String id : sampleSets) {
|
||||
SampleId sid = new SampleId(id);
|
||||
if (this.inventory.contains(sid)) {
|
||||
try {
|
||||
loadSampleSet(sid, SampleSetLoadMode.ADD);
|
||||
} catch (GFEException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
e.getLocalizedMessage(), e);
|
||||
|
||||
}
|
||||
for (String name : sampleSets) {
|
||||
SampleId sid = inventory.get(name);
|
||||
if (sid != null) {
|
||||
loadSampleSet(sid, SampleSetLoadMode.ADD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get initial marker points
|
||||
try {
|
||||
getMarkerPoints();
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to get initial sampleset marker points", e);
|
||||
}
|
||||
getMarkerPoints();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
this.sampleSetDir.removeFileUpdatedObserver(this);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -160,45 +174,43 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#sampleSetLocations(java.lang
|
||||
* .String)
|
||||
*/
|
||||
public List<Coordinate> sampleSetLocations(final String setName)
|
||||
throws GFEException {
|
||||
@Override
|
||||
public List<Coordinate> sampleSetLocations(final String setName) {
|
||||
// verify set in inventory
|
||||
boolean found = false;
|
||||
for (SampleId thisId : this.inventory) {
|
||||
if (setName.equals(thisId.getName())) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
SampleId sampleId = this.inventory.get(setName);
|
||||
|
||||
if (!found) {
|
||||
throw new GFEException(
|
||||
"Attempt to get locations for unknown sample set ["
|
||||
if (sampleId == null) {
|
||||
statusHandler
|
||||
.error("Attempt to get locations for unknown sample set ["
|
||||
+ setName + "]");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
String fileName = FileUtil.join(SAMPLE_SETS_DIR, setName + ".xml");
|
||||
String fileName = FileUtil.join(SAMPLE_SETS_DIR, sampleId.getName()
|
||||
+ ".xml");
|
||||
|
||||
LocalizationFile file = PathManagerFactory.getPathManager()
|
||||
.getStaticLocalizationFile(fileName);
|
||||
LocalizationFile lf = this.pathManager.getLocalizationFile(
|
||||
this.pathManager.getContext(LocalizationType.COMMON_STATIC,
|
||||
sampleId.getAccess()), fileName);
|
||||
|
||||
File f = null;
|
||||
File file = null;
|
||||
try {
|
||||
f = file.getFile(true);
|
||||
file = lf.getFile(true);
|
||||
} catch (LocalizationException e) {
|
||||
if (f == null) {
|
||||
throw new GFEException(
|
||||
"An error occurred retrieving SampleSet: " + fileName,
|
||||
e);
|
||||
if (file == null) {
|
||||
statusHandler.error("An error occurred retrieving SampleSet: "
|
||||
+ fileName, e);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
SampleData sampleData = null;
|
||||
try {
|
||||
sampleData = SampleData.getJAXBManager().unmarshalFromXmlFile(
|
||||
f.getAbsolutePath());
|
||||
file.getAbsolutePath());
|
||||
} catch (Exception e) {
|
||||
throw new GFEException("Unable to load sampledata: " + f, e);
|
||||
statusHandler.error("Unable to load sampledata: " + file, e);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return sampleData.getPoints();
|
||||
|
@ -212,17 +224,19 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* .edex.plugin.gfe.sample.SampleId,
|
||||
* com.raytheon.viz.gfe.core.internal.SampleSetManager.SampleSetLoadMode)
|
||||
*/
|
||||
@Override
|
||||
public void loadSampleSet(final SampleId sampleId,
|
||||
SampleSetLoadMode loadMode) throws GFEException {
|
||||
File f = PathManagerFactory.getPathManager().getStaticFile(
|
||||
FileUtil.join(SAMPLE_SETS_DIR, sampleId.getName() + ".xml"));
|
||||
SampleSetLoadMode loadMode) {
|
||||
File f = this.pathManager.getStaticFile(FileUtil.join(SAMPLE_SETS_DIR,
|
||||
sampleId.getName() + ".xml"));
|
||||
|
||||
SampleData sampleData = null;
|
||||
try {
|
||||
sampleData = SampleData.getJAXBManager().unmarshalFromXmlFile(
|
||||
f.getPath());
|
||||
sampleData.setSampleId(sampleId);
|
||||
} catch (Exception e) {
|
||||
throw new GFEException("Unable to load sampledata: " + f);
|
||||
statusHandler.error("Unable to load sampledata: " + f);
|
||||
}
|
||||
|
||||
// set the loadedSet flag appropriately
|
||||
|
@ -247,6 +261,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#clearSamples()
|
||||
*/
|
||||
@Override
|
||||
public void clearSamples() {
|
||||
mergeSamples(new ArrayList<Coordinate>(), SampleSetLoadMode.REPLACE);
|
||||
this.loadedSet = new SampleId(); // no loaded set
|
||||
|
@ -260,6 +275,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* @seecom.raytheon.viz.gfe.core.ISampleSetManager#addAnchoredSample(com.
|
||||
* vividsolutions.jts.geom.Coordinate)
|
||||
*/
|
||||
@Override
|
||||
public void addAnchoredSample(final Coordinate sampleLocation) {
|
||||
mergeSamples(Arrays.asList(sampleLocation), SampleSetLoadMode.ADD);
|
||||
this.loadedSet = new SampleId(); // no longer a loaded set
|
||||
|
@ -274,6 +290,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#removeAnchoredSample(com.
|
||||
* vividsolutions.jts.geom.Coordinate)
|
||||
*/
|
||||
@Override
|
||||
public void removeAnchoredSample(final Coordinate sampleLocation) {
|
||||
removeAnchoredSample(sampleLocation,
|
||||
ISampleSetManager.DEFAULT_THRESHOLD);
|
||||
|
@ -286,6 +303,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#removeAnchoredSample(com.
|
||||
* vividsolutions.jts.geom.Coordinate, float)
|
||||
*/
|
||||
@Override
|
||||
public void removeAnchoredSample(final Coordinate sampleLocation,
|
||||
float threshold) {
|
||||
mergeSamples(Arrays.asList(sampleLocation), SampleSetLoadMode.REMOVE,
|
||||
|
@ -301,6 +319,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* @seecom.raytheon.viz.gfe.core.ISampleSetManager#addAnchoredMarker(com.
|
||||
* vividsolutions.jts.geom.Coordinate)
|
||||
*/
|
||||
@Override
|
||||
public void addAnchoredMarker(final Coordinate location, final GridID gid) {
|
||||
String set = activeMarkerSet(gid);
|
||||
List<Coordinate> locations = markerLocations.get(set);
|
||||
|
@ -319,6 +338,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#removeAnchoredMarker(com.
|
||||
* vividsolutions.jts.geom.Coordinate)
|
||||
*/
|
||||
@Override
|
||||
public void removeAnchoredMarker(final Coordinate location, final GridID gid) {
|
||||
removeAnchoredMarker(location, gid, ISampleSetManager.DEFAULT_THRESHOLD);
|
||||
}
|
||||
|
@ -330,6 +350,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#removeAnchoredMarker(com.
|
||||
* vividsolutions.jts.geom.Coordinate, float)
|
||||
*/
|
||||
@Override
|
||||
public void removeAnchoredMarker(final Coordinate location,
|
||||
final GridID gid, float threshold) {
|
||||
boolean found = false;
|
||||
|
@ -361,6 +382,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#anchoredMarkerAtLocation(
|
||||
* com.vividsolutions.jts.geom.Coordinate, float)
|
||||
*/
|
||||
@Override
|
||||
public boolean anchoredMarkerAtLocation(final Coordinate location,
|
||||
final GridID gid, float threshold) {
|
||||
String set = activeMarkerSet(gid);
|
||||
|
@ -388,17 +410,16 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#saveSampleSet(com.vividsolutions
|
||||
* .jts.geom.Coordinate[], com.raytheon.edex.plugin.gfe.sample.SampleId)
|
||||
*/
|
||||
@Override
|
||||
public boolean saveSampleSet(final List<Coordinate> sampleLocations,
|
||||
final SampleId sampleId) {
|
||||
|
||||
SampleData sd = new SampleData(sampleId, sampleLocations);
|
||||
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationContext lc = this.pathManager.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER);
|
||||
|
||||
LocalizationContext lc = pm.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.USER);
|
||||
|
||||
LocalizationFile file = pm.getLocalizationFile(lc,
|
||||
LocalizationFile file = this.pathManager.getLocalizationFile(lc,
|
||||
FileUtil.join(SAMPLE_SETS_DIR, sampleId.getName() + ".xml"));
|
||||
|
||||
try {
|
||||
|
@ -413,13 +434,6 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
e);
|
||||
}
|
||||
|
||||
this.inventory.add(sampleId);
|
||||
|
||||
// // send a notification to interested users
|
||||
// networkNotification(notification.inventory(),
|
||||
// notification.additions(),
|
||||
// notification.deletions(), notification.changes());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -430,6 +444,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#saveActiveSampleSet(com.raytheon
|
||||
* .edex.plugin.gfe.sample.SampleId)
|
||||
*/
|
||||
@Override
|
||||
public boolean saveActiveSampleSet(final SampleId sampleId) {
|
||||
this.loadedSet = sampleId;
|
||||
return saveSampleSet(this.locations, sampleId);
|
||||
|
@ -442,98 +457,89 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
* com.raytheon.viz.gfe.core.ISampleSetManager#deleteSampleSet(com.raytheon
|
||||
* .edex.plugin.gfe.sample.SampleId)
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteSampleSet(final SampleId sampleId) {
|
||||
LocalizationFile file = PathManagerFactory.getPathManager()
|
||||
.getStaticLocalizationFile(
|
||||
FileUtil.join(SAMPLE_SETS_DIR, sampleId.getName()
|
||||
+ ".xml"));
|
||||
|
||||
LocalizationContext context = file.getContext();
|
||||
if (context.getLocalizationLevel() != LocalizationLevel.USER) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Unable to delete "
|
||||
+ sampleId.getName()
|
||||
+ ", because it is not a sampleset owned by you.");
|
||||
return false;
|
||||
LocalizationContext ctx = this.pathManager.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.USER);
|
||||
LocalizationFile lf = this.pathManager.getLocalizationFile(ctx,
|
||||
FileUtil.join(SAMPLE_SETS_DIR, sampleId.getName() + ".xml"));
|
||||
|
||||
if ((lf != null)
|
||||
&& (AccessMgr.verifyDelete(lf.getName(),
|
||||
LocalizationType.COMMON_STATIC, false))) {
|
||||
try {
|
||||
lf.delete();
|
||||
return true;
|
||||
} catch (LocalizationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Unable to sample set "
|
||||
+ sampleId.getName() + " from server.", e);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
file.delete();
|
||||
this.inventory.remove(sampleId);
|
||||
} catch (LocalizationOpFailedException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error deleting from localization server", e);
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.gfe.core.ISampleSetManager#networkNotification(com.raytheon
|
||||
* .edex.plugin.gfe.sample.SampleId[],
|
||||
* com.raytheon.edex.plugin.gfe.sample.SampleId[],
|
||||
* com.raytheon.edex.plugin.gfe.sample.SampleId[],
|
||||
* com.raytheon.edex.plugin.gfe.sample.SampleId[])
|
||||
* com.raytheon.uf.common.localization.ILocalizationFileObserver#fileUpdated
|
||||
* (com.raytheon.uf.common.localization.FileUpdatedMessage)
|
||||
*/
|
||||
public void networkNotification(final SampleId[] anInventory,
|
||||
final SampleId[] additions, final SampleId[] deletions,
|
||||
final SampleId[] changes) throws VizException {
|
||||
@Override
|
||||
public void fileUpdated(FileUpdatedMessage message) {
|
||||
|
||||
// logDebug << "NetworkNotification newInv=" << anInventory
|
||||
// << " add=" << additions << " del=" << deletions << " chg="
|
||||
// << changes << std::endl;
|
||||
// logDebug << "OldInventory=" << anInventory << std::endl;
|
||||
// logDebug << "Active loaded set=" << _loadedSet << std::endl;
|
||||
String name = LocalizationUtil.extractName(message.getFileName())
|
||||
.replace(".xml", "");
|
||||
SampleId id = new SampleId(name, false, message.getContext()
|
||||
.getLocalizationLevel());
|
||||
|
||||
// store the new inventory
|
||||
this.inventory = new HashSet<SampleId>(Arrays.asList(anInventory));
|
||||
switch (message.getChangeType()) {
|
||||
case ADDED:
|
||||
case UPDATED:
|
||||
SampleId existing = this.inventory.get(id.getName());
|
||||
if ((existing == null)
|
||||
|| (existing.getAccess().compareTo(id.getAccess()) <= 0)) {
|
||||
this.inventory.put(id.getName(), id);
|
||||
|
||||
// loaded sample set changed?, check by name field for a match
|
||||
for (SampleId changesId : changes) {
|
||||
if (changesId.getName().equals(this.loadedSet.getName())) {
|
||||
// logDebug << "LoadedSampleSet changed " << _loadedSet <<
|
||||
// std::endl;
|
||||
loadSampleSet(changesId, SampleSetLoadMode.REPLACE);
|
||||
// loaded sample set "added", may simply be a rename
|
||||
if (id.getName().equals(this.loadedSet.getName())) {
|
||||
loadSampleSet(id, SampleSetLoadMode.REPLACE);
|
||||
}
|
||||
if (id.getName().equals(SampleSetManager.MARKER_NAME)) {
|
||||
getMarkerPoints();
|
||||
}
|
||||
}
|
||||
if (changesId.getName().equals(SampleSetManager.MARKER_NAME)) {
|
||||
// logDebug << "MarkerSet changed " << changesId << std::endl;
|
||||
getMarkerPoints();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// loaded sample set deleted?
|
||||
for (SampleId deletionsId : deletions) {
|
||||
if (deletionsId.getName().equals(this.loadedSet.getName())) {
|
||||
// logDebug << "LoadedSampleSet deleted " << _loadedSet
|
||||
// << ' ' << deletionsId << std::endl;
|
||||
case DELETED:
|
||||
LocalizationFile[] files = pathManager.listStaticFiles(
|
||||
LocalizationType.COMMON_STATIC, message.getFileName(),
|
||||
new String[] { ".xml" }, false, true);
|
||||
|
||||
if (files.length == 0) {
|
||||
this.inventory.remove(id.getName());
|
||||
} else {
|
||||
this.inventory.put(id.getName(), new SampleId(id.getName(),
|
||||
false, files[0].getContext().getLocalizationLevel()));
|
||||
}
|
||||
|
||||
if (id.getName().equals(this.loadedSet.getName())) {
|
||||
this.loadedSet = new SampleId();
|
||||
}
|
||||
if (deletionsId.getName().equals(SampleSetManager.MARKER_NAME)) {
|
||||
// logDebug << "MarkerSet deleted " << deletionsId << std::endl;
|
||||
|
||||
if (id.getName().equals(SampleSetManager.MARKER_NAME)) {
|
||||
getMarkerPoints();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
statusHandler.error("Unexpected FileChangeType received: "
|
||||
+ message.getChangeType().name());
|
||||
break;
|
||||
}
|
||||
|
||||
// loaded sample set "added", may simply be a rename
|
||||
for (SampleId additionsId : additions) {
|
||||
if (additionsId.getName().equals(this.loadedSet.getName())) {
|
||||
// logDebug << "LoadedSampleSet added " << _loadedSet
|
||||
// << " " << additionsId << std::endl;
|
||||
loadSampleSet(additionsId, SampleSetLoadMode.REPLACE);
|
||||
}
|
||||
if (additionsId.getName().equals(SampleSetManager.MARKER_NAME)) {
|
||||
// logDebug << "MarkerSet added " << additionsId << std::endl;
|
||||
getMarkerPoints();
|
||||
}
|
||||
}
|
||||
|
||||
// inventory changed?
|
||||
if ((additions.length > 0) || (deletions.length > 0)
|
||||
|| (changes.length > 0)) {
|
||||
}
|
||||
// logDebug << "Active set is now: " << _loadedSet << std::endl;
|
||||
fireSampleSetChangedListeners();
|
||||
}
|
||||
|
||||
|
@ -603,15 +609,13 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* Gets the set of points, sends out notification of changes.
|
||||
*/
|
||||
private void getMarkerPoints() throws VizException {
|
||||
private void getMarkerPoints() {
|
||||
// ensure it is in the inventory
|
||||
this.markerLocations.clear();
|
||||
|
||||
for (Iterator<SampleId> it = this.inventory.iterator(); it.hasNext();) {
|
||||
SampleId id = it.next();
|
||||
if (id.getName().startsWith(MARKER_NAME)) {
|
||||
markerLocations.put(id.getName(),
|
||||
this.sampleSetLocations(id.getName()));
|
||||
for (String name : this.inventory.keySet()) {
|
||||
if (name.startsWith(MARKER_NAME)) {
|
||||
markerLocations.put(name, this.sampleSetLocations(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -621,6 +625,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#getLoadedSet()
|
||||
*/
|
||||
@Override
|
||||
public SampleId getLoadedSet() {
|
||||
return this.loadedSet;
|
||||
}
|
||||
|
@ -630,21 +635,10 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#getInventory()
|
||||
*/
|
||||
@Override
|
||||
public SampleId[] getInventory() {
|
||||
return this.inventory.toArray(new SampleId[this.inventory.size()]);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#getInventoryAsList()
|
||||
*/
|
||||
public ArrayList<SampleId> getInventoryAsList() {
|
||||
ArrayList<SampleId> ids = new ArrayList<SampleId>();
|
||||
for (SampleId id : this.inventory) {
|
||||
ids.add(id);
|
||||
}
|
||||
return ids;
|
||||
return this.inventory.values().toArray(
|
||||
new SampleId[this.inventory.size()]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -652,17 +646,18 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#getInventoryAsStrings()
|
||||
*/
|
||||
@Override
|
||||
public String[] getInventoryAsStrings() {
|
||||
String[] retVal = new String[this.inventory.size()];
|
||||
int i = 0;
|
||||
for (SampleId id : this.inventory) {
|
||||
retVal[i] = id.getName();
|
||||
i++;
|
||||
for (String name : this.inventory.keySet()) {
|
||||
retVal[i++] = name;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String activeMarkerSet(GridID gid) {
|
||||
// get office type from GridID
|
||||
String ot = gid.getParm().getOfficeType();
|
||||
|
@ -678,6 +673,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#getLocations()
|
||||
*/
|
||||
@Override
|
||||
public List<Coordinate> getLocations() {
|
||||
return new ArrayList<Coordinate>(this.locations);
|
||||
}
|
||||
|
@ -687,6 +683,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#getMarkerLocations()
|
||||
*/
|
||||
@Override
|
||||
public Map<String, List<Coordinate>> getMarkerLocations() {
|
||||
return this.markerLocations;
|
||||
}
|
||||
|
@ -696,6 +693,7 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#isShowLatLon()
|
||||
*/
|
||||
@Override
|
||||
public boolean isShowLatLon() {
|
||||
return showLatLon;
|
||||
}
|
||||
|
@ -705,12 +703,22 @@ public class SampleSetManager implements ISampleSetManager {
|
|||
*
|
||||
* @see com.raytheon.viz.gfe.core.ISampleSetManager#setShowLatLon(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setShowLatLon(boolean showLatLon) {
|
||||
this.showLatLon = showLatLon;
|
||||
fireSampleSetChangedListeners();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load sample set (for Python use)
|
||||
*
|
||||
* @param sampleId
|
||||
* id of sample set to load
|
||||
* @param loadMode
|
||||
* load mode
|
||||
* @throws GFEException
|
||||
*/
|
||||
public void loadSampleSet(final SampleId sampleId, String loadMode)
|
||||
throws GFEException {
|
||||
loadSampleSet(sampleId, SampleSetLoadMode.valueOf(loadMode));
|
||||
|
|
|
@ -22,15 +22,15 @@ package com.raytheon.viz.gfe.core.internal;
|
|||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange;
|
||||
import com.raytheon.uf.common.dataplugin.gfe.time.SelectTimeRange.Mode;
|
||||
|
@ -62,6 +62,7 @@ import com.raytheon.viz.gfe.core.msgs.SelectTimeRangesChangedMsg;
|
|||
* Dec 3, 2009 #3135 randerso Initial creation
|
||||
* Aug 1, 2012 #965 dgilling Change location of SelectTimeRange.
|
||||
* Aug 6, 2013 #1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
|
||||
* Sep 8, 2104 #3592 randerso Changed to use new pm listStaticFiles()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -78,23 +79,17 @@ public class SelectTimeRangeManager implements ISelectTimeRangeManager,
|
|||
|
||||
private static final String FILE_EXT = ".SELECTTR";
|
||||
|
||||
private static final IPathManager pathManager = PathManagerFactory
|
||||
.getPathManager();
|
||||
|
||||
private static final TimeZone ZULU = TimeZone.getTimeZone("GMT");
|
||||
|
||||
protected DataManager dataManager;
|
||||
private IPathManager pathManager;
|
||||
|
||||
private TimeZone timeZone;
|
||||
|
||||
private String[] inventory;
|
||||
|
||||
private Map<String, SelectTimeRange> rangeMap;
|
||||
|
||||
private LocalizationFile selectTRDir;
|
||||
|
||||
public SelectTimeRangeManager(DataManager dataManager) {
|
||||
this.dataManager = dataManager;
|
||||
// Find the referenced time zone
|
||||
timeZone = TimeZone.getTimeZone("GMT");
|
||||
try {
|
||||
|
@ -105,13 +100,13 @@ public class SelectTimeRangeManager implements ISelectTimeRangeManager,
|
|||
"Unable to retrieve GFE time zone, using GMT", e);
|
||||
}
|
||||
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
selectTRDir = pathMgr.getLocalizationFile(pathMgr.getContext(
|
||||
this.pathManager = PathManagerFactory.getPathManager();
|
||||
selectTRDir = pathManager.getLocalizationFile(pathManager.getContext(
|
||||
LocalizationType.COMMON_STATIC, LocalizationLevel.BASE),
|
||||
FILE_PATH);
|
||||
selectTRDir.addFileUpdatedObserver(this);
|
||||
|
||||
fileUpdated(null);
|
||||
loadInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -123,15 +118,17 @@ public class SelectTimeRangeManager implements ISelectTimeRangeManager,
|
|||
|
||||
@Override
|
||||
public String[] inventory() {
|
||||
String[] inventory = this.rangeMap.keySet().toArray(
|
||||
new String[this.rangeMap.size()]);
|
||||
return inventory;
|
||||
}
|
||||
|
||||
private SelectTimeRange loadTimeRange(LocalizationFile lf) {
|
||||
File file = lf.getFile();
|
||||
String rangeName = rangeNameFromFileName(lf.getName());
|
||||
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
in = new BufferedReader(new FileReader(file));
|
||||
in = new BufferedReader(new InputStreamReader(lf.openInputStream()));
|
||||
String[] s = in.readLine().split("\\s+");
|
||||
int start = Integer.parseInt(s[0]);
|
||||
int end = Integer.parseInt(s[1]);
|
||||
|
@ -140,21 +137,22 @@ public class SelectTimeRangeManager implements ISelectTimeRangeManager,
|
|||
mode = Mode.values()[Integer.parseInt(s[2])];
|
||||
}
|
||||
|
||||
SelectTimeRange range = new SelectTimeRange(FileUtil.unmangle(file
|
||||
.getName().replace(FILE_EXT, "")), start, end, mode, lf
|
||||
.getContext().getLocalizationLevel(),
|
||||
SelectTimeRange range = new SelectTimeRange(rangeName, start, end,
|
||||
mode, lf.getContext().getLocalizationLevel(),
|
||||
(mode.equals(Mode.ZULU) ? ZULU : timeZone));
|
||||
return range;
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error reading SELECTTR file " + file.getAbsolutePath(), e);
|
||||
"Error reading SELECTTR file "
|
||||
+ lf.getFile().getAbsolutePath(), e);
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error closing file " + file.getAbsolutePath(), e);
|
||||
"Error closing file "
|
||||
+ lf.getFile().getAbsolutePath(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -173,22 +171,26 @@ public class SelectTimeRangeManager implements ISelectTimeRangeManager,
|
|||
LocalizationLevel.USER), FileUtil.join(FILE_PATH,
|
||||
FileUtil.mangle(name) + FILE_EXT));
|
||||
|
||||
File file = lf.getFile();
|
||||
BufferedWriter out = null;
|
||||
try {
|
||||
out = new BufferedWriter(new FileWriter(file));
|
||||
out = new BufferedWriter(new OutputStreamWriter(
|
||||
lf.openOutputStream()));
|
||||
out.write(String.format("%d %d %d", start, end, mode.ordinal()));
|
||||
out.close();
|
||||
out = null;
|
||||
lf.save();
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error writing SELECTTR file " + file.getAbsolutePath(), e);
|
||||
"Error writing SELECTTR file "
|
||||
+ lf.getFile().getAbsolutePath(), e);
|
||||
} finally {
|
||||
try {
|
||||
out.close();
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Error closing file "
|
||||
+ file.getAbsolutePath(), e);
|
||||
+ lf.getFile().getAbsolutePath(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -210,9 +212,52 @@ public class SelectTimeRangeManager implements ISelectTimeRangeManager,
|
|||
|
||||
@Override
|
||||
public void fileUpdated(FileUpdatedMessage message) {
|
||||
LocalizationFile[] files = pathManager.listFiles(pathManager
|
||||
.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
|
||||
FILE_PATH, new String[] { FILE_EXT }, false, true);
|
||||
SelectTimeRange range;
|
||||
|
||||
switch (message.getChangeType()) {
|
||||
case ADDED:
|
||||
case UPDATED:
|
||||
LocalizationFile lf = pathManager.getLocalizationFile(
|
||||
message.getContext(), message.getFileName());
|
||||
range = loadTimeRange(lf);
|
||||
if (range != null) {
|
||||
SelectTimeRange existing = this.rangeMap.get(range.getName());
|
||||
if ((existing == null)
|
||||
|| (existing.getLevel().compareTo(range.getLevel()) <= 0)) {
|
||||
this.rangeMap.put(range.getName(), range);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DELETED:
|
||||
LocalizationFile[] files = pathManager.listStaticFiles(
|
||||
LocalizationType.COMMON_STATIC, message.getFileName(),
|
||||
new String[] { FILE_EXT }, false, true);
|
||||
|
||||
if (files.length > 0) {
|
||||
range = loadTimeRange(files[0]); // should only be one
|
||||
if (range != null) {
|
||||
this.rangeMap.put(range.getName(), range);
|
||||
}
|
||||
} else {
|
||||
String rangeName = rangeNameFromFileName(message.getFileName());
|
||||
this.rangeMap.remove(rangeName);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
statusHandler.error("Unexpected FileChangeType received: "
|
||||
+ message.getChangeType().name());
|
||||
break;
|
||||
}
|
||||
|
||||
new SelectTimeRangesChangedMsg().send();
|
||||
}
|
||||
|
||||
private void loadInventory() {
|
||||
LocalizationFile[] files = pathManager.listStaticFiles(
|
||||
LocalizationType.COMMON_STATIC, FILE_PATH,
|
||||
new String[] { FILE_EXT }, false, true);
|
||||
|
||||
List<SelectTimeRange> ranges = new ArrayList<SelectTimeRange>(
|
||||
files.length);
|
||||
|
@ -224,19 +269,22 @@ public class SelectTimeRangeManager implements ISelectTimeRangeManager,
|
|||
}
|
||||
Collections.sort(ranges);
|
||||
|
||||
String[] inv = new String[ranges.size()];
|
||||
Map<String, SelectTimeRange> map = new HashMap<String, SelectTimeRange>();
|
||||
int i = 0;
|
||||
Map<String, SelectTimeRange> map = new TreeMap<String, SelectTimeRange>();
|
||||
for (SelectTimeRange range : ranges) {
|
||||
inv[i++] = range.getName();
|
||||
map.put(range.getName(), range);
|
||||
}
|
||||
|
||||
synchronized (this) {
|
||||
this.inventory = inv;
|
||||
this.rangeMap = map;
|
||||
}
|
||||
|
||||
new SelectTimeRangesChangedMsg().send();
|
||||
}
|
||||
|
||||
private String rangeNameFromFileName(String fileName) {
|
||||
File file = new File(fileName);
|
||||
String rangeName = FileUtil.unmangle(file.getName().replace(FILE_EXT,
|
||||
""));
|
||||
return rangeName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,161 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.gfe.dialogs;
|
||||
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.List;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||
import com.raytheon.viz.gfe.core.ISampleSetManager;
|
||||
import com.raytheon.viz.gfe.core.ISampleSetManager.SampleSetLoadMode;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
|
||||
/**
|
||||
* Dialog for selecting sample sets to load
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 15, 2014 #3592 randerso Re-implemented to match A1
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
* @version 1.0
|
||||
*/
|
||||
public class LoadSampleSetDialog extends CaveJFACEDialog {
|
||||
|
||||
private static final int ADD_ID = IDialogConstants.CLIENT_ID;
|
||||
|
||||
private static final int REMOVE_ID = IDialogConstants.CLIENT_ID + 1;
|
||||
|
||||
private static final int REPLACE_ID = IDialogConstants.CLIENT_ID + 2;
|
||||
|
||||
private ISampleSetManager sampleSetMgr;
|
||||
|
||||
private String[] sets;
|
||||
|
||||
private List sampleSetList;
|
||||
|
||||
public LoadSampleSetDialog(ISampleSetManager sampleSetMgr, Shell parent) {
|
||||
super(parent);
|
||||
|
||||
this.sampleSetMgr = sampleSetMgr;
|
||||
this.sets = this.sampleSetMgr.getInventoryAsStrings();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite comp = (Composite) super.createDialogArea(parent);
|
||||
|
||||
Label label = new Label(comp, SWT.NONE);
|
||||
GridData layoutData = new GridData(SWT.DEFAULT, SWT.DEFAULT, false,
|
||||
false);
|
||||
label.setLayoutData(layoutData);
|
||||
label.setText("Sample Set Name(s)");
|
||||
|
||||
sampleSetList = new List(comp, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL
|
||||
| SWT.MULTI);
|
||||
layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
sampleSetList.setLayoutData(layoutData);
|
||||
sampleSetList.setItems(sets);
|
||||
|
||||
return comp;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
|
||||
* .Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
shell.setText("Load Sample Set");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
super.createButton(parent, ADD_ID, "Add", false);
|
||||
super.createButton(parent, REMOVE_ID, "Remove", false);
|
||||
super.createButton(parent, REPLACE_ID, "Replace", false);
|
||||
super.createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
|
||||
*/
|
||||
@Override
|
||||
protected void buttonPressed(int buttonId) {
|
||||
SampleSetLoadMode mode;
|
||||
switch (buttonId) {
|
||||
case ADD_ID:
|
||||
mode = SampleSetLoadMode.ADD;
|
||||
break;
|
||||
case REPLACE_ID:
|
||||
mode = SampleSetLoadMode.REPLACE;
|
||||
break;
|
||||
case REMOVE_ID:
|
||||
mode = SampleSetLoadMode.REMOVE;
|
||||
break;
|
||||
|
||||
default:
|
||||
super.cancelPressed();
|
||||
return;
|
||||
}
|
||||
|
||||
action(mode);
|
||||
super.okPressed();
|
||||
}
|
||||
|
||||
private void action(SampleSetLoadMode mode) {
|
||||
for (int index : sampleSetList.getSelectionIndices()) {
|
||||
String name = sampleSetList.getItem(index);
|
||||
SampleId id = new SampleId(name);
|
||||
if (id.isValid()) {
|
||||
sampleSetMgr.loadSampleSet(id, mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* REPLACE with multiple entries needs to ADD after the first one to
|
||||
* have the effect of replacing the currently loaded Samples with
|
||||
* the set of selected samples. If actionType is REPLACE, set
|
||||
* actionType to ADD for second and subsequent entries.
|
||||
*/
|
||||
if (mode.equals(SampleSetLoadMode.REPLACE)) {
|
||||
mode = SampleSetLoadMode.ADD;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,227 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.gfe.dialogs;
|
||||
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.List;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
|
||||
/**
|
||||
* The sample set dialog.
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2008 Eric Babin Initial Creation
|
||||
* Oct 24, 2012 1287 rferrel Code clean up for non-blocking dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SampleSetDialog extends CaveJFACEDialog {
|
||||
|
||||
public final static int LOAD = 1;
|
||||
|
||||
public final static int SAVE = 2;
|
||||
|
||||
public final static int DELETE = 3;
|
||||
|
||||
public final static int OK = 97;
|
||||
|
||||
public final static int REMOVE = 98;
|
||||
|
||||
public final static int REPLACE = 99;
|
||||
|
||||
public final static int CANCEL = Window.CANCEL;
|
||||
|
||||
private Composite top;
|
||||
|
||||
private java.util.List<SampleId> samples;
|
||||
|
||||
private List sampleSetList;
|
||||
|
||||
private Text identifierField;
|
||||
|
||||
private String sampleName;
|
||||
|
||||
private int[] selectedSamples;
|
||||
|
||||
private int returnCode = CANCEL;
|
||||
|
||||
private int type;
|
||||
|
||||
public SampleSetDialog(Shell parent, java.util.List<SampleId> samples,
|
||||
int type) {
|
||||
super(parent);
|
||||
this.setShellStyle(SWT.DIALOG_TRIM | SWT.MODELESS);
|
||||
this.samples = samples;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
private void initializeComponents() {
|
||||
Label lab = new Label(top, SWT.NONE);
|
||||
lab.setText("Sample Set Name(s)");
|
||||
|
||||
if (type == SampleSetDialog.LOAD) {
|
||||
sampleSetList = new List(top, SWT.BORDER | SWT.V_SCROLL
|
||||
| SWT.H_SCROLL | SWT.MULTI);
|
||||
} else {
|
||||
sampleSetList = new List(top, SWT.BORDER | SWT.V_SCROLL
|
||||
| SWT.H_SCROLL | SWT.SINGLE);
|
||||
}
|
||||
|
||||
for (SampleId sample : samples) {
|
||||
sampleSetList.add(sample.getName());
|
||||
}
|
||||
|
||||
sampleSetList.addSelectionListener(new SelectionListener() {
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
}
|
||||
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
selectedSamples = sampleSetList.getSelectionIndices();
|
||||
if (identifierField != null
|
||||
&& sampleSetList.getSelectionIndex() != -1) {
|
||||
identifierField.setText(sampleSetList.getItem(sampleSetList
|
||||
.getSelectionIndex()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
sampleSetList.setLayoutData(data);
|
||||
if (type != SampleSetDialog.LOAD) {
|
||||
Label processOn = new Label(top, SWT.NONE);
|
||||
processOn.setText("Identifier");
|
||||
|
||||
if (type == SampleSetDialog.DELETE) {
|
||||
identifierField = new Text(top, SWT.BORDER | SWT.READ_ONLY);
|
||||
} else {
|
||||
identifierField = new Text(top, SWT.BORDER);
|
||||
}
|
||||
identifierField.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent arg0) {
|
||||
selectedSamples = sampleSetList.getSelectionIndices();
|
||||
sampleName = identifierField.getText();
|
||||
}
|
||||
});
|
||||
identifierField
|
||||
.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void buttonPressed(int buttonId) {
|
||||
returnCode = buttonId;
|
||||
|
||||
super.buttonPressed(Window.OK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
top = (Composite) super.createDialogArea(parent);
|
||||
|
||||
GridLayout layout = new GridLayout(1, true);
|
||||
top.setLayout(layout);
|
||||
|
||||
initializeComponents();
|
||||
|
||||
return top;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getReturnCode() {
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
|
||||
* .Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
|
||||
if (type == SampleSetDialog.LOAD) {
|
||||
shell.setText("Load Sample Set");
|
||||
} else if (type == SampleSetDialog.SAVE) {
|
||||
shell.setText("Save Sample Set");
|
||||
} else if (type == SampleSetDialog.DELETE) {
|
||||
shell.setText("Delete Sample Set");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
if (type == SampleSetDialog.LOAD) {
|
||||
super.createButton(parent, OK, "Add", false);
|
||||
super.createButton(parent, REMOVE, "Remove", false);
|
||||
super.createButton(parent, REPLACE, "Replace", true);
|
||||
super.createButton(parent, CANCEL, "Cancel", true);
|
||||
} else if (type == SampleSetDialog.SAVE) {
|
||||
super.createButton(parent, OK, "Save", false);
|
||||
super.createButton(parent, CANCEL, "Cancel", false);
|
||||
} else if (type == SampleSetDialog.DELETE) {
|
||||
super.createButton(parent, OK, "Delete", false);
|
||||
super.createButton(parent, CANCEL, "Cancel", false);
|
||||
}
|
||||
}
|
||||
|
||||
public int[] getSelectedSampleIdIndexes() {
|
||||
return selectedSamples;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getSampleName() {
|
||||
return sampleName;
|
||||
}
|
||||
|
||||
public void setSampleName(String sampleName) {
|
||||
this.sampleName = sampleName;
|
||||
}
|
||||
|
||||
public java.util.List<SampleId> getSamples() {
|
||||
return samples;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,238 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.gfe.dialogs;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Group;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.List;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.gfe.sample.SampleId;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.viz.gfe.core.ISampleSetManager;
|
||||
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
|
||||
|
||||
/**
|
||||
* Dialog for selecting sample sets to save or delete
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 07, 2008 Eric Babin Initial Creation
|
||||
* Oct 24, 2012 1287 rferrel Code clean up for non-blocking dialog.
|
||||
* Sep 15, 2014 3592 randerso Re-implemented to match A1
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author ebabin
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SaveDeleteSampleSetDialog extends CaveJFACEDialog {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(SaveDeleteSampleSetDialog.class);
|
||||
|
||||
private ISampleSetManager sampleSetMgr;
|
||||
|
||||
private String optionStr;
|
||||
|
||||
private SortedSet<String> sets;
|
||||
|
||||
private Set<String> protectedSets;
|
||||
|
||||
private List sampleSetList;
|
||||
|
||||
private Text identifierField;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param sampleSetMgr
|
||||
* SampleSetManager to use
|
||||
* @param parent
|
||||
* parent shell for dialog
|
||||
* @param optionStr
|
||||
* "Save" or "Delete"
|
||||
*/
|
||||
public SaveDeleteSampleSetDialog(ISampleSetManager sampleSetMgr,
|
||||
Shell parent, String optionStr) {
|
||||
super(parent);
|
||||
|
||||
this.sampleSetMgr = sampleSetMgr;
|
||||
this.optionStr = optionStr;
|
||||
this.sets = new TreeSet<String>();
|
||||
this.protectedSets = new HashSet<String>();
|
||||
|
||||
SampleId[] sampleIDs = this.sampleSetMgr.getInventory();
|
||||
|
||||
if (this.optionStr.equals("Save")) {
|
||||
for (SampleId id : sampleIDs) {
|
||||
if (!id.isProtected()) {
|
||||
this.sets.add(id.getName());
|
||||
} else {
|
||||
this.protectedSets.add(id.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
// delete mode
|
||||
else {
|
||||
for (SampleId id : sampleIDs) {
|
||||
if (!id.isProtected()
|
||||
&& id.getAccess().equals(LocalizationLevel.USER)) {
|
||||
this.sets.add(id.getName());
|
||||
} else {
|
||||
this.protectedSets.add(id.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite comp = (Composite) super.createDialogArea(parent);
|
||||
|
||||
Group group = new Group(comp, SWT.NONE);
|
||||
group.setLayout(new GridLayout());
|
||||
GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
group.setLayoutData(layoutData);
|
||||
group.setLayout(new GridLayout(1, false));
|
||||
group.setText("Sample Set Name");
|
||||
|
||||
sampleSetList = new List(group, SWT.BORDER | SWT.V_SCROLL
|
||||
| SWT.H_SCROLL | SWT.SINGLE);
|
||||
layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
sampleSetList.setLayoutData(layoutData);
|
||||
if (!sets.isEmpty()) {
|
||||
sampleSetList.setItems(sets.toArray(new String[sets.size()]));
|
||||
sampleSetList.select(0);
|
||||
sampleSetList.deselectAll();
|
||||
}
|
||||
|
||||
sampleSetList.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
identifierField.setText(sampleSetList.getItem(sampleSetList
|
||||
.getSelectionIndex()));
|
||||
}
|
||||
});
|
||||
|
||||
Label label = new Label(group, SWT.NONE);
|
||||
layoutData = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
label.setLayoutData(layoutData);
|
||||
label.setText("Identifier");
|
||||
|
||||
if (this.optionStr.equals("Save")) {
|
||||
identifierField = new Text(group, SWT.BORDER);
|
||||
} else {
|
||||
identifierField = new Text(group, SWT.BORDER | SWT.READ_ONLY);
|
||||
}
|
||||
layoutData = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
identifierField.setLayoutData(layoutData);
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
|
||||
* .Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
|
||||
if (this.optionStr.equals("Save")) {
|
||||
shell.setText("Save Sample Set");
|
||||
} else {
|
||||
shell.setText("Delete Sample Set");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
super.createButton(parent, IDialogConstants.OK_ID, this.optionStr,
|
||||
false);
|
||||
super.createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
|
||||
*/
|
||||
@Override
|
||||
protected void okPressed() {
|
||||
String name = this.identifierField.getText();
|
||||
if (this.optionStr.equals("Save")) {
|
||||
saveSample(name);
|
||||
} else {
|
||||
deleteSample(name);
|
||||
}
|
||||
|
||||
super.okPressed();
|
||||
}
|
||||
|
||||
private void saveSample(String name) {
|
||||
SampleId id = new SampleId(name);
|
||||
if (id.isValid() && !this.protectedSets.contains(name)) {
|
||||
// LogStream.logUse("Save", name);
|
||||
this.sampleSetMgr.saveActiveSampleSet(id);
|
||||
} else {
|
||||
String message = "Sample Set " + name + " is protected "
|
||||
+ "or an invalid name. ";
|
||||
statusHandler.handle(Priority.SIGNIFICANT, message);
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteSample(String name) {
|
||||
SampleId id = new SampleId(name);
|
||||
if (id.isValid() && !this.protectedSets.contains(name)
|
||||
&& this.sets.contains(name)) {
|
||||
// LogStream.logUse("Delete", name);
|
||||
this.sampleSetMgr.deleteSampleSet(id);
|
||||
} else {
|
||||
String message = "Sample Set " + name + " is protected "
|
||||
+ "or an invalid name. ";
|
||||
statusHandler.handle(Priority.SIGNIFICANT, message);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -73,6 +73,8 @@ import com.raytheon.viz.gfe.textformatter.CombinationsFileUtil.ComboData.Entry;
|
|||
* Feb 05, 2014 #2591 randerso Forced retrieval of combinations file
|
||||
* Implemented retry on error
|
||||
* Aug 27, 2014 #3561 randerso Yet another attempt to fix combinations file updating
|
||||
* Sep 08, 2104 #3592 randerso Changed to use only list site level files as all
|
||||
* combo files are saved to the site level
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -139,8 +141,8 @@ public class CombinationsFileUtil {
|
|||
|
||||
public static LocalizationFile[] getSavedCombos() {
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationFile[] combos = pm.listFiles(
|
||||
pm.getLocalSearchHierarchy(LocalizationType.CAVE_STATIC),
|
||||
LocalizationFile[] combos = pm.listFiles(pm.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.SITE),
|
||||
SAVED_COMBO_DIR, new String[] { ".xml" }, false, true);
|
||||
|
||||
return combos;
|
||||
|
@ -223,8 +225,9 @@ public class CombinationsFileUtil {
|
|||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
|
||||
// retrieve combinations file if it's changed
|
||||
LocalizationFile lf = pm.getStaticLocalizationFile(FileUtil.join(
|
||||
COMBO_DIR_PATH, comboName + ".py"));
|
||||
LocalizationFile lf = pm.getStaticLocalizationFile(
|
||||
LocalizationType.CAVE_STATIC,
|
||||
FileUtil.join(COMBO_DIR_PATH, comboName + ".py"));
|
||||
File pyFile = null;
|
||||
if (lf != null) {
|
||||
try {
|
||||
|
|
|
@ -20,6 +20,10 @@
|
|||
package com.raytheon.viz.gfe.ui;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
|
@ -40,7 +44,9 @@ import com.raytheon.uf.common.localization.PathManagerFactory;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 10, 2010 #4727 randerso Initial creation
|
||||
* Jun 10, 2010 #4727 randerso Initial creation
|
||||
* Sep 15, 2014 #3592 randerso Fix logic to not include USER level.
|
||||
* Code cleanup.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -66,33 +72,24 @@ public class AccessMgr {
|
|||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
Map<LocalizationLevel, LocalizationFile> tieredData = pm
|
||||
.getTieredLocalizationFile(type, itemName);
|
||||
tieredData.remove(LocalizationLevel.USER);
|
||||
|
||||
StringBuilder kind = new StringBuilder();
|
||||
|
||||
int i = 1;
|
||||
for (LocalizationLevel level : tieredData.keySet()) {
|
||||
if (i == 1) {
|
||||
kind.append(level.toString());
|
||||
} else if (i == tieredData.size()) {
|
||||
kind.append(" and ").append(level.toString());
|
||||
} else {
|
||||
kind.append(", ").append(level.toString());
|
||||
}
|
||||
i++;
|
||||
}
|
||||
List<LocalizationLevel> availableLevels = new ArrayList<LocalizationLevel>(
|
||||
Arrays.asList(pm.getAvailableLevels()));
|
||||
availableLevels.remove(LocalizationLevel.USER);
|
||||
|
||||
boolean continueFlag = false;
|
||||
boolean answer = false;
|
||||
String message;
|
||||
|
||||
if (kind.length() == 0) {
|
||||
message = "There is no version of " + altName
|
||||
+ " at the BASE, CONFIGURED, or SITE levels.";
|
||||
if (tieredData.isEmpty()) {
|
||||
message = "There is no version of " + altName + " at the "
|
||||
+ levelString(availableLevels) + " levels.";
|
||||
} else {
|
||||
message = "Note that " + altName
|
||||
+ " will continue to appear in your "
|
||||
+ "GFESuite since a version of it exists " + "at the "
|
||||
+ kind + " level.";
|
||||
+ levelString(tieredData.keySet()) + " level.";
|
||||
continueFlag = true;
|
||||
}
|
||||
message = altName + " will be deleted. \n\n" + message;
|
||||
|
@ -104,4 +101,25 @@ public class AccessMgr {
|
|||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
private static String levelString(Collection<LocalizationLevel> levels) {
|
||||
StringBuilder kind = new StringBuilder();
|
||||
|
||||
int i = 1;
|
||||
for (LocalizationLevel level : levels) {
|
||||
if (level.equals(LocalizationLevel.USER)) {
|
||||
continue;
|
||||
}
|
||||
if (i == 1) {
|
||||
kind.append(level.toString());
|
||||
} else if (i == levels.size()) {
|
||||
kind.append(" and ").append(level.toString());
|
||||
} else {
|
||||
kind.append(", ").append(level.toString());
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return kind.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -496,8 +496,9 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
|
|||
case IMAGE:
|
||||
ColorMapCapability colorMapCap = getCapability(ColorMapCapability.class);
|
||||
ImagingCapability imagingCap = getCapability(ImagingCapability.class);
|
||||
ColorMapParameters params = null;
|
||||
if (renderableMap.isEmpty()) {
|
||||
ColorMapParameters params = createColorMapParameters(data);
|
||||
params = createColorMapParameters(data);
|
||||
if (params.getColorMap() == null) {
|
||||
if (params.getColorMapName() == null) {
|
||||
params.setColorMapName("Grid/gridded data");
|
||||
|
@ -506,6 +507,11 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
|
|||
.getColorMapName()));
|
||||
}
|
||||
colorMapCap.setColorMapParameters(params);
|
||||
} else {
|
||||
params = colorMapCap.getColorMapParameters();
|
||||
}
|
||||
if (params.getDataMapping() != null) {
|
||||
data.convert(params.getColorMapUnit());
|
||||
}
|
||||
TileImageCreator creator = new DataSourceTileImageCreator(
|
||||
data.getScalarData(), data.getDataUnit(),
|
||||
|
|
|
@ -455,12 +455,9 @@ public class OtherPrecipOptions {
|
|||
// // do nothing
|
||||
// }
|
||||
|
||||
if (clientdata == 1) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
|
||||
/* Rendering the grids and MAPs. */
|
||||
else if (clientdata == 0) {
|
||||
if (clientdata == 0) {
|
||||
|
||||
BadValues bv = new BadValues();
|
||||
bv.update_bad_values(DailyQcUtils.pcpn_day);
|
||||
|
@ -472,16 +469,18 @@ public class OtherPrecipOptions {
|
|||
if (DailyQcUtils.pcpn_day == 0
|
||||
&& (DailyQcUtils.curHr00_06 == 1
|
||||
|| DailyQcUtils.curHr06_12 == 1 || DailyQcUtils.curHr18_00 == 1)) {
|
||||
System.out.println("Not estimating partial point or daily stations.");
|
||||
// don't estimate
|
||||
} else {
|
||||
|
||||
EstDailyStations ed = new EstDailyStations();
|
||||
ed.estimate_daily_stations(DailyQcUtils.pcpn_day,
|
||||
DailyQcUtils.precip_stations, num_stations);
|
||||
|
||||
System.out.println("Estimating daily stations.");
|
||||
EstPartStations ep = new EstPartStations();
|
||||
ep.estimate_partial_stations(DailyQcUtils.pcpn_day,
|
||||
DailyQcUtils.precip_stations, num_stations);
|
||||
System.out.println("Estimating partial stations.");
|
||||
}
|
||||
|
||||
QCStations qs = new QCStations();
|
||||
|
|
|
@ -64,6 +64,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
|||
* Sep 23, 2008 randerso Initial creation
|
||||
* Apr 30, 2013 lbousaidi made seconds in the date/Time
|
||||
* fields visible.
|
||||
* Aug 26, 2014 14578 snaples Added Ending Hydrologic Date selection.
|
||||
* </pre>
|
||||
*
|
||||
* @author randerso
|
||||
|
@ -79,8 +80,12 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
}
|
||||
|
||||
private Calendar cal;
|
||||
|
||||
private Calendar hydroCal;
|
||||
|
||||
public static Date prevDate;
|
||||
|
||||
public static Date prevHydDate;
|
||||
|
||||
public static String prevArea;
|
||||
|
||||
|
@ -93,6 +98,12 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
private Spinner hourSpinner;
|
||||
|
||||
private Spinner daysSpinner;
|
||||
|
||||
private Text hydyearText;
|
||||
|
||||
private Text hydmonthText;
|
||||
|
||||
private Spinner hyddaySpinner;
|
||||
|
||||
private Map<Date, MPEDateInfo> dateMap;
|
||||
|
||||
|
@ -118,6 +129,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
|
||||
private Combo areaCombo;
|
||||
|
||||
private static Date currentHydroEndingDate;
|
||||
|
||||
public ChooseDataPeriodDialog(Shell parentShell) {
|
||||
super(parentShell);
|
||||
setBlockOnOpen(false);
|
||||
|
@ -144,8 +157,13 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
dateMap = dataMgr.getDateMap(false);
|
||||
qcEnable = MPEDisplayManager.isMpeQcOptionEnabled();
|
||||
cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
hydroCal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
|
||||
prevDate = displayMgr.getCurrentEditDate();
|
||||
cal.setTime(prevDate);
|
||||
if(prevHydDate == null){
|
||||
prevHydDate = prevDate;
|
||||
}
|
||||
hydroCal.setTime(prevHydDate);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -313,8 +331,59 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
gageOptionsGroup.setLayout(layout);
|
||||
gageOptionsGroup.setText("6/24 hr gage edit options");
|
||||
|
||||
new Label(gageOptionsGroup, SWT.NONE);
|
||||
// create ending hydro date area
|
||||
|
||||
Label hydrodateLabel = new Label(gageOptionsGroup, SWT.NONE);
|
||||
hydrodateLabel.setText("Ending Hydrologic Date: ");
|
||||
new Label(gageOptionsGroup, SWT.None);
|
||||
|
||||
Composite hydrodateComp = new Composite(gageOptionsGroup, SWT.NONE);
|
||||
GridData hydrodata = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
hydrodateComp.setLayoutData(hydrodata);
|
||||
GridLayout hydlayout = new GridLayout(3, false);
|
||||
hydrodateComp.setLayout(hydlayout);
|
||||
|
||||
Label hydyearLabel = new Label(hydrodateComp, SWT.NONE);
|
||||
hydyearLabel.setText("Ending Year");
|
||||
|
||||
Label hydmonthLabel = new Label(hydrodateComp, SWT.NONE);
|
||||
hydmonthLabel.setText("Month");
|
||||
|
||||
Label hyddayLabel = new Label(hydrodateComp, SWT.NONE);
|
||||
hyddayLabel.setText("Day");
|
||||
|
||||
hydyearText = new Text(hydrodateComp, SWT.BORDER | SWT.READ_ONLY);
|
||||
hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
hydrodata.widthHint = 100;
|
||||
hydyearText.setLayoutData(hydrodata);
|
||||
|
||||
hydmonthText = new Text(hydrodateComp, SWT.BORDER | SWT.READ_ONLY);
|
||||
hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
hydrodata.widthHint = 50;
|
||||
hydmonthText.setLayoutData(hydrodata);
|
||||
|
||||
hyddaySpinner = new Spinner(hydrodateComp, SWT.BORDER | SWT.READ_ONLY);
|
||||
hydrodata = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
hydrodata.widthHint = 50;
|
||||
hyddaySpinner.setLayoutData(data);
|
||||
hyddaySpinner.setMinimum(0);
|
||||
hyddaySpinner.setMaximum(32);
|
||||
hyddaySpinner.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
int day = hyddaySpinner.getSelection();
|
||||
|
||||
hydroCal.set(Calendar.DAY_OF_MONTH, day);
|
||||
|
||||
updateTimeControls();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
new Label(gageOptionsGroup, SWT.None);
|
||||
new Label(gageOptionsGroup, SWT.None);
|
||||
Label selectAreaLabel = new Label(gageOptionsGroup, SWT.NONE);
|
||||
selectAreaLabel.setText("Select Area");
|
||||
data = new GridData(SWT.CENTER, SWT.DEFAULT, false, false);
|
||||
|
@ -373,6 +442,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
public void widgetSelected(SelectionEvent e) {
|
||||
displayMgr.setDqcDays(daysSpinner.getSelection());
|
||||
prevArea = areaCombo.getItem(areaCombo.getSelectionIndex());
|
||||
setCurrentHydroEditDate(getHydroTime());
|
||||
|
||||
if (QcPrecipOptionsDialog.isFinished() == false) {
|
||||
QcPrecipOptionsDialog.destroy(false);
|
||||
}
|
||||
|
@ -400,6 +471,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
public void widgetSelected(SelectionEvent e) {
|
||||
displayMgr.setDqcDays(daysSpinner.getSelection());
|
||||
prevArea = areaCombo.getItem(areaCombo.getSelectionIndex());
|
||||
setCurrentHydroEditDate(getHydroTime());
|
||||
|
||||
if (QcTempOptionsDialog.isFinished() == false) {
|
||||
QcTempOptionsDialog.destroy(false);
|
||||
}
|
||||
|
@ -427,6 +500,8 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
public void widgetSelected(SelectionEvent e) {
|
||||
displayMgr.setDqcDays(daysSpinner.getSelection());
|
||||
prevArea = areaCombo.getItem(areaCombo.getSelectionIndex());
|
||||
setCurrentHydroEditDate(getHydroTime());
|
||||
|
||||
if (QcFreezeOptionsDialog.isFinished() == false) {
|
||||
QcFreezeOptionsDialog.destroy(false);
|
||||
}
|
||||
|
@ -454,13 +529,19 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
if (cal.getTime().before(dataMgr.getEarliestDate())
|
||||
|| cal.getTime().after(dataMgr.getLatestDate())) {
|
||||
cal.setTime(prevDate);
|
||||
hydroCal.setTime(prevHydDate);
|
||||
}
|
||||
prevDate = cal.getTime();
|
||||
prevHydDate = hydroCal.getTime();
|
||||
|
||||
yearText.setText(Integer.toString(cal.get(Calendar.YEAR)));
|
||||
monthText.setText(Integer.toString(cal.get(Calendar.MONTH) + 1));
|
||||
daySpinner.setSelection(cal.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
|
||||
hydyearText.setText(Integer.toString(hydroCal.get(Calendar.YEAR)));
|
||||
hydmonthText.setText(Integer.toString(hydroCal.get(Calendar.MONTH) + 1));
|
||||
hyddaySpinner.setSelection(hydroCal.get(Calendar.DAY_OF_MONTH));
|
||||
|
||||
hourSpinner.setSelection(cal.get(Calendar.HOUR_OF_DAY));
|
||||
|
||||
if (dateMap.containsKey(cal.getTime()) == false) {
|
||||
|
@ -502,6 +583,19 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
|
|||
public Date getTime() {
|
||||
return cal.getTime();
|
||||
}
|
||||
|
||||
public Date getHydroTime(){
|
||||
return hydroCal.getTime();
|
||||
}
|
||||
|
||||
private void setCurrentHydroEditDate(Date hydroTime) {
|
||||
currentHydroEndingDate = hydroTime;
|
||||
}
|
||||
|
||||
public static Date getCurrentHydroEditDate(){
|
||||
return currentHydroEndingDate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the selected year;
|
||||
|
|
|
@ -67,6 +67,7 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul, 7 2009 snaples Initial creation
|
||||
* Sep 11, 2013 #2353 lvenable Fixed cursor memory leak.
|
||||
* Aug 26, 2014 14578 snaples Changed the way we get current data to use new ending hydologic date.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -195,8 +196,8 @@ public class QcFreezeOptionsDialog extends AbstractMPEDialog {
|
|||
Shell parent = this.getParent();
|
||||
Display display = parent.getDisplay();
|
||||
MPEDisplayManager displayMgr = MPEDisplayManager.getCurrent();
|
||||
Date prevDate = displayMgr.getCurrentEditDate();
|
||||
Date currDate = ChooseDataPeriodDialog.prevDate;
|
||||
Date prevDate = ChooseDataPeriodDialog.getCurrentHydroEditDate();
|
||||
Date currDate = ChooseDataPeriodDialog.prevHydDate;
|
||||
String QcArea = ChooseDataPeriodDialog.prevArea;
|
||||
AppsDefaults appDefaults = AppsDefaults.getInstance();
|
||||
DisplayFieldData df = displayMgr.getDisplayFieldType();
|
||||
|
|
|
@ -67,6 +67,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Ts;
|
|||
* Mar 7, 2013 15657 lbousaidi fixed DQC slider and added listener to the Keys
|
||||
* when pressed.
|
||||
* Sep 11, 2013 #2353 lvenable Fixed cursor memory leak.
|
||||
* Aug 26, 2014 14578 snaples Changed the way we get the date, to use new ending hydro date field.
|
||||
* </pre>
|
||||
*
|
||||
* @author snaples
|
||||
|
@ -207,8 +208,8 @@ public class QcPrecipOptionsDialog extends AbstractMPEDialog {
|
|||
Shell parent = this.getParent();
|
||||
Display display = parent.getDisplay();
|
||||
MPEDisplayManager displayMgr = MPEDisplayManager.getCurrent();
|
||||
Date prevDate = displayMgr.getCurrentEditDate();
|
||||
Date currDate = ChooseDataPeriodDialog.prevDate;
|
||||
Date prevDate = ChooseDataPeriodDialog.getCurrentHydroEditDate();
|
||||
Date currDate = ChooseDataPeriodDialog.prevHydDate;
|
||||
String QcArea = ChooseDataPeriodDialog.prevArea;
|
||||
AppsDefaults appDefaults = AppsDefaults.getInstance();
|
||||
DisplayFieldData df = displayMgr.getDisplayFieldType();
|
||||
|
|
|
@ -64,6 +64,7 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Ts;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 12, 2008 snaples Initial creation
|
||||
* Sep 11, 2013 #2353 lvenable Fixed cursor memory leak.
|
||||
* Aug 26, 2014 14578 snaples Changed the way we get current data to use new ending hydologic date.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -196,8 +197,8 @@ public class QcTempOptionsDialog extends AbstractMPEDialog {
|
|||
Shell parent = this.getParent();
|
||||
Display display = parent.getDisplay();
|
||||
MPEDisplayManager displayMgr = MPEDisplayManager.getCurrent();
|
||||
Date prevDate = displayMgr.getCurrentEditDate();
|
||||
Date currDate = ChooseDataPeriodDialog.prevDate;
|
||||
Date prevDate = ChooseDataPeriodDialog.getCurrentHydroEditDate();
|
||||
Date currDate = ChooseDataPeriodDialog.prevHydDate;
|
||||
String QcArea = ChooseDataPeriodDialog.prevArea;
|
||||
AppsDefaults appDefaults = AppsDefaults.getInstance();
|
||||
DisplayFieldData df = displayMgr.getDisplayFieldType();
|
||||
|
|
|
@ -184,8 +184,8 @@ public class InitPrecipClimo {
|
|||
precip_stations.set(index, nstation);
|
||||
nstation = null;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
++index;
|
||||
}
|
||||
|
||||
in.close();
|
||||
|
|
|
@ -84,6 +84,7 @@ public class ReadPrecipA {
|
|||
try {
|
||||
|
||||
in = new BufferedReader(new FileReader(preca));
|
||||
System.out.println("Reading point file: " + preca);
|
||||
|
||||
for (j = 0; j < 5; j++) {
|
||||
number_found[j] = 0;
|
||||
|
|
|
@ -38,7 +38,8 @@ import com.raytheon.viz.mpe.util.DailyQcUtils.Station;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 5, 2009 snaples Initial creation
|
||||
*
|
||||
* Aug 20, 2014 17094 snaples Fixed issue when reading snow data file, did not parse properly.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author snaples
|
||||
|
@ -49,19 +50,19 @@ public class ReadSnowData {
|
|||
|
||||
int j, k, ier, m, qual;
|
||||
|
||||
char cbuf[] = new char[100];
|
||||
String cbuf = "";
|
||||
|
||||
char p, q;
|
||||
|
||||
char buf[] = new char[100];
|
||||
String buf = "";
|
||||
|
||||
String hb5 = "";
|
||||
|
||||
char pc;
|
||||
|
||||
char datbuf[] = new char[50];
|
||||
String datbuf = "";
|
||||
|
||||
char parmbuf[] = new char[50];
|
||||
String parmbuf = "";
|
||||
|
||||
int maxk, startk;
|
||||
|
||||
|
@ -73,6 +74,8 @@ public class ReadSnowData {
|
|||
|
||||
try {
|
||||
|
||||
in = new BufferedReader(new FileReader(prece));
|
||||
|
||||
for (k = 0; k < numPstations; k++) {
|
||||
for (int m = 0; m < 5; m++) {
|
||||
pdata[i].stn[k].srain[m].data = -99;
|
||||
|
@ -80,16 +83,15 @@ public class ReadSnowData {
|
|||
pdata[i].stn[k].sflag[m] = -1;
|
||||
}
|
||||
}
|
||||
in = new BufferedReader(new FileReader(prece));
|
||||
bad: while (in.ready()) {
|
||||
|
||||
int p = 1;
|
||||
String sn = cbuf.toString();
|
||||
Scanner s = new Scanner(sn);
|
||||
bad: while (p != -1) {
|
||||
cbuf = in.readLine().trim();
|
||||
if (cbuf.length() < 1) {
|
||||
break;
|
||||
}
|
||||
Scanner s = new Scanner(cbuf);
|
||||
|
||||
in.read(cbuf, 0, 100);
|
||||
|
||||
if (cbuf[0] == ':') {
|
||||
if (cbuf.charAt(0) == ':') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -97,19 +99,20 @@ public class ReadSnowData {
|
|||
if (s.hasNext() == false) {
|
||||
continue;
|
||||
}
|
||||
s.next();
|
||||
hb5 = s.next();
|
||||
datbuf = s.next().toCharArray();
|
||||
parmbuf = s.next().toCharArray();
|
||||
datbuf = s.next();
|
||||
parmbuf = s.next();
|
||||
|
||||
int q = parmbuf.toString().indexOf('/');
|
||||
char c = ' ';
|
||||
if (q >= 0) {
|
||||
c = parmbuf[q];
|
||||
c = parmbuf.charAt(q);
|
||||
}
|
||||
if (c < 0) {
|
||||
continue;
|
||||
}
|
||||
char pc = parmbuf[q + 5];
|
||||
char pc = parmbuf.charAt(q + 5);
|
||||
|
||||
for (j = 0; j < numPstations; j++) {
|
||||
if ((precip_stations.get(j).hb5.equals(hb5) && (pc == precip_stations
|
||||
|
@ -120,12 +123,12 @@ public class ReadSnowData {
|
|||
if (j == numPstations) {
|
||||
continue;
|
||||
}
|
||||
int u = cbuf.toString().indexOf('/');
|
||||
int u = cbuf.indexOf('/');
|
||||
if (u < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
q = cbuf.toString().indexOf(' ', u);
|
||||
q = cbuf.indexOf(' ', u);
|
||||
if (q < 0) {
|
||||
continue;
|
||||
}
|
||||
|
@ -135,19 +138,19 @@ public class ReadSnowData {
|
|||
|
||||
pdata[i].stn[j].srain[k].qual = 0;
|
||||
|
||||
if ((cbuf.toString().indexOf('/', q)) < 0
|
||||
&& (cbuf.toString().indexOf('\n', q)) < 0) {
|
||||
if ((cbuf.indexOf('/', q)) < 0
|
||||
&& (cbuf.indexOf('\n', q)) < 0) {
|
||||
continue bad;
|
||||
}
|
||||
|
||||
u = 0;
|
||||
|
||||
buf = cbuf.toString().substring(q).toCharArray();
|
||||
buf = cbuf.substring(q);
|
||||
|
||||
if ((buf.toString().indexOf('.')) < 0) {
|
||||
if ((buf.indexOf('.')) < 0) {
|
||||
|
||||
if ((buf.toString().indexOf('m')) < 0
|
||||
&& (buf.toString().indexOf('M')) < 0) {
|
||||
if ((buf.indexOf('m')) < 0
|
||||
&& (buf.indexOf('M')) < 0) {
|
||||
|
||||
pdata[i].stn[j].srain[k].data = -1;
|
||||
pdata[i].stn[j].srain[k].qual = -1;
|
||||
|
@ -166,9 +169,8 @@ public class ReadSnowData {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
s.close();
|
||||
}
|
||||
|
||||
in.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
|
|
|
@ -71,7 +71,9 @@ import com.raytheon.viz.awipstools.common.StormTrackData;
|
|||
* Feb 16, 2009 mnash Initial creation
|
||||
* 03/07/2012 DR 14660 D. Friedman Added time-based getSTIData* functions.
|
||||
* 03/01/2013 DR 15496 zwang Handle the expanded GSM
|
||||
* Correct some status according to B14 ICD
|
||||
* Correct some status according to B14 ICD
|
||||
* 08/20/2014 DR17214 zwang Report more status for VCP supplemental Info
|
||||
* according to RPG B16 ICD
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -178,7 +180,7 @@ public class RadarHelper {
|
|||
"RDA 1", "RDA 2" };
|
||||
|
||||
public static final String[] vcpInfoStr = { "AVSET",
|
||||
"SAILS", "Site-Specific VCP" };
|
||||
" SAILS", " Site-Specific VCP", " RxRN", " CBT" };
|
||||
|
||||
/**
|
||||
* The default maximimum difference in time used when retrieving STI data (15 minutes.)
|
||||
|
|
|
@ -38,7 +38,6 @@ import org.opengis.referencing.crs.ProjectedCRS;
|
|||
import com.raytheon.uf.common.dataplugin.HDF5Util;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarDataKey;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarDataPoint;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarDataPoint.RadarProductType;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
||||
import com.raytheon.uf.common.dataplugin.radar.level3.GraphicBlock;
|
||||
import com.raytheon.uf.common.dataplugin.radar.level3.Layer;
|
||||
|
@ -70,6 +69,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 13, 2009 chammack Initial creation
|
||||
* 03/04/2013 DCS51 zwang Handle GFM product
|
||||
* Sep 03, 2014 3574 njensen Properly dispose objects
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -79,11 +79,11 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
|
||||
public class RadarGraphicsDisplay implements IRenderable {
|
||||
|
||||
private Map<Integer, RadarGraphicsPage> pageMap;
|
||||
private final Map<Integer, RadarGraphicsPage> pageMap;
|
||||
|
||||
private ArrayList<RadarGraphicsPage> symbologyPages;
|
||||
private final ArrayList<RadarGraphicsPage> symbologyPages;
|
||||
|
||||
private Map<RadarDataKey, RadarDataPoint> symbologyData;
|
||||
private final Map<RadarDataKey, RadarDataPoint> symbologyData;
|
||||
|
||||
private int currentPage;
|
||||
|
||||
|
@ -108,9 +108,9 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
this.currentPage = 0;
|
||||
|
||||
// Only retrieve if this record has not been retrieved.
|
||||
if ((radarRecord.getSymbologyData() == null || radarRecord
|
||||
if (((radarRecord.getSymbologyData() == null) || radarRecord
|
||||
.getSymbologyData().isEmpty())
|
||||
&& radarRecord.getGraphicBlock() == null) {
|
||||
&& (radarRecord.getGraphicBlock() == null)) {
|
||||
File loc = HDF5Util.findHDF5Location(radarRecord);
|
||||
|
||||
IDataStore dataStore = DataStoreFactory.getDataStore(loc);
|
||||
|
@ -135,9 +135,10 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
new GeneralGridEnvelope(new int[] { 0, 0 }, new int[] { 4096,
|
||||
4096 }, false), generalEnvelope);
|
||||
IWireframeShape ws = target.createWireframeShape(true, mapDescriptor);
|
||||
|
||||
|
||||
// Used for GFM forecast positions
|
||||
IWireframeShape gfmWs = target.createWireframeShape(true, mapDescriptor);
|
||||
IWireframeShape gfmWs = target
|
||||
.createWireframeShape(true, mapDescriptor);
|
||||
|
||||
symbologyData = radarRecord.getSymbologyData();
|
||||
if (symbologyData != null) {
|
||||
|
@ -162,8 +163,8 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
// logic in createSymbologyImages()
|
||||
rgp.addImages(currStorm, CoordinateSystem.LOCAL);
|
||||
|
||||
//Handle DMD table data
|
||||
if (radarRecord.getProductCode() == 149) {
|
||||
// Handle DMD table data
|
||||
if (radarRecord.getProductCode() == 149) {
|
||||
// Handle the tabular display data in the Generic Packet
|
||||
String data = GraphicDataUtil.getDMDGraphicDataValue(
|
||||
tableModifier, radarRecord,
|
||||
|
@ -175,7 +176,7 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
addTableRow(tableData, featureData);
|
||||
processTableData = true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,7 +212,7 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
}
|
||||
// handle GFM product
|
||||
else {
|
||||
this.currentPage = pageNum;
|
||||
this.currentPage = pageNum;
|
||||
|
||||
RadarGraphicsPage gab = this.pageMap.get(pageNum);
|
||||
if (gab == null) {
|
||||
|
@ -223,7 +224,7 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
|
||||
this.currentPage = 0;
|
||||
}
|
||||
|
||||
|
||||
// Graphic block is organized into pages for display. The data for each
|
||||
// page is contained in packets.
|
||||
GraphicBlock gb = radarRecord.getGraphicBlock();
|
||||
|
@ -249,7 +250,8 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
}
|
||||
|
||||
}
|
||||
if ((symbologyData == null || symbologyData.isEmpty()) && gb == null) {
|
||||
if (((symbologyData == null) || symbologyData.isEmpty())
|
||||
&& (gb == null)) {
|
||||
String nullLegend = null;
|
||||
switch (radarRecord.getProductCode()) {
|
||||
case 139:
|
||||
|
@ -295,7 +297,7 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
|
||||
String[] values = sortValues.trim().split("\\s+");
|
||||
|
||||
if (values.length > 0 && values[0].length() > 1) {
|
||||
if ((values.length > 0) && (values[0].length() > 1)) {
|
||||
try {
|
||||
strengthRank = Integer.parseInt(values[0].substring(1,
|
||||
values[0].length()));
|
||||
|
@ -340,11 +342,15 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
}
|
||||
|
||||
public void setMagnification(double magnification) {
|
||||
for (RadarGraphicsPage page : symbologyPages) {
|
||||
page.setMagnification(magnification);
|
||||
synchronized (symbologyPages) {
|
||||
for (RadarGraphicsPage page : symbologyPages) {
|
||||
page.setMagnification(magnification);
|
||||
}
|
||||
}
|
||||
for (RadarGraphicsPage page : pageMap.values()) {
|
||||
page.setMagnification(magnification);
|
||||
synchronized (pageMap) {
|
||||
for (RadarGraphicsPage page : pageMap.values()) {
|
||||
page.setMagnification(magnification);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -358,32 +364,49 @@ public class RadarGraphicsDisplay implements IRenderable {
|
|||
@Override
|
||||
public void paint(IGraphicsTarget target, PaintProperties paintProps)
|
||||
throws VizException {
|
||||
if (currentPage < 0 || currentPage >= this.pageMap.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
RadarGraphicsPage page = pageMap.get(currentPage);
|
||||
if (page == null) {
|
||||
return;
|
||||
}
|
||||
page.paint(target, paintProps);
|
||||
|
||||
for (RadarGraphicsPage currPage : symbologyPages) {
|
||||
if (currPage == null) {
|
||||
synchronized (pageMap) {
|
||||
if ((currentPage < 0) || (currentPage >= this.pageMap.size())) {
|
||||
return;
|
||||
}
|
||||
|
||||
currPage.paint(target, paintProps);
|
||||
RadarGraphicsPage page = pageMap.get(currentPage);
|
||||
if (page == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
page.paint(target, paintProps);
|
||||
}
|
||||
|
||||
synchronized (symbologyPages) {
|
||||
for (RadarGraphicsPage currPage : symbologyPages) {
|
||||
if (currPage == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
currPage.paint(target, paintProps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getNumPages() {
|
||||
return this.pageMap.size() > 0 ? this.pageMap.size() : 1;
|
||||
synchronized (pageMap) {
|
||||
return this.pageMap.size() > 0 ? this.pageMap.size() : 1;
|
||||
}
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
for (RadarGraphicsPage page : pageMap.values()) {
|
||||
page.dispose();
|
||||
synchronized (pageMap) {
|
||||
for (RadarGraphicsPage page : pageMap.values()) {
|
||||
page.dispose();
|
||||
}
|
||||
pageMap.clear();
|
||||
}
|
||||
|
||||
synchronized (symbologyPages) {
|
||||
for (RadarGraphicsPage page : symbologyPages) {
|
||||
page.dispose();
|
||||
}
|
||||
symbologyPages.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
* Jun 04, 2014 3232 bsteffen Cleanup.
|
||||
* Aug 11, 2014 3504 mapeters Replaced deprecated IODataPreparer
|
||||
* instances with IRenderedImageCallback.
|
||||
* Sep 03, 2014 3574 njensen Properly dispose objects
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -1418,6 +1419,21 @@ public class RadarGraphicsPage implements IRenderable {
|
|||
this.wireframeShape = null;
|
||||
}
|
||||
|
||||
if (this.gfmFcstWireframeShape != null) {
|
||||
this.gfmFcstWireframeShape.dispose();
|
||||
this.gfmFcstWireframeShape = null;
|
||||
}
|
||||
|
||||
if (plotObjects != null) {
|
||||
for (PlotObject po : plotObjects) {
|
||||
if (po != null) {
|
||||
po.image.dispose();
|
||||
po.image = null;
|
||||
}
|
||||
}
|
||||
plotObjects.clear();
|
||||
}
|
||||
|
||||
if (this.font != null) {
|
||||
this.font.dispose();
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ import com.raytheon.uf.viz.core.rsc.IRefreshListener;
|
|||
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.viz.core.rsc.BestResResource;
|
||||
|
@ -85,6 +86,9 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* May 01, 2014 3100 bsteffen perform time matching on data update.
|
||||
* Jun 02, 2014 2918 bsteffen Make dataTimes a synchronized list.
|
||||
* Jun 12, 2014 3263 bsteffen Check for null when async time matching.
|
||||
* Sep 10, 2014 3604 bsteffen Ensure capability changes propogate to
|
||||
* all resources/listeners.
|
||||
*
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -233,12 +237,7 @@ public class RadarMosaicResource extends
|
|||
return maxSeverity;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @seecom.raytheon.viz.core.rsc.IVizResource#paint(com.raytheon.viz.core.
|
||||
* IGraphicsTarget, com.raytheon.viz.core.PixelExtent, double, float)
|
||||
*/
|
||||
@Override
|
||||
@Override
|
||||
protected void paintInternal(IGraphicsTarget target,
|
||||
PaintProperties paintProps) throws VizException {
|
||||
|
@ -638,6 +637,17 @@ public class RadarMosaicResource extends
|
|||
}
|
||||
dataTimes.remove(time);
|
||||
break;
|
||||
case CAPABILITY:
|
||||
AbstractCapability cap = (AbstractCapability) object;
|
||||
/*
|
||||
* Since mosaic shares capabilities, need to make sure resourceData
|
||||
* is always set to the mosaic resource data so that all resources
|
||||
* are notified.
|
||||
*/
|
||||
if (cap.getResourceData() != resourceData) {
|
||||
cap.setResourceData(resourceData);
|
||||
resourceData.fireChangeListeners(type, object);
|
||||
}
|
||||
}
|
||||
synchronized (this) {
|
||||
force = true;
|
||||
|
@ -645,6 +655,16 @@ public class RadarMosaicResource extends
|
|||
issueRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resourceDataChanged(ChangeType type, Object updateObject) {
|
||||
if (ChangeType.CAPABILITY == type) {
|
||||
for (ResourcePair rp : getResourceList()) {
|
||||
rp.getResourceData().fireChangeListeners(type, updateObject);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (groupName == null) {
|
||||
|
|
|
@ -57,6 +57,7 @@ import com.raytheon.viz.radar.rsc.RadarResourceData;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* May 13, 2010 mnash Initial creation
|
||||
* 03/01/2013 DR 15496 zwang Handled expanded GSM, display more status
|
||||
* 07/16/2014 DR 17214 zwang Handled B15 GSM change about super res flag
|
||||
* 07/24/2014 #3429 mapeters Updated deprecated drawLine() calls.
|
||||
* 07/29/2014 #3465 mapeters Updated deprecated drawString() calls.
|
||||
*
|
||||
|
@ -291,49 +292,75 @@ public class RadarGSMResource extends AbstractRadarResource<RadarXYDescriptor> {
|
|||
}
|
||||
|
||||
// Plot elevations
|
||||
double[] elevations = message.getElevation().clone();
|
||||
double[] elev = message.getElevation().clone();
|
||||
char[] charArray = Integer.toBinaryString(
|
||||
message.getSuperResolutionCuts()).toCharArray();
|
||||
|
||||
elevations = Arrays.copyOf(elevations, message.getNumCuts());
|
||||
Arrays.sort(elevations);
|
||||
// Find the index of the SAILS elevation
|
||||
int sailsIndex = -1;
|
||||
for (int i = 1; i < elev.length; i++) {
|
||||
if (elev[i] == elev[0]) {
|
||||
sailsIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Ignore the super res flag for SAILS
|
||||
if (sailsIndex != -1 && sailsIndex < charArray.length) {
|
||||
charArray[charArray.length - sailsIndex - 1] = '0';
|
||||
}
|
||||
|
||||
// Remove elevation 0 and duplicate elevations
|
||||
Arrays.sort(elev);
|
||||
int j = 0;
|
||||
int k = 1;
|
||||
while (k < elev.length){
|
||||
if (elev[j] == 0) {
|
||||
elev[j] = elev[k];
|
||||
k++;
|
||||
}
|
||||
else if (elev[k] == elev[j]) {
|
||||
k++;
|
||||
}
|
||||
else {
|
||||
j++;
|
||||
elev[j] = elev[k];
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
double[] elevations = Arrays.copyOf(elev, j+1);
|
||||
|
||||
for (int left = 0, right = elevations.length - 1; left < right; left++, right--) {
|
||||
double tmp = elevations[left];
|
||||
elevations[left] = elevations[right];
|
||||
elevations[right] = tmp;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < elevations.length; i++) {
|
||||
if (elevations[i] == 0) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the super res flag
|
||||
boolean[] superResElev = new boolean[elevations.length];
|
||||
// Initiate all flags to non super res
|
||||
for (int i = 0; i < elevations.length; i++) {
|
||||
superResElev[i] = false;
|
||||
}
|
||||
|
||||
// Ignore the flag for SAILS
|
||||
for (int i = 0; i < charArray.length; i++) {
|
||||
if (charArray[i] == '1') {
|
||||
superResElev[i] = true;
|
||||
} else {
|
||||
superResElev[i] = false;
|
||||
}
|
||||
if (charArray[charArray.length - i - 1] == '1') {
|
||||
superResElev[elevations.length - i - 1] = true;
|
||||
}
|
||||
}
|
||||
|
||||
List<String> theTemp = new ArrayList<String>();
|
||||
for (int i = 0; i < elevations.length; i++) {
|
||||
if (elevations[i] != 0) {
|
||||
String s = "";
|
||||
if (superResElev[elevations.length - i - count - 1] == true) {
|
||||
s = "S";
|
||||
} else {
|
||||
s = "";
|
||||
}
|
||||
theTemp.add(Double.toString(elevations[i] / 10) + " "
|
||||
+ s);
|
||||
|
||||
String s = "";
|
||||
if (superResElev[i] == true) {
|
||||
s = "S";
|
||||
} else {
|
||||
theTemp.add(Double.toString(elevations[i] / 10));
|
||||
break;
|
||||
s = "";
|
||||
}
|
||||
theTemp.add(Double.toString(elevations[i] / 10) + " " + s);
|
||||
}
|
||||
|
||||
int height = 780;
|
||||
|
|
|
@ -4401,7 +4401,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
|
|||
.getProductCategory(token)
|
||||
+ tdm.getProductDesignator(token);
|
||||
// Set the header text field.
|
||||
if (bbbid.equals("NOR") || tdm.getAfosPil(token) != null) {
|
||||
if (bbbid.equals("NOR") || (bbbid.isEmpty() && tdm.getAfosPil(token) != null)) {
|
||||
String wmoId = tdm.getWmoId(token);
|
||||
wmoId = (wmoId.length() > 0 ? wmoId : "-");
|
||||
String siteId = tdm.getSiteId(token);
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
**/
|
||||
package com.raytheon.viz.ui.personalities.awips;
|
||||
|
||||
import com.raytheon.uf.viz.core.procedures.ProcedureXmlManager;
|
||||
|
||||
/**
|
||||
* This is the default component for CAVE that is the standard workbench with
|
||||
* all the perspectives.
|
||||
|
@ -31,6 +33,7 @@ package com.raytheon.viz.ui.personalities.awips;
|
|||
* Aug 09, 2010 mschenke Initial creation
|
||||
* Jul 01, 2013 2139 jsanchez Loaded map tree at cave start up.
|
||||
* Oct 22, 2013 2361 njensen Undid 2139 fix since 2158 fixes it more efficiently
|
||||
* Aug 29, 2014 3500 bclement added postStartupActions()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,4 +59,9 @@ public class CAVE extends AbstractAWIPSComponent {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void postStartupActions() {
|
||||
ProcedureXmlManager.inititializeAsync();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,260 @@
|
|||
<bundle xmlns:ns2="group">
|
||||
<displayList>
|
||||
<displays xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="d2DMapRenderableDisplay" scale="CONUS" density="1.0" magnification="1.0" zoomLevel="1.0" mapCenter="-66.2005121984067 35.94909693622639 0.0">
|
||||
<descriptor xsi:type="mapDescriptor">
|
||||
<resource>
|
||||
<loadProperties xsi:type="gridLoadProperties" displayType="BARB" loadWithoutData="true">
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
</loadProperties>
|
||||
<properties renderingOrderId="CONTOUR" isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
|
||||
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
|
||||
</properties>
|
||||
<resourceData xsi:type="gridResourceData" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
|
||||
<metadataMap>
|
||||
<mapping key="info.parameter.abbreviation">
|
||||
<constraint constraintValue="Wind" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.datasetId">
|
||||
<constraint constraintValue="${modelName}" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.leveltwovalue">
|
||||
<constraint constraintValue="-999999" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="grid" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.masterLevel.name">
|
||||
<constraint constraintValue="FHAG" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.levelonevalue">
|
||||
<constraint constraintValue="10.0" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
</metadataMap>
|
||||
<alertParser xsi:type="dataCubeAlertMessageParser"/>
|
||||
</resourceData>
|
||||
</resource>
|
||||
<resource>
|
||||
<loadProperties xsi:type="gridLoadProperties" displayType="CONTOUR" loadWithoutData="true">
|
||||
<capabilities>
|
||||
|
||||
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
</loadProperties>
|
||||
<properties renderingOrderId="CONTOUR" isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
|
||||
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
|
||||
</properties>
|
||||
<resourceData xsi:type="gridResourceData" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
|
||||
<metadataMap>
|
||||
<mapping key="info.parameter.abbreviation">
|
||||
<constraint constraintValue="T" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.datasetId">
|
||||
<constraint constraintValue="${modelName}" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.leveltwovalue">
|
||||
<constraint constraintValue="-999999" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="grid" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.masterLevel.name">
|
||||
<constraint constraintValue="FHAG" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.levelonevalue">
|
||||
<constraint constraintValue="2.0" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
</metadataMap>
|
||||
<alertParser xsi:type="dataCubeAlertMessageParser"/>
|
||||
</resourceData>
|
||||
</resource>
|
||||
<resource>
|
||||
<loadProperties xsi:type="gridLoadProperties" displayType="CONTOUR" loadWithoutData="true">
|
||||
<capabilities>
|
||||
|
||||
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
</loadProperties>
|
||||
<properties renderingOrderId="CONTOUR" isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="false">
|
||||
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
|
||||
</properties>
|
||||
<resourceData xsi:type="gridResourceData" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
|
||||
<metadataMap>
|
||||
<mapping key="info.parameter.abbreviation">
|
||||
<constraint constraintValue="RH" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.datasetId">
|
||||
<constraint constraintValue="${modelName}" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.leveltwovalue">
|
||||
<constraint constraintValue="-999999" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="grid" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.masterLevel.name">
|
||||
<constraint constraintValue="FHAG" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.levelonevalue">
|
||||
<constraint constraintValue="2.0" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
</metadataMap>
|
||||
<alertParser xsi:type="dataCubeAlertMessageParser"/>
|
||||
</resourceData>
|
||||
</resource>
|
||||
<resource>
|
||||
<loadProperties xsi:type="gridLoadProperties" displayType="CONTOUR" loadWithoutData="true">
|
||||
<capabilities>
|
||||
|
||||
<capability xsi:type="outlineCapability" lineStyle="SOLID" outlineOn="true" outlineWidth="1"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
</loadProperties>
|
||||
<properties renderingOrderId="CONTOUR" isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="false">
|
||||
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
|
||||
</properties>
|
||||
<resourceData xsi:type="gridResourceData" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
|
||||
<metadataMap>
|
||||
<mapping key="info.parameter.abbreviation">
|
||||
<constraint constraintValue="DpT" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.datasetId">
|
||||
<constraint constraintValue="${modelName}" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.leveltwovalue">
|
||||
<constraint constraintValue="-999999" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="grid" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.masterLevel.name">
|
||||
<constraint constraintValue="FHAG" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.levelonevalue">
|
||||
<constraint constraintValue="2.0" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
</metadataMap>
|
||||
<alertParser xsi:type="dataCubeAlertMessageParser"/>
|
||||
</resourceData>
|
||||
</resource>
|
||||
<resource>
|
||||
<loadProperties xsi:type="gridLoadProperties" displayType="IMAGE" loadWithoutData="true">
|
||||
<capabilities>
|
||||
|
||||
<capability xsi:type="colorMapCapability">
|
||||
<colorMapParameters colorMapName="Grid/gridded data"/>
|
||||
</capability>
|
||||
<capability xsi:type="imagingCapability" alpha="1.0" interpolationState="false" brightness="0.5" contrast="1.0"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
</loadProperties>
|
||||
<properties renderingOrderId="IMAGE_COUNTRY" isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="false">
|
||||
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
|
||||
</properties>
|
||||
<resourceData xsi:type="gridResourceData" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
|
||||
<metadataMap>
|
||||
<mapping key="info.parameter.abbreviation">
|
||||
<constraint constraintValue="TP" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.datasetId">
|
||||
<constraint constraintValue="${modelName}" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.leveltwovalue">
|
||||
<constraint constraintValue="-999999" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="grid" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.masterLevel.name">
|
||||
<constraint constraintValue="SFC" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.levelonevalue">
|
||||
<constraint constraintValue="0.0" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
</metadataMap>
|
||||
<alertParser xsi:type="dataCubeAlertMessageParser"/>
|
||||
</resourceData>
|
||||
</resource>
|
||||
<resource>
|
||||
<loadProperties xsi:type="gridLoadProperties" displayType="IMAGE" loadWithoutData="true">
|
||||
<capabilities>
|
||||
|
||||
<capability xsi:type="colorMapCapability">
|
||||
<colorMapParameters colorMapName="Grid/gridded data"/>
|
||||
</capability>
|
||||
<capability xsi:type="imagingCapability" alpha="1.0" interpolationState="false" brightness="0.5" contrast="1.0"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
</loadProperties>
|
||||
<properties renderingOrderId="IMAGE_COUNTRY" isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="false">
|
||||
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
|
||||
</properties>
|
||||
<resourceData xsi:type="gridResourceData" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
|
||||
<metadataMap>
|
||||
<mapping key="info.parameter.abbreviation">
|
||||
<constraint constraintValue="MaxWHRRR" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.datasetId">
|
||||
<constraint constraintValue="${modelName}" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.leveltwovalue">
|
||||
<constraint constraintValue="-999999" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="grid" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.masterLevel.name">
|
||||
<constraint constraintValue="SFC" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.levelonevalue">
|
||||
<constraint constraintValue="0.0" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
</metadataMap>
|
||||
<alertParser xsi:type="dataCubeAlertMessageParser"/>
|
||||
</resourceData>
|
||||
</resource>
|
||||
<resource>
|
||||
<loadProperties xsi:type="gridLoadProperties" displayType="IMAGE" loadWithoutData="true">
|
||||
<capabilities>
|
||||
|
||||
<capability xsi:type="colorMapCapability">
|
||||
<colorMapParameters colorMapName="HRRR Reflectivity"/>
|
||||
</capability>
|
||||
<capability xsi:type="imagingCapability" alpha="1.0" interpolationState="false" brightness="1.0" contrast="1.0"/>
|
||||
</capabilities>
|
||||
<resourceType>PLAN_VIEW</resourceType>
|
||||
</loadProperties>
|
||||
<properties renderingOrderId="IMAGE_COUNTRY" isSystemResource="false" isBlinking="false" isMapLayer="false" isHoverOn="false" isVisible="true">
|
||||
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0"/>
|
||||
</properties>
|
||||
<resourceData xsi:type="gridResourceData" retrieveData="true" isUpdatingOnMetadataOnly="false" isRequeryNecessaryOnTimeMatch="true">
|
||||
<metadataMap>
|
||||
<mapping key="info.parameter.abbreviation">
|
||||
<constraint constraintValue="CXR" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.datasetId">
|
||||
<constraint constraintValue="${modelName}" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.leveltwovalue">
|
||||
<constraint constraintValue="-999999" constraintType="IN"/>
|
||||
</mapping>
|
||||
<mapping key="pluginName">
|
||||
<constraint constraintValue="grid" constraintType="EQUALS"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.masterLevel.name">
|
||||
<constraint constraintValue="EA" constraintType="IN"/>
|
||||
</mapping>
|
||||
<mapping key="info.level.levelonevalue">
|
||||
<constraint constraintValue="0.0" constraintType="IN"/>
|
||||
</mapping>
|
||||
</metadataMap>
|
||||
<alertParser xsi:type="dataCubeAlertMessageParser"/>
|
||||
</resourceData>
|
||||
</resource>
|
||||
<timeMatcher xsi:type="d2DTimeMatcher" deltaFilter="0" forecastFilter="0"/>
|
||||
<numberOfFrames>16</numberOfFrames>
|
||||
</descriptor>
|
||||
</displays>
|
||||
</displayList>
|
||||
</bundle>
|
|
@ -69,6 +69,12 @@
|
|||
<substitute key="modelName" value="${MMMmodel2}"/>
|
||||
<substitute key="frameCount" value="17"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/volume/DefaultFamily.xml"
|
||||
menuText="HRRR" id="hrrr" useReferenceTime="true">
|
||||
<substitute key="modelName" value="HRRR"/>
|
||||
<substitute key="TP" value="TP"/>
|
||||
<substitute key="frameCount" value="16"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/volume/DefaultFamily.xml"
|
||||
menuText="NAM12" id="nam12" useReferenceTime="true">
|
||||
<substitute key="modelName" value="${NAM12model}"/>
|
||||
|
|
|
@ -44,6 +44,12 @@
|
|||
<substitute key="modelName" value="${MMMmodel2}"/>
|
||||
<substitute key="TP" value="TP3hr"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/volume/HRRR.xml"
|
||||
menuText="HRRR" id="hrrrsurface" useReferenceTime="true">
|
||||
<substitute key="modelName" value="HRRR"/>
|
||||
<substitute key="TP" value="TP"/>
|
||||
<substitute key="frameCount" value="16"/>
|
||||
</contribute>
|
||||
<contribute xsi:type="bundleItem" file="bundles/volume/DefaultSurface.xml"
|
||||
menuText="NAM12" id="nam12surface" useReferenceTime="true">
|
||||
<substitute key="modelName" value="${NAM12model}"/>
|
||||
|
|
|
@ -19,6 +19,30 @@
|
|||
further_licensing_information.
|
||||
-->
|
||||
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<contribute xsi:type="menuItem" menuText="Pres Anl Uncertainty"
|
||||
key="Perranl" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Max Gust Speed" key="MaxWHRRR"
|
||||
indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Max Updraft VV"
|
||||
key="MAXUVV" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Max Downdraft VV"
|
||||
key="MAXDVV" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Max Updraft Helicity"
|
||||
key="MAXUPHL" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Most Unstable BL Parcel Level"
|
||||
key="PLPL" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Max Lightning Threat"
|
||||
key="LTNG" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Vsby Anl Uncertainty"
|
||||
key="Viserranl" indentText="false" />
|
||||
<contribute xsi:type="menuItem" menuText="CAPPI"
|
||||
key="REFD" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="MAX 1hr CAPPI"
|
||||
key="MXREF" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Derived VIL"
|
||||
key="VILIQ" indentText="true" />
|
||||
<contribute xsi:type="menuItem" menuText="Derived Echo Top"
|
||||
key="RETOP" indentText="true" />
|
||||
<!--
|
||||
Don't override this file, it exists only to support legacy overrides.
|
||||
Please override menus/volumebrowser/fields/planViewTimeSeries.xml instead.
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<!--
|
||||
Don't override this file, it exists only to support legacy overrides.
|
||||
Please override menus/volumebrowser/planes/planViewTime-timeSeries.xml instead.
|
||||
<contribute xsi:type="menuItem" textLookup="LevelMapping" key="400agl" indentText="false"/>
|
||||
-->
|
||||
<contribute xsi:type="subinclude" fileName="menus/volumebrowser/planes/planViewTime-timeSeries.xml" />
|
||||
</menuTemplate>
|
||||
|
|
|
@ -1351,19 +1351,19 @@
|
|||
<DatabaseLevel levelName="BSS" levelOneValue="0" />
|
||||
</Level>
|
||||
<Level displayName="80 m" key="80m" group="S">
|
||||
<DatabaseLevel levelName="FHAG" levelOneValue="80.0"
|
||||
unit="m" />
|
||||
</Level>
|
||||
<DatabaseLevel levelName="FHAG" levelOneValue="80.0"
|
||||
unit="m" />
|
||||
</Level>
|
||||
<Level displayName="SIG0.8-0.5" key="SIG0.8-0.5" group="S">
|
||||
<DatabaseLevel levelName="SIG" levelOneValue="0.5"
|
||||
levelTwoValue="0.8" unit="m/s" />
|
||||
levelTwoValue="0.8" unit="m/s" />
|
||||
</Level>
|
||||
<Level displayName="1000MB-400MB" key="1000MB-400MB" group="C">
|
||||
<DatabaseLevel levelName="MB" levelOneValue="1000"
|
||||
levelTwoValue="400" unit="hPa" />
|
||||
<Level displayName="400agl" key="400agl" group="C">
|
||||
<DatabaseLevel levelName="BL" levelOneValue="1000"
|
||||
levelTwoValue="400" unit="hPa" />
|
||||
</Level>
|
||||
<Level displayName="2-5km AGL" key="2-5kmAgl" group="C">
|
||||
<DatabaseLevel levelName="FHAG" levelOneValue="2000"
|
||||
levelTwoValue="5000.0" unit="m" />
|
||||
levelTwoValue="5000.0" unit="m" />
|
||||
</Level>
|
||||
</LevelMappings>
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
package com.raytheon.viz.warngen.gis;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.warning.util.WarnFileUtil;
|
||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.viz.warngen.gui.WarngenLayer;
|
||||
|
||||
/**
|
||||
* WarngenWordingConfiguration
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- -------------- --------------------------
|
||||
* 2014-08-28 ASM #15658 D. Friedman Initial Creation.
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement(name = "zoneWordingConfig")
|
||||
public class MarineWordingConfiguration {
|
||||
|
||||
private static final String FILE_NAME = "marineZoneWording.xml";
|
||||
|
||||
@XmlElement(name = "entry")
|
||||
private List<MarineWordingEntry> entries = new ArrayList<MarineWordingEntry>();
|
||||
|
||||
public List<MarineWordingEntry> getEntries() {
|
||||
return entries;
|
||||
}
|
||||
|
||||
public void setEntries(List<MarineWordingEntry> entries) {
|
||||
this.entries = entries;
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public static class MarineWordingEntry {
|
||||
@XmlAttribute(name = "match")
|
||||
private String matchText;
|
||||
@XmlAttribute(name = "replace")
|
||||
private String replacementText;
|
||||
|
||||
private Pattern ugcPattern;
|
||||
|
||||
public String getMatchText() {
|
||||
return matchText;
|
||||
}
|
||||
|
||||
public void setMatchText(String matchText) {
|
||||
this.matchText = matchText;
|
||||
this.ugcPattern = null;
|
||||
}
|
||||
|
||||
public String getReplacementText() {
|
||||
return replacementText;
|
||||
}
|
||||
|
||||
public void setReplacementText(String replacementText) {
|
||||
this.replacementText = replacementText;
|
||||
}
|
||||
|
||||
public Pattern getUgcPattern() {
|
||||
if (ugcPattern == null) {
|
||||
if (matchText != null) {
|
||||
ugcPattern = Pattern.compile(matchText);
|
||||
}
|
||||
}
|
||||
return ugcPattern;
|
||||
}
|
||||
}
|
||||
|
||||
private static final SingleTypeJAXBManager<MarineWordingConfiguration> jaxb = SingleTypeJAXBManager
|
||||
.createWithoutException(MarineWordingConfiguration.class);
|
||||
|
||||
|
||||
public static MarineWordingConfiguration load(WarngenLayer forLayer) throws Exception {
|
||||
String xmlText = WarnFileUtil.convertFileContentsToString(FILE_NAME,
|
||||
LocalizationManager.getInstance().getCurrentSite(),
|
||||
forLayer.getLocalizedSite());
|
||||
|
||||
MarineWordingConfiguration config = (MarineWordingConfiguration)
|
||||
jaxb.unmarshalFromXml(xmlText);
|
||||
for (MarineWordingEntry entry : config.getEntries()) {
|
||||
// Validate patterns by compiling now.
|
||||
entry.getUgcPattern();
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
|
@ -33,6 +33,7 @@ import java.util.List;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 16, 2014 3419 jsanchez Initial creation
|
||||
* Aug 28, 2014 ASM #15658 D. Friedman Add marine zone list.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -58,6 +59,8 @@ public class Watch {
|
|||
|
||||
private List<String> partOfState;
|
||||
|
||||
private List<String> marineAreas;
|
||||
|
||||
public Watch(String state, String action, String phenSig, String etn,
|
||||
Date startTime, Date endTime) {
|
||||
this.state = state;
|
||||
|
@ -132,6 +135,14 @@ public class Watch {
|
|||
this.etn = etn;
|
||||
}
|
||||
|
||||
public List<String> getMarineAreas() {
|
||||
return marineAreas;
|
||||
}
|
||||
|
||||
public void setMarineAreas(List<String> marineAreas) {
|
||||
this.marineAreas = marineAreas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
|
|
|
@ -54,8 +54,11 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.util.Pair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.requests.ThriftClient;
|
||||
import com.raytheon.viz.core.mode.CAVEMode;
|
||||
import com.raytheon.viz.warngen.gis.MarineWordingConfiguration.MarineWordingEntry;
|
||||
import com.raytheon.viz.warngen.gui.WarngenLayer;
|
||||
import com.raytheon.viz.warngen.gui.WarngenLayer.GeoFeatureType;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
@ -72,6 +75,9 @@ import com.vividsolutions.jts.geom.Polygon;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 17, 2014 3419 jsanchez Initial creation
|
||||
* Aug 20, 2014 ASM #16703 D. Friedman Ensure watches have a state attribute.
|
||||
* Aug 28, 2014 ASM #15658 D. Friedman Add marine zones.
|
||||
* Aug 29, 2014 ASM #15551 Qinglu Lin Sort watches by ETN and filter out ActiveTableRecord
|
||||
* with act of CAN and EXP in processRecords().
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -106,10 +112,16 @@ public class WatchUtil {
|
|||
|
||||
private static final String COUNTY_FE_AREA_FIELD = "FE_AREA";
|
||||
|
||||
private static final Object MARINE_ZONE_UGC_FIELD = "ID";
|
||||
|
||||
private static final Object MARINE_ZONE_NAME_FIELD = "NAME";
|
||||
|
||||
private static final String STATE_FIELD = "STATE";
|
||||
|
||||
private static final String COUNTY_TABLE = "County";
|
||||
|
||||
private static final String MARINE_ZONE_TABLE = "MarineZones";
|
||||
|
||||
private static final String PARENT_NAME_FIELD = "NAME";
|
||||
|
||||
private static final String[] REQUEST_FIELDS = new String[] {
|
||||
|
@ -118,8 +130,12 @@ public class WatchUtil {
|
|||
|
||||
private GeospatialData[] countyGeoData;
|
||||
|
||||
private GeospatialData[] marineGeoData;
|
||||
|
||||
private WarngenLayer warngenLayer;
|
||||
|
||||
private MarineWordingConfiguration marineWordingConfig;
|
||||
|
||||
public WatchUtil(WarngenLayer warngenLayer) throws InstantiationException {
|
||||
countyGeoData = warngenLayer.getGeodataFeatures(COUNTY_TABLE,
|
||||
warngenLayer.getLocalizedSite());
|
||||
|
@ -155,6 +171,17 @@ public class WatchUtil {
|
|||
Validate.isTrue(watchAreaBuffer >= 0,
|
||||
"'includedWatchAreaBuffer' can not be negative in .xml file");
|
||||
|
||||
if (config.isIncludeMarineAreasInWatches()) {
|
||||
marineGeoData = warngenLayer.getGeodataFeatures(MARINE_ZONE_TABLE,
|
||||
warngenLayer.getLocalizedSite());
|
||||
if (marineGeoData == null) {
|
||||
throw new VizException("Cannot get geospatial data for "
|
||||
+ MARINE_ZONE_TABLE + "-based watches");
|
||||
}
|
||||
|
||||
marineWordingConfig = MarineWordingConfiguration.load(warngenLayer);
|
||||
}
|
||||
|
||||
String[] includedWatches = config.getIncludedWatches();
|
||||
|
||||
if ((includedWatches != null) && (includedWatches.length > 0)) {
|
||||
|
@ -174,10 +201,16 @@ public class WatchUtil {
|
|||
entityClass = PracticeActiveTableRecord.class;
|
||||
}
|
||||
|
||||
HashSet<String> allUgcs = new HashSet<String>(
|
||||
warngenLayer.getAllUgcs(GeoFeatureType.COUNTY));
|
||||
Set<String> marineUgcs = null;
|
||||
if (config.isIncludeMarineAreasInWatches()) {
|
||||
marineUgcs = warngenLayer.getAllUgcs(GeoFeatureType.MARINE);
|
||||
allUgcs.addAll(marineUgcs);
|
||||
}
|
||||
|
||||
DbQueryRequest request = buildRequest(simulatedTime,
|
||||
phenSigConstraint.toString(),
|
||||
warngenLayer.getAllUgcs(GeoFeatureType.COUNTY),
|
||||
entityClass);
|
||||
phenSigConstraint.toString(), allUgcs, entityClass);
|
||||
DbQueryResponse response = (DbQueryResponse) ThriftClient
|
||||
.sendRequest(request);
|
||||
|
||||
|
@ -192,9 +225,14 @@ public class WatchUtil {
|
|||
/ KmToDegrees);
|
||||
System.out.println("create watch area buffer time: "
|
||||
+ (System.currentTimeMillis() - t0));
|
||||
Set<String> validUgcZones = warngenLayer
|
||||
.getUgcsForWatches(watchArea, GeoFeatureType.COUNTY);
|
||||
watches = processRecords(records, validUgcZones);
|
||||
HashSet<String> validUgcZones = new HashSet<String>(
|
||||
warngenLayer.getUgcsForWatches(watchArea,
|
||||
GeoFeatureType.COUNTY));
|
||||
if (config.isIncludeMarineAreasInWatches()) {
|
||||
validUgcZones.addAll(warngenLayer.getUgcsForWatches(
|
||||
watchArea, GeoFeatureType.MARINE));
|
||||
}
|
||||
watches = processRecords(records, validUgcZones, marineUgcs);
|
||||
} catch (RuntimeException e) {
|
||||
statusHandler
|
||||
.handle(Priority.ERROR,
|
||||
|
@ -302,12 +340,13 @@ public class WatchUtil {
|
|||
*
|
||||
* @param activeTableRecords
|
||||
* @param validUgcZones
|
||||
* @param marineUgcs
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<Watch> processRecords(
|
||||
List<ActiveTableRecord> activeTableRecords,
|
||||
Set<String> validUgcZones) {
|
||||
Set<String> validUgcZones, Set<String> marineUgcs) {
|
||||
List<Watch> watches = new ArrayList<Watch>();
|
||||
|
||||
/*
|
||||
|
@ -322,6 +361,9 @@ public class WatchUtil {
|
|||
Map<Watch, List<String>> map = new HashMap<Watch, List<String>>();
|
||||
// For each watch event, get the end time and list of active zones
|
||||
for (ActiveTableRecord ar : activeTableRecords) {
|
||||
if (ar.getAct().equals("CAN") || ar.getAct().equals("EXP")) {
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* Currently reports all zones in the watch even if a given zone is
|
||||
* not in the warning polygon. If the logic is changed to only show
|
||||
|
@ -329,14 +371,16 @@ public class WatchUtil {
|
|||
* validUgcZones here.
|
||||
*/
|
||||
String ugcZone = ar.getUgcZone();
|
||||
String state = getStateName(ugcZone.substring(0, 2));
|
||||
String state = null;
|
||||
|
||||
/*
|
||||
* Temporary fix for SS DR #16703. Remove when marine watch wording
|
||||
* is fixed.
|
||||
*/
|
||||
if (state == null)
|
||||
continue;
|
||||
if (marineUgcs != null && marineUgcs.contains(ugcZone)) {
|
||||
// Just leave state == null
|
||||
} else {
|
||||
state = getStateName(ugcZone.substring(0, 2));
|
||||
if (state == null) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
String action = ar.getAct();
|
||||
String phenSig = ar.getPhensig();
|
||||
|
@ -360,12 +404,18 @@ public class WatchUtil {
|
|||
for (Entry<Watch, List<String>> entry : map.entrySet()) {
|
||||
Watch watch = entry.getKey();
|
||||
watch.setAreas(entry.getValue());
|
||||
List<String> partOfState = new ArrayList<String>(
|
||||
determineAffectedPortions(watch.getAreas()));
|
||||
watch.setPartOfState(partOfState);
|
||||
if (watch.getState() != null) {
|
||||
List<String> partOfState = new ArrayList<String>(
|
||||
determineAffectedPortions(watch.getAreas()));
|
||||
watch.setPartOfState(partOfState);
|
||||
} else {
|
||||
watch.setMarineAreas(determineMarineAreas(watch.getAreas()));
|
||||
}
|
||||
watches.add(watch);
|
||||
}
|
||||
|
||||
// keep the code for their use in the future
|
||||
/*
|
||||
// Sorts the watches based on state name.
|
||||
Collections.sort(watches, new Comparator<Watch>() {
|
||||
|
||||
|
@ -383,6 +433,25 @@ public class WatchUtil {
|
|||
return state1.compareTo(state2);
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
// Sorts the watches based on ETN.
|
||||
Collections.sort(watches, new Comparator<Watch>() {
|
||||
|
||||
@Override
|
||||
public int compare(Watch watch1, Watch watch2) {
|
||||
String etn1 = watch1.getEtn();
|
||||
String etn2 = watch2.getEtn();
|
||||
if (etn1 == etn2)
|
||||
return 0;
|
||||
else if (etn1 == null)
|
||||
return 1;
|
||||
else if (etn2 == null)
|
||||
return -1;
|
||||
else
|
||||
return etn1.compareTo(etn2);
|
||||
}
|
||||
});
|
||||
|
||||
return watches;
|
||||
}
|
||||
|
@ -412,6 +481,40 @@ public class WatchUtil {
|
|||
return affectedPortions;
|
||||
}
|
||||
|
||||
private List<String> determineMarineAreas(List<String> areas) {
|
||||
HashSet<Pair<Integer, String>> groupedAreas = new HashSet<Pair<Integer,String>>();
|
||||
for (String area : areas) {
|
||||
int entryIndex = 0;
|
||||
for (MarineWordingEntry entry : marineWordingConfig.getEntries()) {
|
||||
if (entry.getUgcPattern().matcher(area).matches()) {
|
||||
String replacement = entry.getReplacementText();
|
||||
if (replacement != null) {
|
||||
if (replacement.length() > 0) {
|
||||
groupedAreas.add(new Pair<Integer, String>(
|
||||
entryIndex, entry.getReplacementText()));
|
||||
}
|
||||
} else {
|
||||
groupedAreas.add(new Pair<Integer, String>(entryIndex,
|
||||
getMarineZoneName(area)));
|
||||
}
|
||||
}
|
||||
entryIndex++;
|
||||
}
|
||||
}
|
||||
ArrayList<Pair<Integer, String>> sorted = new ArrayList<Pair<Integer,String>>(groupedAreas);
|
||||
Collections.sort(sorted, new Comparator<Pair<Integer, String>>() {
|
||||
public int compare(Pair<Integer, String> o1, Pair<Integer, String> o2) {
|
||||
int r = o1.getFirst().compareTo(o2.getFirst());
|
||||
return r != 0 ? r : o1.getSecond().compareTo(o2.getSecond());
|
||||
};
|
||||
});
|
||||
ArrayList<String> result = new ArrayList<String>(sorted.size());
|
||||
for (Pair<Integer, String> value : sorted) {
|
||||
result.add(value.getSecond());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the full state name from the state abbreviation.
|
||||
*
|
||||
|
@ -446,6 +549,16 @@ public class WatchUtil {
|
|||
return null;
|
||||
}
|
||||
|
||||
private String getMarineZoneName(String ugc) {
|
||||
for (GeospatialData g : marineGeoData) {
|
||||
if (((String) g.attributes.get(MARINE_ZONE_UGC_FIELD))
|
||||
.endsWith(ugc)) {
|
||||
return (String) g.attributes.get(MARINE_ZONE_NAME_FIELD);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Based on AWIPS 1 SELSparagraphs.C SELSparagraphs::processWOU().
|
||||
private String mungeFeAreas(Set<String> feAreas) {
|
||||
String abrev = "";
|
||||
|
|
|
@ -142,6 +142,8 @@ import com.vividsolutions.jts.io.WKTReader;
|
|||
* Apr 28, 2014 3033 jsanchez Set the site and backup site in Velocity Engine's properties
|
||||
* Jul 21, 2014 3419 jsanchez Refactored WatchUtil.
|
||||
* Aug 15, 2014 DR15701 mgamazaychikov Removed static field watchUtil.
|
||||
* Aug 28, 2014 ASM #15551 Qinglu Lin Replaced 1200 PM/1200 AM by NOON/MIDNIGHT, removed days in
|
||||
* included tornado/severe thunderstorm watch message.
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -875,7 +877,37 @@ public class TemplateRunner {
|
|||
System.out.println("velocity time: "
|
||||
+ (System.currentTimeMillis() - tz0));
|
||||
|
||||
String text = script.toString();
|
||||
String watches[] = {"TORNADO WATCH", "SEVERE THUNDERSTORM WATCH"};
|
||||
int index1 = -1, index2 = -1, index1ToUse = -1;
|
||||
String doubleDollar = "$$";
|
||||
boolean firstTime = true;
|
||||
for (String s: watches) {
|
||||
index1 = script.indexOf(s, 0);
|
||||
if (index1 > 0) {
|
||||
index2 = script.indexOf(doubleDollar, index1);
|
||||
}
|
||||
if (firstTime && index1 > -1) {
|
||||
index1ToUse = index1;
|
||||
firstTime = false;
|
||||
}
|
||||
}
|
||||
String days[] = {"SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY"};
|
||||
String substring = "", text;
|
||||
if (index1ToUse > -1 && index2 > -1) {
|
||||
substring = script.substring(index1ToUse, index2).toUpperCase();
|
||||
// remove day
|
||||
for (String day: days) {
|
||||
substring = substring.replaceAll(day + " ", "");
|
||||
}
|
||||
// replace 1200 PM/1200 AM with NOON/MIDNIGHT
|
||||
substring = substring.replaceAll("1200 PM", "NOON");
|
||||
substring = substring.replaceAll("1200 AM", "MIDNIGHT");
|
||||
// concatenate strings
|
||||
text = script.substring(0, index1ToUse - 1);
|
||||
text = text + " " + substring + script.substring(index2, script.length());
|
||||
} else {
|
||||
text = script.toString();
|
||||
}
|
||||
WarningTextHandler handler = WarningTextHandlerFactory.getHandler(
|
||||
selectedAction, text, config.getAutoLockText());
|
||||
String handledText = handler.handle(text, areas, cancelareas,
|
||||
|
|
|
@ -42,6 +42,7 @@ import com.raytheon.viz.core.mode.CAVEMode;
|
|||
* May 3, 2011 jsanchez Initial creation
|
||||
* Oct 25, 2013 2249 rferrel getAvailableTimes always returns a non-empty list.
|
||||
* Apr 28, 2014 DR 17310 D. Friedman Handle null VTEC fields.
|
||||
* Aug 28, 2014 ASM #15682 D. Friedman Refactor for WouWcnWatchesResourceData.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -98,13 +99,13 @@ public class WWAResourceData extends AbstractRequestableResourceData {
|
|||
|
||||
@Override
|
||||
public DataTime[] getAvailableTimes() throws VizException {
|
||||
DataTime[] available = getAvailableTimes(getMetadataMap(),
|
||||
DataTime[] available = getAvailableWarningTimes(getMetadataMap(),
|
||||
getBinOffset());
|
||||
|
||||
return available;
|
||||
}
|
||||
|
||||
public static DataTime[] getAvailableTimes(
|
||||
public DataTime[] getAvailableWarningTimes(
|
||||
Map<String, RequestConstraint> constraintMap, BinOffset binOffset)
|
||||
throws VizException {
|
||||
DbQueryResponse response = null;
|
||||
|
@ -116,8 +117,9 @@ public class WWAResourceData extends AbstractRequestableResourceData {
|
|||
String etn = "etn";
|
||||
String phensig = "phensig";
|
||||
String act = "act";
|
||||
String pil = "pil";
|
||||
request.addFields(new String[] { startTimeField, endTimeField, act,
|
||||
etn, phensig });
|
||||
etn, phensig, pil });
|
||||
|
||||
response = (DbQueryResponse) ThriftClient.sendRequest(request);
|
||||
if (response.getResults() == null) {
|
||||
|
@ -137,7 +139,10 @@ public class WWAResourceData extends AbstractRequestableResourceData {
|
|||
warnRec.setAct((String) map.get(act));
|
||||
warnRec.setPhensig((String) map.get(phensig));
|
||||
warnRec.setEtn((String) map.get(etn));
|
||||
warnings.add(warnRec);
|
||||
warnRec.setPil((String) map.get(pil));
|
||||
if (isRecordTimeImportant(warnRec)) {
|
||||
warnings.add(warnRec);
|
||||
}
|
||||
}
|
||||
|
||||
RequestConstraint phenSig = constraintMap.get("phensig");
|
||||
|
@ -165,6 +170,10 @@ public class WWAResourceData extends AbstractRequestableResourceData {
|
|||
return availableTimes;
|
||||
}
|
||||
|
||||
protected boolean isRecordTimeImportant(AbstractWarningRecord warnRec) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static TreeSet<DataTime> getWarningStartTimes(
|
||||
ArrayList<AbstractWarningRecord> warnings) {
|
||||
/*
|
||||
|
|
|
@ -267,7 +267,7 @@ public class WatchesResource extends AbstractWWAResource {
|
|||
}
|
||||
}
|
||||
|
||||
private void setGeometry(AbstractWarningRecord record) {
|
||||
protected void setGeometry(AbstractWarningRecord record) {
|
||||
List<String> county = new ArrayList<String>();
|
||||
List<String> marinezone = new ArrayList<String>();
|
||||
List<Geometry> geometries = new ArrayList<Geometry>();
|
||||
|
|
|
@ -0,0 +1,429 @@
|
|||
package com.raytheon.viz.warnings.rsc;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
|
||||
import com.raytheon.uf.common.time.ISimulatedTimeChangeListener;
|
||||
import com.raytheon.uf.common.time.SimulatedTime;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.drawables.FillPatterns;
|
||||
import com.raytheon.uf.viz.core.drawables.IShadedShape;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
|
||||
import com.raytheon.viz.core.rsc.jts.JTSCompiler.PointStyle;
|
||||
import com.vividsolutions.jts.geom.Geometry;
|
||||
|
||||
/**
|
||||
* Displays WOUs updated by WCNs
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 2014-08-28 ASM #15682 D. Friemdan Initial creation
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
public class WouWcnWatchesResource extends WatchesResource implements ISimulatedTimeChangeListener {
|
||||
|
||||
private static Timer timer;
|
||||
|
||||
private TimerTask timerTask;
|
||||
|
||||
// If this is changed to use the maps database, could probably be static
|
||||
private Map<String, Set<String>> cwaUgcMap = new HashMap<String, Set<String>>();
|
||||
|
||||
static final ThreadLocal<SimpleDateFormat> sdf = new ThreadLocal<SimpleDateFormat>() {
|
||||
@Override protected SimpleDateFormat initialValue() {
|
||||
return new SimpleDateFormat("yyyyMMddHHmm");
|
||||
}
|
||||
};
|
||||
|
||||
public WouWcnWatchesResource(WWAResourceData data, LoadProperties props) {
|
||||
super(data, props);
|
||||
comparator = WouWcnWatchesComparator.getInstance();
|
||||
resourceName = "Watches";
|
||||
}
|
||||
|
||||
private AbstractWarningRecord getPreviousRecordForEvent(AbstractWarningRecord rec) {
|
||||
String phenSig = rec.getPhensig();
|
||||
String etn = rec.getEtn();
|
||||
if (phenSig == null || etn == null)
|
||||
return null;
|
||||
AbstractWarningRecord best = null;
|
||||
for (WarningEntry e : entryMap.values()) {
|
||||
if (!phenSig.equals(e.record.getPhensig()) ||
|
||||
!etn.equals(e.record.getEtn()))
|
||||
continue;
|
||||
|
||||
if (best == null || WouWcnWatchesComparator.getInstance().
|
||||
compare(best, e.record) < 0) {
|
||||
best = e.record;
|
||||
}
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
private Set<String> maskCwaUgcs(Set<String> ugcs, AbstractWarningRecord rec) {
|
||||
Set<String> cwaUgcs = getUgcsForCwa(rec.getXxxid());
|
||||
if (cwaUgcs != null) {
|
||||
HashSet<String> result = new HashSet<String>(ugcs);
|
||||
result.removeAll(cwaUgcs);
|
||||
return result;
|
||||
} else {
|
||||
return ugcs;
|
||||
}
|
||||
}
|
||||
|
||||
private Set<String> getUgcsForCwa(String cwa) {
|
||||
return cwaUgcMap.get(cwa.toUpperCase());
|
||||
}
|
||||
|
||||
private Set<String> safe(Set<String> set) {
|
||||
return set != null ? set : new HashSet<String>();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateDisplay(IGraphicsTarget target) throws VizException {
|
||||
if (recordsToLoad.isEmpty())
|
||||
return;
|
||||
|
||||
List<AbstractWarningRecord> mergedWatches = mergeWatches(recordsToLoad);
|
||||
for (AbstractWarningRecord watchRec : mergedWatches) {
|
||||
/* If these things are missing, we can't do anything with the warning. */
|
||||
if (watchRec.getPhensig() == null || watchRec.getEtn() == null ||
|
||||
watchRec.getIssueTime() == null || watchRec.getStartTime() == null ||
|
||||
watchRec.getEndTime() == null || watchRec.getXxxid() == null ||
|
||||
watchRec.getWmoid() == null || watchRec.getAct() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
WarningAction watchAct = WarningAction.valueOf(watchRec.getAct());
|
||||
|
||||
AbstractWarningRecord createShape = null;
|
||||
boolean isWOU = "WOU".equals(watchRec.getPil());
|
||||
|
||||
AbstractWarningRecord prevRec = getPreviousRecordForEvent(watchRec);
|
||||
Set<String> prevUgcs = new HashSet<String>(safe(
|
||||
prevRec != null ? prevRec.getUgcZones() : null));
|
||||
Set<String> newUgcs = null;
|
||||
|
||||
if (watchAct == WarningAction.NEW) {
|
||||
if (isWOU) {
|
||||
createShape = watchRec;
|
||||
} else {
|
||||
noteCwaUgcs(watchRec);
|
||||
// As per requirements, we do not create frames for these.
|
||||
}
|
||||
} else if (watchAct == WarningAction.CON && isWOU) {
|
||||
// As per requirements, we do not create frames for these.
|
||||
} else if (watchAct == WarningAction.CON) {
|
||||
/* No need to do anything because we really only care about
|
||||
* the segments paired with the CON.
|
||||
*/
|
||||
} else if (watchAct == WarningAction.CAN) {
|
||||
/* Not really expecting this for a WOU, but shouldn't cause
|
||||
* a problem if there is one.
|
||||
*/
|
||||
newUgcs = prevUgcs;
|
||||
newUgcs.removeAll(safe(watchRec.getUgcZones()));
|
||||
createShape = watchRec;
|
||||
} else if (watchAct == WarningAction.EXA || watchAct == WarningAction.EXB) {
|
||||
if (!isWOU) {
|
||||
noteCwaUgcs(watchRec);
|
||||
}
|
||||
newUgcs = prevUgcs;
|
||||
newUgcs.addAll(safe(watchRec.getUgcZones()));
|
||||
createShape = watchRec;
|
||||
} else if (watchAct == WarningAction.EXP) {
|
||||
if (isWOU) {
|
||||
if (prevRec != null) {
|
||||
if (! prevRec.getEndTime().equals(watchRec.getEndTime())) {
|
||||
prevRec.setEndTime(watchRec.getEndTime());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Ideally we do not need to create a shape, but if we do
|
||||
* not and time matching creates a frame for an EXP that is
|
||||
* issued before the expiration time, the warning would show
|
||||
* as still active on that frame.
|
||||
*/
|
||||
newUgcs = new HashSet<String>();
|
||||
createShape = watchRec;
|
||||
} else {
|
||||
newUgcs = maskCwaUgcs(prevUgcs, watchRec);
|
||||
createShape = watchRec;
|
||||
}
|
||||
}
|
||||
if (watchAct == WarningAction.EXT || watchAct == WarningAction.EXB) {
|
||||
/* This resource does not handle different expiration times
|
||||
* for different UGCs.
|
||||
*
|
||||
* Also assuming this does not add/remove UGCs.
|
||||
*/
|
||||
if (prevRec != null && watchRec.getEndTime() != null) {
|
||||
if (isWOU && watchRec.getUgcZones() != null && watchRec.getUgcZones().isEmpty()) {
|
||||
/*
|
||||
* This probably does not actually happen, but this
|
||||
* is the only way we can support shortening the
|
||||
* expiration time with the current design.
|
||||
*/
|
||||
prevRec.setEndTime(watchRec.getEndTime());
|
||||
} else {
|
||||
if (prevRec.getEndTime().before(watchRec.getEndTime())) {
|
||||
prevRec.setEndTime(watchRec.getEndTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (createShape != null) {
|
||||
if (newUgcs != null)
|
||||
createShape.setUgcZones(newUgcs);
|
||||
else if (createShape.getUgcZones() == null)
|
||||
createShape.setUgcZones(new HashSet<String>());
|
||||
insertShape(target, createShape);
|
||||
}
|
||||
}
|
||||
|
||||
recordsToLoad.clear();
|
||||
scheduleNextTime();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initShape(IGraphicsTarget target,
|
||||
AbstractWarningRecord record) throws VizException {
|
||||
String key = getEntryMapKey(record);
|
||||
WarningEntry entry = entryMap.get(key);
|
||||
if (entry != null) {
|
||||
createShape(target, entry);
|
||||
}
|
||||
}
|
||||
|
||||
protected void insertShape(IGraphicsTarget target, AbstractWarningRecord record) throws VizException {
|
||||
String key = getEntryMapKey(record);
|
||||
WarningEntry entry = entryMap.get(key);
|
||||
if (entry == null) {
|
||||
entry = new WarningEntry();
|
||||
entryMap.put(key, entry);
|
||||
}
|
||||
entry.record = record; // ...possibly replacing an existing record
|
||||
if (! record.getUgcZones().isEmpty()) {
|
||||
setGeometry(record);
|
||||
} else {
|
||||
entry.record.setGeometry(null);
|
||||
}
|
||||
createShape(target, entry);
|
||||
}
|
||||
|
||||
protected void createShape(IGraphicsTarget target, WarningEntry entry) throws VizException {
|
||||
if (entry.shadedShape != null) {
|
||||
entry.shadedShape.dispose();
|
||||
entry.shadedShape = null;
|
||||
}
|
||||
AbstractWarningRecord record = entry.record;
|
||||
if (record.getGeometry() != null) {
|
||||
IShadedShape ss = target.createShadedShape(false,
|
||||
descriptor.getGridGeometry(), false);
|
||||
Geometry geo = (Geometry) record.getGeometry().clone();
|
||||
JTSCompiler jtsCompiler = new JTSCompiler(ss, null,
|
||||
this.descriptor, PointStyle.CROSS);
|
||||
jtsCompiler.handle(geo, color);
|
||||
ss.setFillPattern(FillPatterns.getGLPattern(record.getPhen()
|
||||
.equals("TO") ? "VERTICAL" : "HORIZONTAL"));
|
||||
ss.compile();
|
||||
entry.shadedShape = ss;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Groups all the ugc zones with the same action, phensig, ETN, site, and
|
||||
* issuance time.
|
||||
*/
|
||||
protected List<AbstractWarningRecord> mergeWatches(
|
||||
List<AbstractWarningRecord> watchrecs) {
|
||||
SimpleDateFormat sdfi = sdf.get();
|
||||
|
||||
Map<String, AbstractWarningRecord> watches = new HashMap<String, AbstractWarningRecord>();
|
||||
for (AbstractWarningRecord watchrec : watchrecs) {
|
||||
if (watchrec.getIssueTime() == null)
|
||||
continue;
|
||||
|
||||
String key = watchrec.getAct() + '.' + watchrec.getPhensig() + '.'
|
||||
+ watchrec.getEtn() + '.' + watchrec.getOfficeid() + '.'
|
||||
+ sdfi.format(watchrec.getIssueTime().getTime());
|
||||
AbstractWarningRecord watch = watches.get(key);
|
||||
if (watch == null) {
|
||||
watch = watchrec;
|
||||
watches.put(key, watch);
|
||||
} else {
|
||||
Set<String> ugcZones = watch.getUgcZones();
|
||||
if (ugcZones != null) {
|
||||
ugcZones.addAll(watchrec.getUgcZones());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<AbstractWarningRecord> mergedWatches = new ArrayList<AbstractWarningRecord>(
|
||||
watches.values());
|
||||
Collections.sort(mergedWatches, comparator);
|
||||
|
||||
return mergedWatches;
|
||||
}
|
||||
|
||||
protected String getEntryMapKey(AbstractWarningRecord rec) {
|
||||
return sdf.get().format(rec.getIssueTime().getTime()) + '.'
|
||||
+ rec.getWmoid() + '.' + rec.getPhensig() + '.' + rec.getEtn();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getEventKey(WarningEntry entry) {
|
||||
AbstractWarningRecord r = entry.record;
|
||||
return r.getPhensig() + '.' + r.getEtn();
|
||||
}
|
||||
|
||||
private void noteCwaUgcs(AbstractWarningRecord watchRec) {
|
||||
String siteKey = watchRec.getXxxid();
|
||||
Set<String> recUgcs = watchRec.getUgcZones();
|
||||
if (siteKey == null || recUgcs == null)
|
||||
return;
|
||||
|
||||
synchronized (cwaUgcMap) {
|
||||
Set<String> ugcs = cwaUgcMap.get(siteKey);
|
||||
if (ugcs == null) {
|
||||
ugcs = new HashSet<String>();
|
||||
cwaUgcMap.put(siteKey, ugcs);
|
||||
}
|
||||
ugcs.addAll(recUgcs);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposeInternal() {
|
||||
synchronized(this) {
|
||||
if (timerTask != null)
|
||||
timerTask.cancel();
|
||||
}
|
||||
super.disposeInternal();
|
||||
}
|
||||
|
||||
private void scheduleNextTime() {
|
||||
/* TODO: This is a race condition. Need the last frame time,
|
||||
* but getLastFrameTimeRange() is also a race condition. So really need
|
||||
* last drawn last frame time, but LAST_FRAME_ADJ is an hour ahead??!
|
||||
*/
|
||||
long vnow = SimulatedTime.getSystemTime().getMillis();
|
||||
AbstractWarningRecord best = null;
|
||||
for (WarningEntry entry : entryMap.values()) {
|
||||
AbstractWarningRecord rec = entry.record;
|
||||
if (rec.getEndTime().getTimeInMillis() >= vnow &&
|
||||
(best == null || rec.getEndTime().before(best.getEndTime()))) {
|
||||
best = rec;
|
||||
}
|
||||
}
|
||||
if (best != null) {
|
||||
scheduleTimer(best.getEndTime().getTimeInMillis() - vnow);
|
||||
} else {
|
||||
scheduleTimer(-1);
|
||||
}
|
||||
}
|
||||
|
||||
private synchronized void scheduleTimer(long delay) {
|
||||
if (timerTask != null) {
|
||||
timerTask.cancel();
|
||||
}
|
||||
if (delay >= 0) {
|
||||
timerTask = new WatchesTimerTask();
|
||||
getTimer().schedule(timerTask, delay);
|
||||
} else {
|
||||
timerTask = null;
|
||||
}
|
||||
}
|
||||
|
||||
private Timer getTimer() {
|
||||
if (timer == null) {
|
||||
synchronized (WouWcnWatchesResource.class) {
|
||||
if (timer == null) {
|
||||
timer = new Timer(WouWcnWatchesResource.class.getName() + " Timer");
|
||||
}
|
||||
}
|
||||
}
|
||||
return timer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void timechanged() {
|
||||
issueRefresh();
|
||||
scheduleNextTime();
|
||||
}
|
||||
|
||||
protected class WatchesTimerTask extends TimerTask {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
timechanged();
|
||||
}
|
||||
}
|
||||
|
||||
protected static class WouWcnWatchesComparator implements Comparator<AbstractWarningRecord> {
|
||||
|
||||
static final WouWcnWatchesComparator instance = new WouWcnWatchesComparator();
|
||||
|
||||
public static Comparator<AbstractWarningRecord> getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(AbstractWarningRecord a, AbstractWarningRecord b) {
|
||||
int r;
|
||||
Calendar ca = a.getIssueTime();
|
||||
Calendar cb = b.getIssueTime();
|
||||
if (ca == null) {
|
||||
if (cb == null)
|
||||
r = 0;
|
||||
else
|
||||
return 1;
|
||||
} else if (cb == null)
|
||||
return -1;
|
||||
else
|
||||
r = ca.compareTo(cb);
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
// The point of this is to handle the BBB field, but it makes the TTAAii part significant too...
|
||||
String sa = safeWmo(a);
|
||||
String sb = safeWmo(b);
|
||||
r = sa.compareTo(sb);
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
r = a.getSeg() - b.getSeg();
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private static String safeWmo(AbstractWarningRecord record) {
|
||||
String wmo = record.getWmoid();
|
||||
return wmo != null ? wmo : "TTAA00 CCCC 000000";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.raytheon.viz.warnings.rsc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
|
||||
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
|
||||
/**
|
||||
* Displays WOUs updated by WCNs
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 2014-08-28 ASM #15682 D. Friemdan Initial creation
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class WouWcnWatchesResourceData extends WWAResourceData {
|
||||
|
||||
@Override
|
||||
protected AbstractVizResource<?, ?> constructResource(
|
||||
LoadProperties loadProperties, PluginDataObject[] objects)
|
||||
throws VizException {
|
||||
// add records
|
||||
records = new ArrayList<AbstractWarningRecord>(objects.length);
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
AbstractWarningRecord r = (AbstractWarningRecord) objects[i];
|
||||
records.add(r);
|
||||
}
|
||||
|
||||
return new WouWcnWatchesResource(this, loadProperties);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isRecordTimeImportant(AbstractWarningRecord warnRec) {
|
||||
WarningAction act = WarningAction.valueOf(warnRec.getAct());
|
||||
if (("WOU".equals(warnRec.getPil()) && WarningAction.CON == act) ||
|
||||
("WCN".equals(warnRec.getPil()) && WarningAction.NEW == act)) {
|
||||
return false;
|
||||
} else {
|
||||
return super.isRecordTimeImportant(warnRec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -98,6 +98,7 @@ wrapper.java.additional.gc.1=-XX:+UseConcMarkSweepGC
|
|||
wrapper.java.additional.gc.2=-XX:+CMSIncrementalMode
|
||||
wrapper.java.additional.gc.3=-XX:+HeapDumpOnOutOfMemoryError
|
||||
wrapper.java.additional.gc.4=-XX:HeapDumpPath=/data/fxa/cave/${SHORT_HOSTNAME}/
|
||||
wrapper.java.additional.gc.5=-XX:SoftRefLRUPolicyMSPerMB=${SOFT_REF_LRU_POLICY_MS_PER_MB}
|
||||
|
||||
# use qpid binding URL instead of default address string format
|
||||
wrapper.java.additional.qpid.1=-Dqpid.dest_syntax=BURL
|
||||
|
|
|
@ -28,3 +28,5 @@ export MGMT_PORT=9607
|
|||
|
||||
export METADATA_POOL_TIMEOUT=60
|
||||
export CLUSTER_ID=NCF
|
||||
|
||||
export SOFT_REF_LRU_POLICY_MS_PER_MB=50
|
||||
|
|
|
@ -45,3 +45,5 @@ export WRAPPER_DEADLOCK_ACTION=RESTART
|
|||
export WRAPPER_ON_EXIT_ACTION=RESTART
|
||||
export WRAPPER_TRIGGER_ACTION=RESTART
|
||||
export WRAPPER_USE_SYSTEM_JAVA=false
|
||||
|
||||
export SOFT_REF_LRU_POLICY_MS_PER_MB=1000
|
||||
|
|
|
@ -29,3 +29,5 @@ export EBXML_REGISTRY_FEDERATION_ENABLED=false
|
|||
export NCF_HOST=${DATADELIVERY_HOST}
|
||||
export NCF_ADDRESS=http://${NCF_HOST}:${EBXML_REGISTRY_WEBSERVER_PORT}
|
||||
export NCF_BANDWIDTH_MANAGER_SERVICE=http://${NCF_HOST}:${EBXML_THRIFT_SERVICE_PORT}/services
|
||||
|
||||
export SOFT_REF_LRU_POLICY_MS_PER_MB=50
|
||||
|
|
|
@ -28,3 +28,5 @@ export MGMT_PORT=9605
|
|||
|
||||
export METADATA_POOL_MAX=20
|
||||
export METADATA_POOL_TIMEOUT=60
|
||||
|
||||
export SOFT_REF_LRU_POLICY_MS_PER_MB=50
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* Jul 24, 2012 dgilling Initial creation
|
||||
* Aug 07, 2013 1561 njensen Use pm.listFiles() instead of pm.listStaticFiles()
|
||||
* Sep 30, 2013 2361 njensen Use JAXBManager for XML
|
||||
* Sep 08, 2104 3592 randerso Changed to use new pm listStaticFiles()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -81,9 +82,9 @@ public class ReferenceMgr {
|
|||
public ServerResponse<List<ReferenceID>> getInventory() {
|
||||
List<ReferenceID> refIDs = new ArrayList<ReferenceID>();
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationFile[] contents = pm.listFiles(
|
||||
pm.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
|
||||
EDIT_AREAS_DIR, new String[] { ".xml" }, false, true);
|
||||
LocalizationFile[] contents = pm.listStaticFiles(
|
||||
LocalizationType.COMMON_STATIC, EDIT_AREAS_DIR,
|
||||
new String[] { ".xml" }, false, true);
|
||||
if (contents != null) {
|
||||
for (LocalizationFile lf : contents) {
|
||||
String s = LocalizationUtil.extractName(lf.getName());
|
||||
|
@ -116,7 +117,8 @@ public class ReferenceMgr {
|
|||
// process each ReferenceID requested
|
||||
for (ReferenceID id : ids) {
|
||||
String path = FileUtil.join(EDIT_AREAS_DIR, id.getName() + ".xml");
|
||||
LocalizationFile lf = pathMgr.getStaticLocalizationFile(path);
|
||||
LocalizationFile lf = pathMgr.getStaticLocalizationFile(
|
||||
LocalizationType.COMMON_STATIC, path);
|
||||
|
||||
// does it exist?
|
||||
if (lf == null) {
|
||||
|
@ -129,8 +131,8 @@ public class ReferenceMgr {
|
|||
// open and read the file
|
||||
ReferenceData refData = null;
|
||||
try {
|
||||
refData = ReferenceData.getJAXBManager()
|
||||
.unmarshalFromXmlFile(lf.getFile().getPath());
|
||||
refData = ReferenceData.getJAXBManager().unmarshalFromXmlFile(
|
||||
lf.getFile().getPath());
|
||||
} catch (Exception e) {
|
||||
sr.addMessage("Unable to read reference data [" + id + "]");
|
||||
data = Collections.emptyList();
|
||||
|
|
|
@ -140,6 +140,7 @@
|
|||
<alias base="RTMA">rtmaNDFD</alias>
|
||||
<alias base="RTMA-Mosaic">rtmaNDFD</alias>
|
||||
<alias base="AK-RTMA">aKrtmaNDFD</alias>
|
||||
<alias base="AK-RTMA3">aKrtmaNDFD</alias>
|
||||
<alias base="HI-RTMA">HIrtmaNDFD</alias>
|
||||
<alias base="PR-RTMA">PRrtmaNDFD</alias>
|
||||
<alias base="Guam-RTMA">rtmaNDFD</alias>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
Changed TP_XXX to tpXXX for RFC total precip
|
||||
Jul 03, 2013 #2044 randerso Removed mappings from tpXXX to tp_XXX for RFCQPF
|
||||
Mar 31, 2014 #2934 dgilling Updated params for pSurge2.0/PHISH data.
|
||||
Jul 03, 2014 DR 14068 mfoster Added parameters for 3km AK-RTMA
|
||||
-->
|
||||
<aliasList caseSensitive="true" namespace="gfeParamName">
|
||||
<alias base="AV">av</alias>
|
||||
|
@ -23,6 +24,7 @@
|
|||
<alias base="DIRSW">dirsw</alias>
|
||||
<alias base="DpD">dpd</alias>
|
||||
<alias base="DpT">dpt</alias>
|
||||
<alias base="DpTerranl">dpterranl</alias>
|
||||
<alias base="ELEV">ELEV</alias>
|
||||
<alias base="EMSP">emsp</alias>
|
||||
<alias base="EPT">ept</alias>
|
||||
|
@ -48,6 +50,7 @@
|
|||
<alias base="PMSL">pmsl</alias>
|
||||
<alias base="PoT">pot</alias>
|
||||
<alias base="P">p</alias>
|
||||
<alias base="Perranl">perranl</alias>
|
||||
<alias base="PR">pr</alias>
|
||||
<alias base="PRSVR">prsvr</alias>
|
||||
<alias base="PRSIGSV">prsigsv</alias>
|
||||
|
@ -77,19 +80,24 @@
|
|||
<alias base="TP6hr">tp6hr</alias>
|
||||
<alias base="TP">tp</alias>
|
||||
<alias base="T">t</alias>
|
||||
<alias base="Terranl">terranl</alias>
|
||||
<alias base="USTM">ustm</alias>
|
||||
<alias base="uW">uw</alias>
|
||||
<alias base="VAPP">vapp</alias>
|
||||
<alias base="Vis">vis</alias>
|
||||
<alias base="Viserranl">viserranl</alias>
|
||||
<alias base="VPT">vpt</alias>
|
||||
<alias base="VSTM">vstm</alias>
|
||||
<alias base="vW">vw</alias>
|
||||
<alias base="WD">wd</alias>
|
||||
<alias base="WDerranl">wderranl</alias>
|
||||
<alias base="WEASD">weasd</alias>
|
||||
<alias base="WGH">wgh</alias>
|
||||
<alias base="WGS">wgs</alias>
|
||||
<alias base="WINDPROB">windprob</alias>
|
||||
<alias base="WGSerranl">wgserranl</alias>
|
||||
<alias base="WS">ws</alias>
|
||||
<alias base="WSerranl">wserranl</alias>
|
||||
<alias base="WVDIR">wvdir</alias>
|
||||
<alias base="WVHGT">wvhgt</alias>
|
||||
<alias base="WVPER">wvper</alias>
|
||||
|
|
|
@ -240,6 +240,7 @@ else:
|
|||
TdUnc = ("TdUnc", SCALAR, "F", "Dewpoint Anl Uncertainty", 15.0, 0.0, 0, NO)
|
||||
WSpdUnc = ("WSpdUnc", SCALAR, "kts", "WSpd Anl Uncertainty", 12.0, 0.0, 0, NO)
|
||||
WDirUnc = ("WDirUnc", SCALAR, "deg", "WDir Anl Uncertainty", 10.0, 0.0, 0, NO)
|
||||
VisUnc = ("VisUnc", SCALAR, "SM", "Vsby Anl Uncertainty", 10.0, 0.0, 2, NO)
|
||||
|
||||
# NamDNG5 parms
|
||||
QPF3 = ("QPF3", SCALAR, "in", "3HR QPF", 3.0, 0.0, 2, YES)
|
||||
|
@ -1064,7 +1065,8 @@ if SID in ALASKA_SITES:
|
|||
'AKwave10',
|
||||
'AKwave4',
|
||||
'GlobalWave',
|
||||
('AK-RTMA','RTMA'),
|
||||
# ('AK-RTMA','RTMA'),
|
||||
('AK-RTMA3','RTMA'), # Only have one RTMA
|
||||
('AK-NamDNG5','NamDNG5'),
|
||||
('MOSGuide-AK', 'MOSGuide'),
|
||||
('HiResW-ARW-AK', 'HIRESWarw'),
|
||||
|
@ -1863,15 +1865,15 @@ TPCTCM_MODEL = [([HiWind], TC3)]
|
|||
# RTMA database parameter groupings
|
||||
#if SID in ALASKA_SITES: - not sure if this is right
|
||||
if SID in ALASKA_SITES or SID in ["HFO", "SJU"]:
|
||||
RTMAPARMS = [([Temp,Td,RH,Wind],TC1),
|
||||
RTMAPARMS = [([Temp,Td,RH,Wind,Vis],TC1),
|
||||
([MinT],MinTTC), ([MaxT],MaxTTC),
|
||||
([MinRH],MinRHTC), ([MaxRH],MaxRHTC),
|
||||
([TUnc,TdUnc,WSpdUnc,WDirUnc],TC1)]
|
||||
([TUnc,TdUnc,WSpdUnc,WDirUnc,VisUnc],TC1)]
|
||||
else:
|
||||
RTMAPARMS = [([Temp,Td,RH,Wind,QPE,Sky],TC1),
|
||||
RTMAPARMS = [([Temp,Td,RH,Wind,QPE,Sky,Vis],TC1),
|
||||
([MinT],MinTTC), ([MaxT],MaxTTC),
|
||||
([MinRH],MinRHTC), ([MaxRH],MaxRHTC),
|
||||
([TUnc,TdUnc,WSpdUnc,WDirUnc],TC1)]
|
||||
([TUnc,TdUnc,WSpdUnc,WDirUnc,VisUnc],TC1)]
|
||||
|
||||
# NamDNG5 database parameter groupings
|
||||
NamDNG5PARMS = [([Temp, Td, RH, Wind, Sky, WindGust, Vis], TC3),
|
||||
|
|
|
@ -232,4 +232,109 @@
|
|||
<level>FHAG2</level>
|
||||
</levels>
|
||||
</gridParameterInfo>
|
||||
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
|
||||
<short_name>wgs</short_name>
|
||||
<long_name>Wind Gust Speed</long_name>
|
||||
<units>m/s</units>
|
||||
<udunits>meter/sec</udunits>
|
||||
<uiname>windGustSpeed</uiname>
|
||||
<valid_range>-150.0</valid_range>
|
||||
<valid_range>150.0</valid_range>
|
||||
<fillValue>-99999.0</fillValue>
|
||||
<n3D>1</n3D>
|
||||
<levelsDesc>FHAG 10</levelsDesc>
|
||||
<levels>
|
||||
<level>FHAG10</level>
|
||||
</levels>
|
||||
</gridParameterInfo>
|
||||
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
|
||||
<short_name>wgserranl</short_name>
|
||||
<long_name>wind speed uncertainty</long_name>
|
||||
<units>m/s</units>
|
||||
<udunits>meter/sec</udunits>
|
||||
<uiname>WGSerranlind</uiname>
|
||||
<valid_range>-150.0</valid_range>
|
||||
<valid_range>150.0</valid_range>
|
||||
<fillValue>-99999.0</fillValue>
|
||||
<n3D>1</n3D>
|
||||
<levelsDesc>FHAG 10</levelsDesc>
|
||||
<levels>
|
||||
<level>FHAG10</level>
|
||||
</levels>
|
||||
</gridParameterInfo>
|
||||
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
|
||||
<short_name>vis</short_name>
|
||||
<long_name>visibility</long_name>
|
||||
<units>m</units>
|
||||
<udunits>meters</udunits>
|
||||
<uiname>Vis</uiname>
|
||||
<valid_range>0.0</valid_range>
|
||||
<valid_range>100000.0</valid_range>
|
||||
<fillValue>-99999.0</fillValue>
|
||||
<n3D>1</n3D>
|
||||
<levelsDesc>SFC</levelsDesc>
|
||||
<levels>
|
||||
<level>SFC</level>
|
||||
</levels>
|
||||
</gridParameterInfo>
|
||||
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
|
||||
<short_name>viserranl</short_name>
|
||||
<long_name>visibility uncertainty</long_name>
|
||||
<units>m</units>
|
||||
<udunits>meters</udunits>
|
||||
<uiname>Viserranlind</uiname>
|
||||
<valid_range>0.0</valid_range>
|
||||
<valid_range>100000.0</valid_range>
|
||||
<fillValue>-99999.0</fillValue>
|
||||
<n3D>1</n3D>
|
||||
<levelsDesc>SFC</levelsDesc>
|
||||
<levels>
|
||||
<level>SFC</level>
|
||||
</levels>
|
||||
</gridParameterInfo>
|
||||
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
|
||||
<short_name>perranl</short_name>
|
||||
<long_name>pressure uncertainty</long_name>
|
||||
<units>Pa</units>
|
||||
<udunits>pascal</udunits>
|
||||
<uiname>atmPerranlind</uiname>
|
||||
<valid_range>0.0</valid_range>
|
||||
<valid_range>110000.0</valid_range>
|
||||
<fillValue>-99999.0</fillValue>
|
||||
<n3D>1</n3D>
|
||||
<levelsDesc>SFC</levelsDesc>
|
||||
<levels>
|
||||
<level>SFC</level>
|
||||
</levels>
|
||||
</gridParameterInfo>
|
||||
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
|
||||
<short_name>p</short_name>
|
||||
<long_name>pressure</long_name>
|
||||
<units>Pa</units>
|
||||
<udunits>pascal</udunits>
|
||||
<uiname>atmP</uiname>
|
||||
<valid_range>0.0</valid_range>
|
||||
<valid_range>110000.0</valid_range>
|
||||
<fillValue>-99999.0</fillValue>
|
||||
<n3D>1</n3D>
|
||||
<levelsDesc>SFC</levelsDesc>
|
||||
<levels>
|
||||
<level>SFC</level>
|
||||
</levels>
|
||||
</gridParameterInfo>
|
||||
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
|
||||
<short_name>gh</short_name>
|
||||
<long_name>Geopotential height</long_name>
|
||||
<units>m</units>
|
||||
<udunits>meters</udunits>
|
||||
<uiname>geoPotHt</uiname>
|
||||
<valid_range>-2000.0</valid_range>
|
||||
<valid_range>20000.0</valid_range>
|
||||
<fillValue>-99999.0</fillValue>
|
||||
<n3D>1</n3D>
|
||||
<levelsDesc>SFC</levelsDesc>
|
||||
<levels>
|
||||
<level>SFC</level>
|
||||
</levels>
|
||||
</gridParameterInfo>
|
||||
</gridParamInfo>
|
||||
|
|
|
@ -402,7 +402,11 @@ class Forecaster(GridUtilities):
|
|||
#--------------------------------------------------------------------------
|
||||
def convertKtoF(self, t):
|
||||
return self.KtoF(t)
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# Converts the value from meters to statute miles
|
||||
#--------------------------------------------------------------------------
|
||||
def convertMtoSM(self, d):
|
||||
return d * 0.00062
|
||||
#--------------------------------------------------------------------------
|
||||
# Calculates the saturation vapor pressure give the temperature in K
|
||||
#--------------------------------------------------------------------------
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
##
|
||||
# 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
|
||||
# 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
|
||||
#
|
||||
# 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.
|
||||
##
|
||||
|
@ -114,6 +114,15 @@ class RTMAForecaster(Forecaster):
|
|||
def calcWDirUnc(self, wderranl_FHAG10):
|
||||
return wderranl_FHAG10
|
||||
|
||||
##--------------------------------------------------------------------------
|
||||
## Visibility
|
||||
##--------------------------------------------------------------------------
|
||||
def calcVis(self, vis_SFC):
|
||||
return self.convertMtoSM(vis_SFC)
|
||||
|
||||
def calcVisUnc(self, viserranl_SFC):
|
||||
return self.convertMtoSM(viserranl_SFC)
|
||||
|
||||
##-------------------------------------------------------------------------
|
||||
## TdAft and TdMrn - simply calculate from MaxT/MinRH and MinT/MaxRH
|
||||
##-------------------------------------------------------------------------
|
||||
|
|
|
@ -376,6 +376,11 @@
|
|||
<datasetId>AK-RTMA</datasetId>
|
||||
<dt>1</dt>
|
||||
</info>
|
||||
<info>
|
||||
<title>AK-RTMA3</title>
|
||||
<datasetId>AK-RTMA3</datasetId>
|
||||
<dt>1</dt>
|
||||
</info>
|
||||
<info>
|
||||
<title>NamDNG5</title>
|
||||
<datasetId>NamDNG5</datasetId>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<name>HRRR</name>
|
||||
<center>7</center>
|
||||
<subcenter>0</subcenter>
|
||||
<grid>184</grid>
|
||||
<process>
|
||||
<id>83</id>
|
||||
</process>
|
||||
|
@ -3102,7 +3103,7 @@
|
|||
</model>
|
||||
|
||||
<model>
|
||||
<name>AK-RTMA-HR</name>
|
||||
<name>AK-RTMA3</name>
|
||||
<center>7</center>
|
||||
<subcenter>4</subcenter>
|
||||
<grid>1023</grid>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Product Discipline 0 - Meteorological products, Parameter Category 16: Forecast Radar Imagery
|
||||
# 192-254 Reserved for Local Use
|
||||
3:3:Echo Top:m:RETOP
|
||||
192:192:Derived radar reflectivity backscatter from rain:mm^6/m^3:REFZR
|
||||
193:193:Derived radar reflectivity backscatter from ice:mm^6/m^3:REFZI
|
||||
194:194:Derived radar reflectivity backscatter from parameterized convection:mm^6/m^3:REFZC
|
||||
|
|
|
@ -129,6 +129,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
|||
* 07/10/2014 3370 mpduff Fix update/insert issue for riverstatus
|
||||
* 07/14/2014 mpduff Fix data range checks
|
||||
* 08/05/2014 15671 snaples Fixed check for posting when not found in ingestfilter and token is set for load_shef_ingest
|
||||
* 09/03/2014 mpduff Fixed river status table updates.
|
||||
* </pre>
|
||||
*
|
||||
* @author mduff
|
||||
|
@ -1059,24 +1060,24 @@ public class PostShef {
|
|||
+ "] to commentValue table");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* if we just received some forecast height or discharge data,
|
||||
* then update the riverstatus table for those reports
|
||||
*/
|
||||
if ((DataType.FORECAST.equals(dataType))
|
||||
&& loadMaxFcst
|
||||
&& (data.getPhysicalElement().getCode().startsWith("H") || data
|
||||
.getPhysicalElement().getCode().startsWith("Q"))) {
|
||||
postRiverStatus(data, locId);
|
||||
if (!same_lid_product) {
|
||||
log.info("Update RiverStatus for: " + locId + " " + pe);
|
||||
}
|
||||
}
|
||||
} // for
|
||||
|
||||
postTables.executeBatchUpdates();
|
||||
} catch (Exception e) {
|
||||
|
||||
if (!dataValues.isEmpty()) {
|
||||
ShefData data = dataValues.get(0);
|
||||
DataType dataType = ParameterCode.DataType.getDataType(
|
||||
data.getTypeSource(), procObs);
|
||||
if ((DataType.FORECAST.equals(dataType))
|
||||
&& loadMaxFcst
|
||||
&& (data.getPhysicalElement().getCode().startsWith("H") || data
|
||||
.getPhysicalElement().getCode().startsWith("Q"))) {
|
||||
postRiverStatus(data, locId);
|
||||
log.info("Update RiverStatus for: " + locId + " "
|
||||
+ data.getPhysicalElement().getCode());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("An error occurred posting shef data.", e);
|
||||
}
|
||||
|
||||
|
@ -1680,7 +1681,8 @@ public class PostShef {
|
|||
private void convertDur(short dur, ShefData data) {
|
||||
String value = null;
|
||||
String durationCode = null;
|
||||
value = DURATION_MAP.get(dur);
|
||||
Integer durInt = new Integer(dur);
|
||||
value = DURATION_MAP.get(durInt);
|
||||
if (value == null) {
|
||||
// Anything not in the DURATION_MAP is
|
||||
// probably a variable duration.
|
||||
|
|
|
@ -86,6 +86,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
|
|||
* 09/19/2013 16515 w. Kwock Fix the excessive digits in rawpp,lake,height...tables
|
||||
* 04/29/2014 3088 mpduff Change logging class, clean up/optimization.
|
||||
* More performance fixes.
|
||||
* 09/03/2014 mpduff postRiverStatus() writes directly, not via batch
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -123,10 +124,6 @@ public class PostTables {
|
|||
|
||||
private Map<String, CallableStatement> statementMap = new HashMap<String, CallableStatement>();
|
||||
|
||||
private PreparedStatement riverStatusUpdateStatement = null;
|
||||
|
||||
private PreparedStatement riverStatusInsertStatement = null;
|
||||
|
||||
static {
|
||||
gagePPSetup();
|
||||
}
|
||||
|
@ -1222,10 +1219,11 @@ public class PostTables {
|
|||
String ts = null;
|
||||
float probability = -9999;
|
||||
int status = -1;
|
||||
|
||||
PreparedStatement ps = null;
|
||||
|
||||
try {
|
||||
conn = getConnection();
|
||||
PreparedStatement ps = getRiverStatusPreparedStatement(updateFlag);
|
||||
ps = getRiverStatusPreparedStatement(updateFlag);
|
||||
lid = shefDataValue.getLocationId();
|
||||
ps.setString(1, lid);
|
||||
|
||||
|
@ -1258,7 +1256,6 @@ public class PostTables {
|
|||
timeStamp2 = new java.sql.Timestamp(basisDate.getTime());
|
||||
ps.setTimestamp(8, timeStamp2);
|
||||
|
||||
// ps.setFloat(9, Float.parseFloat(shefDataValue.getStringValue()));
|
||||
ps.setDouble(9, shefDataValue.getValue().floatValue());
|
||||
|
||||
if (updateFlag) {
|
||||
|
@ -1266,7 +1263,8 @@ public class PostTables {
|
|||
ps.setString(11, pe);
|
||||
ps.setString(12, ts);
|
||||
}
|
||||
ps.addBatch();
|
||||
ps.execute();
|
||||
conn.commit();
|
||||
} catch (Exception e) {
|
||||
if (updateFlag) {
|
||||
log.error(String.format(
|
||||
|
@ -1276,26 +1274,32 @@ public class PostTables {
|
|||
"Error inserting into RiverStatus with [%s]", record),
|
||||
e);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (ps != null) {
|
||||
try {
|
||||
ps.close();
|
||||
} catch (SQLException e) {
|
||||
log.error(
|
||||
"Error closing prepared statement for RiverStatus",
|
||||
e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
private PreparedStatement getRiverStatusPreparedStatement(boolean updateFlag)
|
||||
throws SQLException {
|
||||
if (updateFlag) {
|
||||
if (riverStatusUpdateStatement == null) {
|
||||
riverStatusUpdateStatement = conn
|
||||
.prepareCall(RIVER_STATUS_UPDATE_STATEMENT);
|
||||
}
|
||||
return riverStatusUpdateStatement;
|
||||
} else {
|
||||
if (riverStatusInsertStatement == null) {
|
||||
riverStatusInsertStatement = conn
|
||||
.prepareCall(RIVER_STATUS_INSERT_STATEMENT);
|
||||
}
|
||||
return riverStatusInsertStatement;
|
||||
}
|
||||
if (updateFlag) {
|
||||
PreparedStatement riverStatusUpdateStatement = conn
|
||||
.prepareCall(RIVER_STATUS_UPDATE_STATEMENT);
|
||||
return riverStatusUpdateStatement;
|
||||
} else {
|
||||
PreparedStatement riverStatusInsertStatement = conn
|
||||
.prepareCall(RIVER_STATUS_INSERT_STATEMENT);
|
||||
return riverStatusInsertStatement;
|
||||
}
|
||||
}
|
||||
|
||||
private Connection getConnection() {
|
||||
|
@ -1314,26 +1318,6 @@ public class PostTables {
|
|||
* Close the connections and statements
|
||||
*/
|
||||
public void close() {
|
||||
if (riverStatusInsertStatement != null) {
|
||||
try {
|
||||
riverStatusInsertStatement.close();
|
||||
} catch (SQLException e) {
|
||||
log.error(
|
||||
"Error closing river status insert prepared statement",
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
||||
if (riverStatusUpdateStatement != null) {
|
||||
try {
|
||||
riverStatusUpdateStatement.close();
|
||||
} catch (SQLException e) {
|
||||
log.error(
|
||||
"Error closing river status update prepared statement",
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
||||
for (String functionName : statementMap.keySet()) {
|
||||
CallableStatement cs = statementMap.get(functionName);
|
||||
try {
|
||||
|
@ -1356,28 +1340,6 @@ public class PostTables {
|
|||
*
|
||||
*/
|
||||
public void executeBatchUpdates() {
|
||||
try {
|
||||
if (riverStatusUpdateStatement != null) {
|
||||
riverStatusUpdateStatement.execute();
|
||||
conn.commit();
|
||||
riverStatusUpdateStatement.close();
|
||||
riverStatusUpdateStatement = null;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.error("An error occurred storing river status updates", e);
|
||||
}
|
||||
|
||||
try {
|
||||
if (riverStatusInsertStatement != null) {
|
||||
riverStatusInsertStatement.execute();
|
||||
conn.commit();
|
||||
riverStatusInsertStatement.close();
|
||||
riverStatusInsertStatement = null;
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
log.error("An error occurred inserting river status values", e);
|
||||
}
|
||||
|
||||
for (String key : statementMap.keySet()) {
|
||||
CallableStatement cs = statementMap.get(key);
|
||||
try {
|
||||
|
|
|
@ -34,6 +34,8 @@ import java.nio.Buffer;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 5/7/08 875 bphillip Initial Creation.
|
||||
* Sep 01, 2014 3572 randerso Removed unnecessary @SuppressWarnings
|
||||
* to eliminate Java Warning
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,7 +62,6 @@ public class Grid2D<E> implements IGrid2D, Cloneable {
|
|||
* @param yDim
|
||||
* The height of the grid
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Grid2D(int xDim, int yDim) {
|
||||
this.xDim = xDim;
|
||||
this.yDim = yDim;
|
||||
|
|
|
@ -76,6 +76,7 @@ import java.nio.ByteBuffer;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 29, 2008 879 rbell Initial Creation.
|
||||
* Oct 22, 2008 1624 wdougherty Speed up translate method
|
||||
* Sep 01, 2014 3572 randerso Added clear(x,y) method
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -217,6 +218,23 @@ public class Grid2DBit extends Grid2DByte implements Cloneable {
|
|||
buffer.put(yDim * this.xdim + xDim, (byte) 1);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Sets a bit to 0.
|
||||
*
|
||||
* @param xDim
|
||||
* xDim x coordinate of bit to set
|
||||
* @param yDim
|
||||
* yDim y coordinate of bit to set
|
||||
*/
|
||||
@Override
|
||||
public void clear(int xDim, int yDim) {
|
||||
if (!isValid(xDim, yDim)) {
|
||||
throw new IllegalArgumentException("Dimensions are invalid");
|
||||
}
|
||||
buffer.put(yDim * this.xdim + xDim, (byte) 0);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Sets all bits to the given value.
|
||||
|
|
|
@ -1,449 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
|
||||
package com.raytheon.uf.common.dataplugin.gfe.grid;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
import jep.INumpyable;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
/**
|
||||
* Grid2D implementation for the boolean type
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 07/14/09 1995 bphillip Initial release
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1
|
||||
*/
|
||||
public class Grid2DBoolean implements IGrid2D, Cloneable, INumpyable,
|
||||
ISerializableObject {
|
||||
|
||||
/**
|
||||
* The data buffer, holding the grid's contents
|
||||
*/
|
||||
@DynamicSerializeElement
|
||||
protected IntBuffer buffer;
|
||||
|
||||
/**
|
||||
* Width of the grid.
|
||||
*/
|
||||
@DynamicSerializeElement
|
||||
protected int xdim;
|
||||
|
||||
/**
|
||||
* Height of the grid.
|
||||
*/
|
||||
@DynamicSerializeElement
|
||||
protected int ydim;
|
||||
|
||||
/**
|
||||
* Constructor for serialization only.
|
||||
*/
|
||||
public Grid2DBoolean() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for creating a two-dimensional grid containing ints. xDim and
|
||||
* yDim specify the size of the grid.
|
||||
*
|
||||
* @param xDim
|
||||
* @param yDim
|
||||
*/
|
||||
public Grid2DBoolean(int xDim, int yDim) {
|
||||
this(xDim, yDim, IntBuffer.allocate(xDim * yDim));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for creating an initialized two-dimensional grid containing
|
||||
* ints.
|
||||
*
|
||||
* xDim and yDim specify the size of the grid.
|
||||
*
|
||||
* aValue is the initial value
|
||||
*
|
||||
* @param xDim
|
||||
* @param yDim
|
||||
* @param aValue
|
||||
*/
|
||||
public Grid2DBoolean(int xDim, int yDim, boolean aValue) {
|
||||
this(xDim, yDim);
|
||||
setAllValues(aValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for creating a two-dimensional grid containing ints. xDim and
|
||||
* yDim specify the size of the grid. data is an array of initialization
|
||||
* data.
|
||||
*
|
||||
* @param xDim
|
||||
* @param yDim
|
||||
* @param data
|
||||
* array of initialization data
|
||||
*/
|
||||
public Grid2DBoolean(int xDim, int yDim, boolean[] data) {
|
||||
this(xDim, yDim);
|
||||
if (xDim * yDim != data.length) {
|
||||
throw new IllegalArgumentException(
|
||||
"Dimensions do not match data length (" + xDim + "," + yDim
|
||||
+ ") " + data.length);
|
||||
}
|
||||
int[] intData = new int[data.length];
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
if (data[i]) {
|
||||
intData[i] = 1;
|
||||
} else {
|
||||
intData[i] = 0;
|
||||
}
|
||||
}
|
||||
this.buffer.put(intData, 0, data.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for creating a two-dimensional grid containing ints. xDim and
|
||||
* yDim specify the size of the grid. data is a IntBuffer containing
|
||||
* initialization data.
|
||||
*
|
||||
* @param xDim
|
||||
* @param yDim
|
||||
* @param data
|
||||
* IntBuffer of initialization data
|
||||
*/
|
||||
public Grid2DBoolean(int xDim, int yDim, IntBuffer data) {
|
||||
if (xDim * yDim != data.limit()) {
|
||||
throw new IllegalArgumentException(
|
||||
"Dimensions do not match data length (" + xDim + "," + yDim
|
||||
+ ") " + data.limit());
|
||||
}
|
||||
this.xdim = xDim;
|
||||
this.ydim = yDim;
|
||||
this.buffer = data;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Copy constructor
|
||||
*
|
||||
* @param rhs
|
||||
* Grid2DBoolean to copy
|
||||
*/
|
||||
public Grid2DBoolean(Grid2DBoolean rhs) {
|
||||
this(rhs.xdim, rhs.ydim);
|
||||
this.buffer.put(rhs.buffer.array());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xDim
|
||||
* x coordinate of boolean to retrieve
|
||||
* @param yDim
|
||||
* y coordinate of boolean to retrieve
|
||||
* @return the retrieved boolean
|
||||
*/
|
||||
public boolean get(int xDim, int yDim) {
|
||||
if (!isValid(xDim, yDim)) {
|
||||
throw new IllegalArgumentException("Dimensions not valid");
|
||||
}
|
||||
return buffer.get(yDim * this.xdim + xDim) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param xDim
|
||||
* x coordinate of boolean to set
|
||||
* @param yDim
|
||||
* y coordinate of boolean to set
|
||||
* @param aValue
|
||||
* value of boolean to set
|
||||
*/
|
||||
public void set(int xDim, int yDim, boolean aValue) {
|
||||
if (!isValid(xDim, yDim)) {
|
||||
throw new IllegalArgumentException("Dimensions not valid");
|
||||
}
|
||||
if (aValue) {
|
||||
buffer.put(yDim * this.xdim + xDim, 1);
|
||||
} else {
|
||||
buffer.put(yDim * this.xdim + xDim, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Sets all booleans to the given value.
|
||||
*
|
||||
* @param aValue
|
||||
* value to set all booleans to.
|
||||
*/
|
||||
public void setAllValues(boolean aValue) {
|
||||
for (int i = 0; i < buffer.limit(); i++) {
|
||||
if (aValue) {
|
||||
buffer.put(i, 1);
|
||||
} else {
|
||||
buffer.put(i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return this.xdim > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(int x, int y) {
|
||||
return (x < xdim && y < ydim && x >= 0 && y >= 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* The data buffer is cleared.
|
||||
*/
|
||||
public void clear() {
|
||||
for (int i = 0; i < buffer.limit(); i++) {
|
||||
buffer.put(i, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a particular coordinate to 0
|
||||
*
|
||||
* @param x
|
||||
* x coordinate to clear
|
||||
* @param y
|
||||
* y coordinate to clear
|
||||
*/
|
||||
public void clear(int x, int y) {
|
||||
buffer.put(y * xdim + x, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Translates the set booleans in this object by the amount specified in
|
||||
* deltaCoord and returns a new Grid2DBoolean.
|
||||
*
|
||||
* @param deltaCoord
|
||||
* coordinate representing the translation from each boolean's
|
||||
* origin
|
||||
* @return the resulting translation
|
||||
*/
|
||||
public Grid2DBoolean translate(Point deltaCoord) {
|
||||
// make another Grid2DBoolean
|
||||
Grid2DBoolean rVal = new Grid2DBoolean(this.xdim, this.ydim);
|
||||
|
||||
for (int x = 0; x < this.xdim; x++) {
|
||||
for (int y = 0; y < this.ydim; y++) {
|
||||
if (rVal.isValid(x + deltaCoord.x, y + deltaCoord.y)) {
|
||||
rVal.set(x + deltaCoord.x, y + deltaCoord.y, this.get(x, y));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rVal;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Translates this Grid2DBoolean by the amount specified. Returns a
|
||||
* reference to this object.
|
||||
*
|
||||
* Uses translate() to translate the booleans, and then assigns the result
|
||||
* to this object using the assignment operator.
|
||||
*
|
||||
* @param deltaCoord
|
||||
* coordinate representing the translation from each boolean's
|
||||
* origin
|
||||
* @return this Grid2DBoolean after the translation
|
||||
*/
|
||||
public Grid2DBoolean translateMe(Point deltaCoord) {
|
||||
Grid2DBoolean t = translate(deltaCoord);
|
||||
this.buffer = t.buffer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IntBuffer getBuffer() {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXdim() {
|
||||
return xdim;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getYdim() {
|
||||
return ydim;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getGridSize() {
|
||||
return new Point(xdim, ydim);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Grid2DBoolean subGrid(int minX, int minY, int maxX, int maxY) {
|
||||
Grid2DBoolean rVal = new Grid2DBoolean(maxX + 1 - minX, maxY + 1 - minY);
|
||||
for (int y = minY; y < maxY + 1; y++) {
|
||||
for (int x = minX; x < maxX + 1; x++) {
|
||||
boolean val = this.get(x, y);
|
||||
if (val) {
|
||||
rVal.buffer.put(1);
|
||||
} else {
|
||||
rVal.buffer.put(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof Grid2DBoolean)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Grid2DBoolean rhs = (Grid2DBoolean) obj;
|
||||
|
||||
if (rhs == this) {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean rVal = true;
|
||||
|
||||
if (this.xdim == rhs.xdim && this.ydim == rhs.ydim) {
|
||||
for (int i = 0; i < this.buffer.limit(); i++) {
|
||||
if (this.buffer.get(i) != rhs.buffer.get(i)) {
|
||||
rVal = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rVal = false;
|
||||
}
|
||||
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Grid2DBoolean clone() throws CloneNotSupportedException {
|
||||
Grid2DBoolean rVal = new Grid2DBoolean(this);
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyWithMask(IGrid2D sourceGrid, Grid2DBit maskGrid) {
|
||||
if (!(sourceGrid instanceof Grid2DBoolean)) {
|
||||
throw new IllegalArgumentException(
|
||||
"The input source grid must be of type Grid2DBoolean");
|
||||
}
|
||||
|
||||
Grid2DBoolean sourceGrid2DBoolean = (Grid2DBoolean) sourceGrid;
|
||||
|
||||
if (this.xdim != sourceGrid2DBoolean.xdim || this.xdim != maskGrid.xdim
|
||||
|| this.ydim != sourceGrid2DBoolean.ydim
|
||||
|| this.ydim != maskGrid.ydim) {
|
||||
throw new IllegalArgumentException(
|
||||
"This grid, the input grid, and the input mask grid must have equal dimensions");
|
||||
}
|
||||
|
||||
for (int i = 0; i < this.buffer.limit(); i++) {
|
||||
if (maskGrid.buffer.get(i) != 0) {
|
||||
this.buffer.put(i, sourceGrid2DBoolean.buffer.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setAllOfValue(boolean oldValue, boolean newValue) {
|
||||
for (int i = 0; i < buffer.limit(); i++) {
|
||||
if ((this.buffer.get(i) > 0 && oldValue)
|
||||
|| (this.buffer.get(i) == 0 && !oldValue)) {
|
||||
if (newValue) {
|
||||
this.buffer.put(i, 1);
|
||||
} else {
|
||||
this.buffer.put(i, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String rVal = "";
|
||||
|
||||
rVal += xdim + "X" + ydim + "\n[\n";
|
||||
for (int y = 0; y < ydim; y++) {
|
||||
for (int x = 0; x < xdim; x++) {
|
||||
rVal += this.get(x, y) + (x + 1 == xdim ? "" : ",");
|
||||
}
|
||||
rVal += "\n";
|
||||
}
|
||||
rVal += "]";
|
||||
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getNumpy() {
|
||||
return new Object[] { buffer.array() };
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumpyX() {
|
||||
return xdim;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getNumpyY() {
|
||||
return ydim;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dim
|
||||
* the xDim to set
|
||||
*/
|
||||
public void setXdim(int dim) {
|
||||
xdim = dim;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dim
|
||||
* the yDim to set
|
||||
*/
|
||||
public void setYdim(int dim) {
|
||||
ydim = dim;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param buffer
|
||||
* the buffer to set
|
||||
*/
|
||||
public void setBuffer(IntBuffer buffer) {
|
||||
this.buffer = buffer;
|
||||
}
|
||||
|
||||
}
|
|
@ -26,7 +26,6 @@ import java.util.Arrays;
|
|||
|
||||
import jep.INumpyable;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
@ -41,6 +40,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 30, 2008 879 rbell Initial Creation.
|
||||
* Oct 22, 2008 1624 wdougherty Speed up translate method
|
||||
* Sep 01, 2014 3572 randerso Changed getNumpy to use getBytes()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,8 +48,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
public class Grid2DByte implements IGrid2D, Cloneable, INumpyable,
|
||||
ISerializableObject {
|
||||
public class Grid2DByte implements IGrid2D, Cloneable, INumpyable {
|
||||
|
||||
/**
|
||||
* The data buffer, holding the grid's contents
|
||||
|
@ -311,14 +310,17 @@ public class Grid2DByte implements IGrid2D, Cloneable, INumpyable,
|
|||
return buffer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXdim() {
|
||||
return xdim;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getYdim() {
|
||||
return ydim;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getGridSize() {
|
||||
return new Point(xdim, ydim);
|
||||
}
|
||||
|
@ -415,7 +417,7 @@ public class Grid2DByte implements IGrid2D, Cloneable, INumpyable,
|
|||
|
||||
@Override
|
||||
public Object[] getNumpy() {
|
||||
return new Object[] { buffer.array() };
|
||||
return new Object[] { getBytes() };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.nio.FloatBuffer;
|
|||
|
||||
import jep.INumpyable;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -38,6 +37,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 30, 2008 879 rbell Initial Creation.
|
||||
* Sep 01, 2014 3572 randerso Changed getNumpy to use getFloats()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -45,8 +45,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
public class Grid2DFloat implements IGrid2D, Cloneable, INumpyable,
|
||||
ISerializableObject {
|
||||
public class Grid2DFloat implements IGrid2D, Cloneable, INumpyable {
|
||||
|
||||
/**
|
||||
* The data buffer, holding the grid's contents
|
||||
|
@ -321,14 +320,17 @@ public class Grid2DFloat implements IGrid2D, Cloneable, INumpyable,
|
|||
this.buffer.put(other.getBuffer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXdim() {
|
||||
return xdim;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getYdim() {
|
||||
return ydim;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getGridSize() {
|
||||
return new Point(xdim, ydim);
|
||||
}
|
||||
|
@ -426,7 +428,7 @@ public class Grid2DFloat implements IGrid2D, Cloneable, INumpyable,
|
|||
|
||||
@Override
|
||||
public Object[] getNumpy() {
|
||||
return new Object[] { buffer.array() };
|
||||
return new Object[] { getFloats() };
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,6 +39,7 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
* Feb 27, 2013 #1447 dgilling Re-factor based on PythonPathIncludeUtil.
|
||||
* Mar 11, 2013 #1759 dgilling Add method getGfeConfigLF().
|
||||
* Sep 16, 2013 #1759 dgilling Move tests and autotests to GfeCavePyIncludeUtil.
|
||||
* Aug 22, 2014 3500 bclement added python path in getConfigIncludePath()
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -287,6 +288,7 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
}
|
||||
|
||||
public static String getConfigIncludePath(boolean includeUser) {
|
||||
String pythonPath = GfePyIncludeUtil.getCommonPythonIncludePath();
|
||||
String baseDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.BASE), CONFIG);
|
||||
String siteDir = getPath(PATH_MANAGER.getContext(
|
||||
|
@ -295,9 +297,10 @@ public class GfePyIncludeUtil extends PythonIncludePathUtil {
|
|||
String userDir = getPath(PATH_MANAGER.getContext(
|
||||
LocalizationType.CAVE_STATIC, LocalizationLevel.USER),
|
||||
CONFIG);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir);
|
||||
return PyUtil.buildJepIncludePath(userDir, siteDir, baseDir,
|
||||
pythonPath);
|
||||
} else {
|
||||
return PyUtil.buildJepIncludePath(siteDir, baseDir);
|
||||
return PyUtil.buildJepIncludePath(siteDir, baseDir, pythonPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package com.raytheon.uf.common.dataplugin.gfe.sample;
|
||||
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* Contains the identifier to uniquely identify a SampleData set.
|
||||
|
@ -29,7 +28,8 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 14, 2008 879 rbell Initial creation
|
||||
* Apr 14, 2008 879 rbell Initial creation
|
||||
* Sep 15, 2014 #3592 randerso Code cleanup, JavaDoc improvement
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -37,7 +37,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SampleId implements Cloneable, ISerializableObject {
|
||||
public class SampleId implements Cloneable {
|
||||
|
||||
private String name;
|
||||
|
||||
|
@ -52,8 +52,13 @@ public class SampleId implements Cloneable, ISerializableObject {
|
|||
this((String) null);
|
||||
}
|
||||
|
||||
public SampleId(String aName) {
|
||||
this(aName, false, LocalizationLevel.UNKNOWN);
|
||||
/**
|
||||
* Constructor taking the name to uniquely identify this sample data.
|
||||
*
|
||||
* @param name
|
||||
*/
|
||||
public SampleId(String name) {
|
||||
this(name, false, LocalizationLevel.UNKNOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,11 +69,10 @@ public class SampleId implements Cloneable, ISerializableObject {
|
|||
* @param protect
|
||||
* @param access
|
||||
*/
|
||||
public SampleId(final String aName, boolean aProtect,
|
||||
LocalizationLevel anAccess) {
|
||||
this.name = aName;
|
||||
this.protect = aProtect;
|
||||
this.access = anAccess;
|
||||
public SampleId(final String name, boolean protect, LocalizationLevel access) {
|
||||
this.name = name;
|
||||
this.protect = protect;
|
||||
this.access = access;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,11 +122,11 @@ public class SampleId implements Cloneable, ISerializableObject {
|
|||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
result = (prime * result)
|
||||
+ ((this.access == null) ? 0 : this.access.hashCode());
|
||||
result = prime * result
|
||||
result = (prime * result)
|
||||
+ ((this.name == null) ? 0 : this.name.hashCode());
|
||||
result = prime * result + (this.protect ? 1231 : 1237);
|
||||
result = (prime * result) + (this.protect ? 1231 : 1237);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,31 @@
|
|||
</contourStyle>
|
||||
</styleRule>
|
||||
|
||||
<!-- HRRR -->
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>MaxWHRRR</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits>kts</displayUnits>
|
||||
<contourLabeling labelSpacing="4">
|
||||
<increment>10</increment>
|
||||
</contourLabeling>
|
||||
</contourStyle>
|
||||
</styleRule>
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
<parameter>CPOFP</parameter>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits>%</displayUnits>
|
||||
<contourLabeling labelSpacing="4">
|
||||
<values>0 10 20 30 40 50 60 70 80 90 100</values>
|
||||
</contourLabeling>
|
||||
</contourStyle>
|
||||
</styleRule>
|
||||
|
||||
<!--
|
||||
* GH, GHxSM, zAGL
|
||||
dam | 0.1 | 0.0 | 4 | i4 | |..|8000F0FF| | 0 | 50
|
||||
|
@ -3978,6 +4003,7 @@ kts | 1.0 | 0.0 | 4 | | |..|8000F0FF|,400,0.5,,0 | 8 | \
|
|||
<creatingEntity>HiResW-ARW-AK</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-PR</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-SJU</creatingEntity>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits label="g/Kg/12hr">((g/kg)/h*12)*-1.0</displayUnits>
|
||||
|
@ -4096,6 +4122,7 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
|
|||
<creatingEntity>HiResW-ARW-AK</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-PR</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-SJU</creatingEntity>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
</paramLevelMatches>
|
||||
<contourStyle>
|
||||
<displayUnits label="-ubar/s">(Pa/s)*-0.1</displayUnits>
|
||||
|
@ -4116,6 +4143,7 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
|
|||
<creatingEntity>HiResW-ARW-AK</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-PR</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-SJU</creatingEntity>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
<parameter>AV</parameter>
|
||||
<parameter>RV</parameter>
|
||||
<parameter>geoVort</parameter>
|
||||
|
@ -4143,6 +4171,7 @@ in | .03937 | 0 | 4 | | |..|8000F0FF| | 16 | \
|
|||
<creatingEntity>HiResW-ARW-AK</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-PR</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-SJU</creatingEntity>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
<parameter>VAdv</parameter>
|
||||
<parameter>dVAdv</parameter>
|
||||
<parameter>PIVA</parameter>
|
||||
|
|
|
@ -50,6 +50,39 @@
|
|||
<displayUnits>ft</displayUnits>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
|
||||
<!-- HRRR -->
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<parameter>MaxWHRRR</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>kts</displayUnits>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
<styleRule>
|
||||
<paramLevelMatches>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
<parameter>CPOFP</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<interpolate>false</interpolate>
|
||||
<displayUnits>%</displayUnits>
|
||||
<range scale="LINEAR">
|
||||
<minValue>-50</minValue>
|
||||
<maxValue>100</maxValue>
|
||||
</range>
|
||||
<defaultColormap>Grid/gridded data</defaultColormap>
|
||||
<dataMapping>
|
||||
<entry pixelValue="-50.0" operator="=" label="" />
|
||||
<entry pixelValue="0" operator=">" displayValue='0.0' />
|
||||
<entry pixelValue="25" operator=">" displayValue='25.0' />
|
||||
<entry pixelValue="50" operator=">" displayValue='50.0' />
|
||||
<entry pixelValue="75" operator=">" displayValue='75.0' />
|
||||
</dataMapping>
|
||||
</imageStyle>
|
||||
</styleRule>
|
||||
<!--
|
||||
* GH, GHxSM, Topo, zAGL
|
||||
km | 0.001 | 0.0 | 0 | 1 | | | 29 | -1 | 0.1
|
||||
|
@ -588,7 +621,7 @@
|
|||
<parameter>DpTerranl</parameter>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits>F</displayUnits>
|
||||
<displayUnits label="F">°R</displayUnits>
|
||||
<range scale="LINEAR">
|
||||
<minValue>-4</minValue>
|
||||
<maxValue>20</maxValue>
|
||||
|
@ -4472,6 +4505,7 @@
|
|||
<creatingEntity>HiResW-ARW-AK</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-PR</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-SJU</creatingEntity>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits label="g/kg/12hr">((g/kg)/(h*12))*-0.001</displayUnits>
|
||||
|
@ -4846,6 +4880,7 @@
|
|||
<creatingEntity>HiResW-ARW-AK</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-PR</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-SJU</creatingEntity>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
</paramLevelMatches>
|
||||
<imageStyle>
|
||||
<displayUnits label="-ubar/s">(Pa/s)*-0.1</displayUnits>
|
||||
|
@ -4871,6 +4906,7 @@
|
|||
<creatingEntity>HiResW-ARW-AK</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-PR</creatingEntity>
|
||||
<creatingEntity>HiResW-ARW-SJU</creatingEntity>
|
||||
<creatingEntity>HRRR</creatingEntity>
|
||||
<parameter>AV</parameter>
|
||||
<parameter>Tdef</parameter>
|
||||
<parameter>geoVort</parameter>
|
||||
|
|
|
@ -0,0 +1,260 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<colorMap xmlns:ns2="group" xmlns:ns3="http://www.example.org/productType">
|
||||
<!-- this is a converted legacy colomap - dec2012 naming -->
|
||||
<color r="0.0" g="0.0" b="0.0" a="0.0"/>
|
||||
<color r="0.000000" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.000000" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.580392" g="0.607843" b="0.709804" a="1.0"/>
|
||||
<color r="0.572549" g="0.603922" b="0.709804" a="1.0"/>
|
||||
<color r="0.560784" g="0.596078" b="0.705882" a="1.0"/>
|
||||
<color r="0.552941" g="0.588235" b="0.705882" a="1.0"/>
|
||||
<color r="0.541176" g="0.580392" b="0.701961" a="1.0"/>
|
||||
<color r="0.533333" g="0.572549" b="0.701961" a="1.0"/>
|
||||
<color r="0.521569" g="0.564706" b="0.698039" a="1.0"/>
|
||||
<color r="0.513725" g="0.556863" b="0.694118" a="1.0"/>
|
||||
<color r="0.501961" g="0.552941" b="0.694118" a="1.0"/>
|
||||
<color r="0.494118" g="0.545098" b="0.690196" a="1.0"/>
|
||||
<color r="0.482353" g="0.537255" b="0.690196" a="1.0"/>
|
||||
<color r="0.470588" g="0.529412" b="0.686275" a="1.0"/>
|
||||
<color r="0.462745" g="0.521569" b="0.686275" a="1.0"/>
|
||||
<color r="0.450980" g="0.513725" b="0.682353" a="1.0"/>
|
||||
<color r="0.443137" g="0.505882" b="0.678431" a="1.0"/>
|
||||
<color r="0.431373" g="0.498039" b="0.678431" a="1.0"/>
|
||||
<color r="0.423529" g="0.494118" b="0.674510" a="1.0"/>
|
||||
<color r="0.411765" g="0.486275" b="0.674510" a="1.0"/>
|
||||
<color r="0.403922" g="0.478431" b="0.670588" a="1.0"/>
|
||||
<color r="0.392157" g="0.470588" b="0.666667" a="1.0"/>
|
||||
<color r="0.384314" g="0.462745" b="0.666667" a="1.0"/>
|
||||
<color r="0.372549" g="0.454902" b="0.662745" a="1.0"/>
|
||||
<color r="0.360784" g="0.447059" b="0.662745" a="1.0"/>
|
||||
<color r="0.352941" g="0.439216" b="0.658824" a="1.0"/>
|
||||
<color r="0.341176" g="0.435294" b="0.658824" a="1.0"/>
|
||||
<color r="0.333333" g="0.427451" b="0.654902" a="1.0"/>
|
||||
<color r="0.321569" g="0.419608" b="0.650980" a="1.0"/>
|
||||
<color r="0.313725" g="0.411765" b="0.650980" a="1.0"/>
|
||||
<color r="0.301961" g="0.403922" b="0.647059" a="1.0"/>
|
||||
<color r="0.294118" g="0.396078" b="0.647059" a="1.0"/>
|
||||
<color r="0.270588" g="0.380392" b="0.639216" a="1.0"/>
|
||||
<color r="0.270588" g="0.392157" b="0.639216" a="1.0"/>
|
||||
<color r="0.274510" g="0.407843" b="0.643137" a="1.0"/>
|
||||
<color r="0.278431" g="0.419608" b="0.643137" a="1.0"/>
|
||||
<color r="0.278431" g="0.435294" b="0.647059" a="1.0"/>
|
||||
<color r="0.282353" g="0.450980" b="0.647059" a="1.0"/>
|
||||
<color r="0.286275" g="0.462745" b="0.650980" a="1.0"/>
|
||||
<color r="0.290196" g="0.478431" b="0.654902" a="1.0"/>
|
||||
<color r="0.290196" g="0.494118" b="0.654902" a="1.0"/>
|
||||
<color r="0.294118" g="0.505882" b="0.658824" a="1.0"/>
|
||||
<color r="0.298039" g="0.521569" b="0.658824" a="1.0"/>
|
||||
<color r="0.298039" g="0.537255" b="0.662745" a="1.0"/>
|
||||
<color r="0.301961" g="0.549020" b="0.666667" a="1.0"/>
|
||||
<color r="0.305882" g="0.564706" b="0.666667" a="1.0"/>
|
||||
<color r="0.309804" g="0.580392" b="0.670588" a="1.0"/>
|
||||
<color r="0.309804" g="0.592157" b="0.670588" a="1.0"/>
|
||||
<color r="0.313725" g="0.607843" b="0.674510" a="1.0"/>
|
||||
<color r="0.317647" g="0.623529" b="0.678431" a="1.0"/>
|
||||
<color r="0.317647" g="0.635294" b="0.678431" a="1.0"/>
|
||||
<color r="0.321569" g="0.650980" b="0.682353" a="1.0"/>
|
||||
<color r="0.325490" g="0.666667" b="0.682353" a="1.0"/>
|
||||
<color r="0.329412" g="0.678431" b="0.686275" a="1.0"/>
|
||||
<color r="0.329412" g="0.694118" b="0.690196" a="1.0"/>
|
||||
<color r="0.333333" g="0.709804" b="0.690196" a="1.0"/>
|
||||
<color r="0.337255" g="0.721569" b="0.694118" a="1.0"/>
|
||||
<color r="0.337255" g="0.737255" b="0.694118" a="1.0"/>
|
||||
<color r="0.341176" g="0.752941" b="0.698039" a="1.0"/>
|
||||
<color r="0.345098" g="0.764706" b="0.701961" a="1.0"/>
|
||||
<color r="0.349020" g="0.780392" b="0.701961" a="1.0"/>
|
||||
<color r="0.349020" g="0.796078" b="0.705882" a="1.0"/>
|
||||
<color r="0.352941" g="0.807843" b="0.705882" a="1.0"/>
|
||||
<color r="0.360784" g="0.839216" b="0.713725" a="1.0"/>
|
||||
<color r="0.356863" g="0.831373" b="0.701961" a="1.0"/>
|
||||
<color r="0.349020" g="0.823529" b="0.686275" a="1.0"/>
|
||||
<color r="0.341176" g="0.811765" b="0.674510" a="1.0"/>
|
||||
<color r="0.337255" g="0.803922" b="0.658824" a="1.0"/>
|
||||
<color r="0.329412" g="0.792157" b="0.647059" a="1.0"/>
|
||||
<color r="0.321569" g="0.784314" b="0.631373" a="1.0"/>
|
||||
<color r="0.317647" g="0.772549" b="0.619608" a="1.0"/>
|
||||
<color r="0.309804" g="0.764706" b="0.603922" a="1.0"/>
|
||||
<color r="0.301961" g="0.752941" b="0.592157" a="1.0"/>
|
||||
<color r="0.298039" g="0.745098" b="0.576471" a="1.0"/>
|
||||
<color r="0.290196" g="0.737255" b="0.564706" a="1.0"/>
|
||||
<color r="0.282353" g="0.725490" b="0.549020" a="1.0"/>
|
||||
<color r="0.278431" g="0.717647" b="0.537255" a="1.0"/>
|
||||
<color r="0.270588" g="0.705882" b="0.521569" a="1.0"/>
|
||||
<color r="0.262745" g="0.698039" b="0.509804" a="1.0"/>
|
||||
<color r="0.258824" g="0.686275" b="0.494118" a="1.0"/>
|
||||
<color r="0.250980" g="0.678431" b="0.482353" a="1.0"/>
|
||||
<color r="0.243137" g="0.666667" b="0.466667" a="1.0"/>
|
||||
<color r="0.239216" g="0.658824" b="0.454902" a="1.0"/>
|
||||
<color r="0.231373" g="0.650980" b="0.439216" a="1.0"/>
|
||||
<color r="0.223529" g="0.639216" b="0.427451" a="1.0"/>
|
||||
<color r="0.219608" g="0.631373" b="0.411765" a="1.0"/>
|
||||
<color r="0.211765" g="0.619608" b="0.400000" a="1.0"/>
|
||||
<color r="0.203922" g="0.611765" b="0.384314" a="1.0"/>
|
||||
<color r="0.200000" g="0.600000" b="0.372549" a="1.0"/>
|
||||
<color r="0.192157" g="0.592157" b="0.356863" a="1.0"/>
|
||||
<color r="0.184314" g="0.580392" b="0.345098" a="1.0"/>
|
||||
<color r="0.180392" g="0.572549" b="0.329412" a="1.0"/>
|
||||
<color r="0.172549" g="0.560784" b="0.317647" a="1.0"/>
|
||||
<color r="0.164706" g="0.552941" b="0.301961" a="1.0"/>
|
||||
<color r="0.160784" g="0.545098" b="0.290196" a="1.0"/>
|
||||
<color r="0.152941" g="0.533333" b="0.274510" a="1.0"/>
|
||||
<color r="0.145098" g="0.525490" b="0.262745" a="1.0"/>
|
||||
<color r="0.141176" g="0.513725" b="0.247059" a="1.0"/>
|
||||
<color r="0.133333" g="0.505882" b="0.235294" a="1.0"/>
|
||||
<color r="0.125490" g="0.494118" b="0.219608" a="1.0"/>
|
||||
<color r="0.121569" g="0.486275" b="0.207843" a="1.0"/>
|
||||
<color r="0.113725" g="0.474510" b="0.192157" a="1.0"/>
|
||||
<color r="0.105882" g="0.466667" b="0.180392" a="1.0"/>
|
||||
<color r="0.101961" g="0.458824" b="0.164706" a="1.0"/>
|
||||
<color r="0.094118" g="0.447059" b="0.152941" a="1.0"/>
|
||||
<color r="0.086275" g="0.439216" b="0.137255" a="1.0"/>
|
||||
<color r="0.082353" g="0.427451" b="0.125490" a="1.0"/>
|
||||
<color r="0.074510" g="0.419608" b="0.109804" a="1.0"/>
|
||||
<color r="0.066667" g="0.407843" b="0.098039" a="1.0"/>
|
||||
<color r="0.062745" g="0.400000" b="0.082353" a="1.0"/>
|
||||
<color r="0.054902" g="0.388235" b="0.070588" a="1.0"/>
|
||||
<color r="0.039216" g="0.368627" b="0.039216" a="1.0"/>
|
||||
<color r="0.082353" g="0.388235" b="0.039216" a="1.0"/>
|
||||
<color r="0.129412" g="0.407843" b="0.039216" a="1.0"/>
|
||||
<color r="0.176471" g="0.431373" b="0.035294" a="1.0"/>
|
||||
<color r="0.219608" g="0.450980" b="0.035294" a="1.0"/>
|
||||
<color r="0.266667" g="0.474510" b="0.031373" a="1.0"/>
|
||||
<color r="0.313725" g="0.494118" b="0.031373" a="1.0"/>
|
||||
<color r="0.356863" g="0.517647" b="0.027451" a="1.0"/>
|
||||
<color r="0.403922" g="0.537255" b="0.027451" a="1.0"/>
|
||||
<color r="0.450980" g="0.556863" b="0.023529" a="1.0"/>
|
||||
<color r="0.494118" g="0.580392" b="0.023529" a="1.0"/>
|
||||
<color r="0.541176" g="0.600000" b="0.019608" a="1.0"/>
|
||||
<color r="0.588235" g="0.623529" b="0.019608" a="1.0"/>
|
||||
<color r="0.631373" g="0.643137" b="0.015686" a="1.0"/>
|
||||
<color r="0.678431" g="0.666667" b="0.015686" a="1.0"/>
|
||||
<color r="0.725490" g="0.686275" b="0.011765" a="1.0"/>
|
||||
<color r="0.768627" g="0.705882" b="0.011765" a="1.0"/>
|
||||
<color r="0.815686" g="0.729412" b="0.007843" a="1.0"/>
|
||||
<color r="0.862745" g="0.749020" b="0.007843" a="1.0"/>
|
||||
<color r="0.905882" g="0.772549" b="0.003922" a="1.0"/>
|
||||
<color r="0.949020" g="0.776471" b="0.000000" a="1.0"/>
|
||||
<color r="0.949020" g="0.768627" b="0.000000" a="1.0"/>
|
||||
<color r="0.949020" g="0.756863" b="0.000000" a="1.0"/>
|
||||
<color r="0.952941" g="0.745098" b="0.000000" a="1.0"/>
|
||||
<color r="0.952941" g="0.737255" b="0.000000" a="1.0"/>
|
||||
<color r="0.956863" g="0.725490" b="0.000000" a="1.0"/>
|
||||
<color r="0.956863" g="0.713725" b="0.000000" a="1.0"/>
|
||||
<color r="0.960784" g="0.705882" b="0.000000" a="1.0"/>
|
||||
<color r="0.960784" g="0.694118" b="0.000000" a="1.0"/>
|
||||
<color r="0.964706" g="0.682353" b="0.000000" a="1.0"/>
|
||||
<color r="0.964706" g="0.674510" b="0.000000" a="1.0"/>
|
||||
<color r="0.968627" g="0.662745" b="0.000000" a="1.0"/>
|
||||
<color r="0.968627" g="0.650980" b="0.000000" a="1.0"/>
|
||||
<color r="0.972549" g="0.643137" b="0.000000" a="1.0"/>
|
||||
<color r="0.972549" g="0.631373" b="0.000000" a="1.0"/>
|
||||
<color r="0.972549" g="0.619608" b="0.000000" a="1.0"/>
|
||||
<color r="0.976471" g="0.611765" b="0.000000" a="1.0"/>
|
||||
<color r="0.976471" g="0.600000" b="0.000000" a="1.0"/>
|
||||
<color r="0.980392" g="0.588235" b="0.000000" a="1.0"/>
|
||||
<color r="0.980392" g="0.580392" b="0.000000" a="1.0"/>
|
||||
<color r="0.984314" g="0.568627" b="0.000000" a="1.0"/>
|
||||
<color r="0.984314" g="0.556863" b="0.000000" a="1.0"/>
|
||||
<color r="0.988235" g="0.549020" b="0.000000" a="1.0"/>
|
||||
<color r="0.988235" g="0.537255" b="0.000000" a="1.0"/>
|
||||
<color r="0.992157" g="0.525490" b="0.000000" a="1.0"/>
|
||||
<color r="0.992157" g="0.517647" b="0.000000" a="1.0"/>
|
||||
<color r="0.996078" g="0.505882" b="0.000000" a="1.0"/>
|
||||
<color r="0.996078" g="0.494118" b="0.000000" a="1.0"/>
|
||||
<color r="0.968627" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.952941" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.937255" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.921569" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.905882" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.886275" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.870588" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.854902" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.839216" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.823529" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.803922" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.788235" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.772549" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.756863" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.737255" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.721569" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.705882" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.690196" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.674510" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.654902" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.639216" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.623529" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.607843" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.588235" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.572549" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.556863" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.541176" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.525490" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.505882" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.490196" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.474510" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="0.458824" g="0.000000" b="0.000000" a="1.0"/>
|
||||
<color r="1.000000" g="1.000000" b="1.000000" a="1.0"/>
|
||||
<color r="1.000000" g="0.972549" b="1.000000" a="1.0"/>
|
||||
<color r="1.000000" g="0.941176" b="0.996078" a="1.0"/>
|
||||
<color r="1.000000" g="0.909804" b="0.992157" a="1.0"/>
|
||||
<color r="1.000000" g="0.878431" b="0.988235" a="1.0"/>
|
||||
<color r="1.000000" g="0.847059" b="0.984314" a="1.0"/>
|
||||
<color r="1.000000" g="0.815686" b="0.980392" a="1.0"/>
|
||||
<color r="1.000000" g="0.784314" b="0.976471" a="1.0"/>
|
||||
<color r="1.000000" g="0.752941" b="0.972549" a="1.0"/>
|
||||
<color r="1.000000" g="0.721569" b="0.968627" a="1.0"/>
|
||||
<color r="1.000000" g="0.690196" b="0.964706" a="1.0"/>
|
||||
<color r="1.000000" g="0.658824" b="0.960784" a="1.0"/>
|
||||
<color r="1.000000" g="0.627451" b="0.956863" a="1.0"/>
|
||||
<color r="1.000000" g="0.596078" b="0.952941" a="1.0"/>
|
||||
<color r="1.000000" g="0.564706" b="0.949020" a="1.0"/>
|
||||
<color r="1.000000" g="0.533333" b="0.945098" a="1.0"/>
|
||||
<color r="1.000000" g="0.501961" b="0.945098" a="1.0"/>
|
||||
<color r="1.000000" g="0.470588" b="0.941176" a="1.0"/>
|
||||
<color r="1.000000" g="0.439216" b="0.937255" a="1.0"/>
|
||||
<color r="1.000000" g="0.407843" b="0.933333" a="1.0"/>
|
||||
<color r="1.000000" g="0.376471" b="0.929412" a="1.0"/>
|
||||
<color r="1.000000" g="0.345098" b="0.925490" a="1.0"/>
|
||||
<color r="1.000000" g="0.313725" b="0.921569" a="1.0"/>
|
||||
<color r="1.000000" g="0.282353" b="0.917647" a="1.0"/>
|
||||
<color r="1.000000" g="0.250980" b="0.913725" a="1.0"/>
|
||||
<color r="1.000000" g="0.219608" b="0.909804" a="1.0"/>
|
||||
<color r="1.000000" g="0.188235" b="0.905882" a="1.0"/>
|
||||
<color r="1.000000" g="0.156863" b="0.901961" a="1.0"/>
|
||||
<color r="1.000000" g="0.125490" b="0.898039" a="1.0"/>
|
||||
<color r="1.000000" g="0.094118" b="0.894118" a="1.0"/>
|
||||
<color r="1.000000" g="0.062745" b="0.890196" a="1.0"/>
|
||||
<color r="0.701961" g="0.000000" b="1.000000" a="1.0"/>
|
||||
<color r="0.686275" g="0.000000" b="0.992157" a="1.0"/>
|
||||
<color r="0.666667" g="0.000000" b="0.984314" a="1.0"/>
|
||||
<color r="0.650980" g="0.000000" b="0.972549" a="1.0"/>
|
||||
<color r="0.631373" g="0.000000" b="0.964706" a="1.0"/>
|
||||
<color r="0.611765" g="0.000000" b="0.952941" a="1.0"/>
|
||||
<color r="0.596078" g="0.000000" b="0.945098" a="1.0"/>
|
||||
<color r="0.576471" g="0.000000" b="0.937255" a="1.0"/>
|
||||
<color r="0.556863" g="0.000000" b="0.925490" a="1.0"/>
|
||||
<color r="0.541176" g="0.000000" b="0.917647" a="1.0"/>
|
||||
<color r="0.521569" g="0.000000" b="0.905882" a="1.0"/>
|
||||
<color r="0.501961" g="0.000000" b="0.898039" a="1.0"/>
|
||||
<color r="0.486275" g="0.000000" b="0.890196" a="1.0"/>
|
||||
<color r="0.466667" g="0.000000" b="0.878431" a="1.0"/>
|
||||
<color r="0.447059" g="0.000000" b="0.870588" a="1.0"/>
|
||||
<color r="0.431373" g="0.000000" b="0.858824" a="1.0"/>
|
||||
<color r="0.411765" g="0.000000" b="0.850980" a="1.0"/>
|
||||
<color r="0.019608" g="0.925490" b="0.941176" a="1.0"/>
|
||||
<color r="0.019608" g="0.866667" b="0.878431" a="1.0"/>
|
||||
<color r="0.019608" g="0.803922" b="0.815686" a="1.0"/>
|
||||
<color r="0.015686" g="0.741176" b="0.752941" a="1.0"/>
|
||||
<color r="0.015686" g="0.682353" b="0.690196" a="1.0"/>
|
||||
<color r="0.015686" g="0.619608" b="0.627451" a="1.0"/>
|
||||
<color r="0.011765" g="0.556863" b="0.564706" a="1.0"/>
|
||||
<color r="0.011765" g="0.494118" b="0.501961" a="1.0"/>
|
||||
<color r="0.011765" g="0.435294" b="0.439216" a="1.0"/>
|
||||
<color r="0.007843" g="0.372549" b="0.376471" a="1.0"/>
|
||||
<color r="0.007843" g="0.309804" b="0.313725" a="1.0"/>
|
||||
<color r="0.007843" g="0.247059" b="0.250980" a="1.0"/>
|
||||
<color r="0.003922" g="0.188235" b="0.188235" a="1.0"/>
|
||||
<color r="0.003922" g="0.125490" b="0.125490" a="1.0"/>
|
||||
<color r="0.227451" g="0.403922" b="0.709804" a="1.0"/>
|
||||
<color r="1.0" g="1.0" b="1.0" a="1.0"/>
|
||||
</colorMap>
|
|
@ -54,6 +54,7 @@
|
|||
<blank />
|
||||
<srmSource />
|
||||
<srmMovement />
|
||||
<sails />
|
||||
</upperText>
|
||||
|
||||
<!-- Base Spectrum Width -->
|
||||
|
@ -398,4 +399,4 @@
|
|||
<gfmCount />
|
||||
</upperText>
|
||||
|
||||
</upperTextSet>
|
||||
</upperTextSet>
|
||||
|
|
|
@ -61,6 +61,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Apr 24, 2013 1943 jsanchez Marked areaConfig as Deprecated.
|
||||
* Oct 22, 2013 2361 njensen Removed ISerializableObject
|
||||
* Apr 28, 2014 3033 jsanchez Properly handled back up configuration (*.xml) files.
|
||||
* Aug 28, 2014 ASM #15658 D. Friedman Add marine zone watch wording option.
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -103,6 +104,9 @@ public class WarngenConfiguration {
|
|||
@XmlElement(name = "includedWatch")
|
||||
private String[] includedWatches;
|
||||
|
||||
@XmlElement
|
||||
private boolean includeMarineAreasInWatches;
|
||||
|
||||
@XmlElementWrapper(name = "durations")
|
||||
@XmlElement(name = "duration")
|
||||
private int[] durations;
|
||||
|
@ -392,6 +396,14 @@ public class WarngenConfiguration {
|
|||
return includedWatches;
|
||||
}
|
||||
|
||||
public boolean isIncludeMarineAreasInWatches() {
|
||||
return includeMarineAreasInWatches;
|
||||
}
|
||||
|
||||
public void setIncludeMarineAreasInWatches(boolean includeMarineAreasInWatches) {
|
||||
this.includeMarineAreasInWatches = includeMarineAreasInWatches;
|
||||
}
|
||||
|
||||
public boolean getEnableRestart() {
|
||||
return enableRestart;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
##### Evan Bookbinder 05-05-2013 handleClosesPoints and 3rd bullet changes (OVER & now)
|
||||
##### Evan Bookbinder 09-20-2013 Fixed rural area otherPoints in pathcast section, added rural phrase
|
||||
##### Qinglu Lin 03-17-2014 DR 16309. Updated inserttorwatches and insertsvrwatches.
|
||||
##### Qinglu Lin 05-21-2014 DR 16309. Updated inserttorwatches and insertsvrwatches by changing 'FOR##' to 'FOR ##'.
|
||||
##### Qinglu Lin 05-21-2014 DR 16309. Updated inserttorwatches and insertsvrwatches by changing 'FOR##' to 'FOR ##'.
|
||||
##### D. Friedman 08-28-2014 ASM #15658. Add marine watch wording.
|
||||
##### Qinglu Lin 08-29-2014 ASM #15551. Overhauled inserttorwatches and insertsvrwatches.
|
||||
####################################################################################################
|
||||
#*
|
||||
Mile Marker Test Code
|
||||
|
@ -189,94 +191,111 @@ ${drainage.name}##
|
|||
########END MACRO
|
||||
|
||||
#macro(inserttorwatches $watches $list $secondtimezone $dateUtil $timeFormat)
|
||||
#set($keys = [])
|
||||
#set($mymap = {})
|
||||
#set($tornadoWatches = [])
|
||||
#set($ALSO = "")
|
||||
|
||||
#foreach(${watch} in ${watches})
|
||||
#if(${watch.getPhenSig()} == 'TO.A')
|
||||
#set($key = ${watch.action} + ${watch.etn} + ${watch.startTime} + ${watch.endTime})
|
||||
#if (${list.contains(${keys}, $key)})
|
||||
#set($value = ${mymap.get($key)})
|
||||
#set($success = $tornadoWatches.add($watch))
|
||||
#end
|
||||
#end
|
||||
|
||||
#set($lastEtn = "")
|
||||
#set($lastEndTime = "")
|
||||
#foreach(${watch} in ${tornadoWatches})
|
||||
#if($lastEtn != "" && ${watch.etn} != ${lastEtn})
|
||||
. ##
|
||||
#end
|
||||
#set($endTime = ${watch.endTime})
|
||||
#if(${watch.etn} == ${lastEtn})
|
||||
#if(${endTime} == ${lastEndTime})
|
||||
...##
|
||||
#else
|
||||
#set($value = [])
|
||||
#set($success = $keys.add($key))
|
||||
...UNTIL ${dateUtil.format(${endTime}, ${timeFormat.plain}, 15, ${localtimezone})} FOR ##
|
||||
#end
|
||||
#set($success = $value.add($watch))
|
||||
#set($success = ${mymap.put($key,$value)})
|
||||
#else
|
||||
A TORNADO WATCH${ALSO} REMAINS IN EFFECT UNTIL ${dateUtil.format(${endTime}, ${timeFormat.plain}, 15, ${localtimezone})} FOR ##
|
||||
#set($ALSO = " ALSO")
|
||||
#end
|
||||
#end
|
||||
#set($torWatchAlso = "")
|
||||
#foreach(${key} in ${keys})
|
||||
#set($tornadoWatches = ${mymap.get($key)})
|
||||
#set($tornadoWatch = ${tornadoWatches.get(0)})
|
||||
A TORNADO WATCH ${torWatchAlso}REMAINS IN EFFECT UNTIL ${dateUtil.format(${tornadoWatch.endTime}, ${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
${dateUtil.period(${tornadoWatch.endTime},${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
#if(${secondtimezone})
|
||||
/${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${secondtimezone})}/##
|
||||
#end
|
||||
FOR ##
|
||||
#set($numPortions = ${list.size(${tornadoWatches})})
|
||||
#set($count = 0)
|
||||
#foreach(${watch} in ${tornadoWatches})
|
||||
#set($count = $count + 1)
|
||||
#if(!${watch.marineAreas})
|
||||
#areaFormat(${watch.partOfState} true false true)${watch.state}##
|
||||
#if($count == $numPortions - 1)
|
||||
AND ##
|
||||
#elseif($count < $numPortions)
|
||||
...##
|
||||
#else
|
||||
#formatMarineAreas(${watch.marineAreas})
|
||||
#end
|
||||
#set($lastEtn = ${watch.etn})
|
||||
#set($lastEndTime = ${watch.endTime})
|
||||
#end
|
||||
#set($torWatchAlso = "ALSO ")
|
||||
. ##
|
||||
#if(${lastEtn} != "")
|
||||
.
|
||||
#end
|
||||
|
||||
|
||||
#end
|
||||
########END MACRO
|
||||
|
||||
#macro(insertsvrwatches $watches $list $secondtimezone $dateUtil $timeFormat)
|
||||
#set($keys = [])
|
||||
#set($mymap = {})
|
||||
#set($svrWatches = [])
|
||||
#set($ALSO = "")
|
||||
|
||||
#foreach(${watch} in ${watches})
|
||||
#if(${watch.getPhenSig()} == 'SV.A')
|
||||
#set($key = ${watch.action} + ${watch.etn} + ${watch.startTime} + ${watch.endTime})
|
||||
#if (${list.contains(${keys}, $key)})
|
||||
#set($value = ${mymap.get($key)})
|
||||
#set($success = $svrWatches.add($watch))
|
||||
#end
|
||||
#end
|
||||
|
||||
#set($lastEtn = "")
|
||||
#set($lastEndTime = "")
|
||||
#foreach(${watch} in ${svrWatches})
|
||||
#if($lastEtn != "" && ${watch.etn} != ${lastEtn})
|
||||
. ##
|
||||
#end
|
||||
#set($endTime = ${watch.endTime})
|
||||
#if(${watch.etn} == ${lastEtn})
|
||||
#if(${endTime} == ${lastEndTime})
|
||||
...##
|
||||
#else
|
||||
#set($value = [])
|
||||
#set($success = $keys.add($key))
|
||||
...UNTIL ${dateUtil.format(${endTime}, ${timeFormat.plain}, 15, ${localtimezone})} FOR ##
|
||||
#end
|
||||
#set($success = $value.add($watch))
|
||||
#set($success = ${mymap.put($key,$value)})
|
||||
#else
|
||||
A SEVERE THUNDERSTORM WATCH${ALSO} REMAINS IN EFFECT UNTIL ${dateUtil.format(${endTime}, ${timeFormat.plain}, 15, ${localtimezone})} FOR ##
|
||||
#set($ALSO = " ALSO")
|
||||
#end
|
||||
#end
|
||||
#set($svrWatchAlso = "")
|
||||
#foreach(${key} in ${keys})
|
||||
#set($severeWatches = ${mymap.get($key)})
|
||||
#set($svrWatch = ${severeWatches.get(0)})
|
||||
A SEVERE THUNDERSTORM WATCH ${svrWatchAlso}REMAINS IN EFFECT UNTIL ${dateUtil.format(${svrWatch.endTime}, ${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
${dateUtil.period(${svrWatch.endTime},${timeFormat.plain}, 15, ${localtimezone})}##
|
||||
#if(${secondtimezone})
|
||||
/${dateUtil.format(${watch.getEndTime()}, ${timeFormat.plain}, 15, ${secondtimezone})}/##
|
||||
#end
|
||||
FOR ##
|
||||
#set($numPortions = ${list.size(${severeWatches})})
|
||||
#set($count = 0)
|
||||
#foreach(${watch} in ${severeWatches})
|
||||
#set($count = $count + 1)
|
||||
#if(!${watch.marineAreas})
|
||||
#areaFormat(${watch.partOfState} true false true)${watch.state}##
|
||||
#if($count == $numPortions - 1)
|
||||
#else
|
||||
#formatMarineAreas(${watch.marineAreas})
|
||||
#end
|
||||
#set($lastEtn = ${watch.etn})
|
||||
#set($lastEndTime = ${watch.endTime})
|
||||
#end
|
||||
#if(${lastEtn} != "")
|
||||
.
|
||||
#end
|
||||
#end
|
||||
########END MACRO
|
||||
|
||||
#macro(formatMarineAreas $marineAreas)
|
||||
#set($macount = 0)
|
||||
#set($numMarineAreas = ${list.size(${marineAreas})})
|
||||
#foreach(${marineArea} in ${marineAreas})
|
||||
#set($macount = $macount + 1)
|
||||
#if(${marineArea}=="THE ADJACENT COASTAL WATERS" && $macount > 1)
|
||||
OTHER ADJACENT COASTAL WATERS##
|
||||
#else
|
||||
${marineArea}##
|
||||
#end
|
||||
#if($macount == $numMarineAreas - 1)
|
||||
AND ##
|
||||
#elseif($count < $numPortions)
|
||||
#elseif($macount < $numMarineAreas)
|
||||
...##
|
||||
#end
|
||||
#end
|
||||
#set($svrWatchAlso = "ALSO ")
|
||||
. ##
|
||||
#end
|
||||
|
||||
|
||||
#end
|
||||
########END
|
||||
########END MACRO
|
||||
|
||||
#macro(printcoords $coordinates $list)
|
||||
#set($count = 0)
|
||||
|
|
|
@ -58,6 +58,9 @@ turned on unless the corresponding .vm file is turned on in a given template's .
|
|||
<includedWatch>SV.A</includedWatch>
|
||||
</includedWatches>
|
||||
|
||||
<!-- Include references to marine zones for watches. See marineZoneWording.xml -->
|
||||
<includeMarineAreasInWatches>true</includeMarineAreasInWatches>
|
||||
|
||||
<!-- durations: the list of possible durations -->
|
||||
<defaultDuration>60</defaultDuration>
|
||||
<durations>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue