Merge branch 'omaha_16.1.1' into omaha_16.2.1

Conflicts:
	cave/com.raytheon.viz.gfe/localization/gfe/userPython/utilities/SmartScript.py
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/FormatterlauncherAction.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowProductScriptsDialog.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowPublishDialog.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/actions/ShowSendIscGridsDialog.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/core/DataManager.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductAreaComp.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/ProductEditorComp.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/dialogs/formatterlauncher/StoreTransmitDlg.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/perspective/GFEPerspectiveManager.java
	cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/textformatter/FormatterUtil.java
	cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenAction.java
	edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/grid/dataset/alias/gfeParamInfo.xml
	edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/config/gfe/serverConfig.py
	edexOsgi/com.raytheon.uf.edex.plugin.loctables/src/com/raytheon/uf/edex/plugin/loctables/ingest/LocationTablesIngest.java
	rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template

Change-Id: Ie790e3a9a0c3829655a5a798a2c8b6740d02be6c

Former-commit-id: 691ca66a6f15c3cfae1bd1c8990644951d68a46f
This commit is contained in:
Ron Anderson 2015-10-14 16:31:41 -05:00
commit d126af0f85
52 changed files with 3560 additions and 2654 deletions

View file

@ -27,7 +27,6 @@ import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@ -35,19 +34,16 @@ import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
import com.raytheon.uf.common.geospatial.SpatialException;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
import com.raytheon.uf.common.monitor.MonitorAreaUtils;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.AdjacentWfoMgr;
import com.raytheon.uf.common.monitor.data.CommonConfig;
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.viz.core.alerts.AlertMessage;
import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.IMonitor;
import com.raytheon.uf.viz.monitor.Monitor;
import com.raytheon.uf.viz.monitor.ObsMonitor;
@ -91,6 +87,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Sep 23, 2014 3356 njensen Remove unnecessary import
* Mar 09, 2014 3888 dhladky Stopped processing when dialogs are null or disposed.
* Sep 18, 2015 3873 skorolev Removed common definitions. Replaced deprecated NotificationMessage.
*
*
* </pre>
@ -139,34 +136,19 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
private final TableData stationTableData = new TableData(
CommonConfig.AppName.FOG);
/** All FOG's datauri start with this **/
private final String OBS = "fssobs";
/** List of fogAlg listeners **/
private final List<IFogResourceListener> fogResources = new ArrayList<IFogResourceListener>();
/** regex wild card filter **/
private final String wildCard = "[\\w\\(\\)\\-_:.]+";
/** Geometry of adjacent areas **/
private Geometry geoAdjAreas = null;
/** Data URI pattern for fog **/
private final Pattern fogPattern = Pattern.compile(DataURI.SEPARATOR + OBS
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard);
/**
* Private constructor, singleton
*/
private FogMonitor() {
pluginPatterns.add(fogPattern);
fogConfig = new FSSObsMonitorConfigurationManager(MonName.fog.name());
pluginPatterns.add(fssPattern);
fogConfig = FSSObsMonitorConfigurationManager.getInstance(MonName.fog);
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
obData.setThresholdMgr(FogThresholdMgr.getInstance());
createDataStructures();
processProductAtStartup();
obData.getZoneTableData();
readTableConfig(MonitorThresholdConfiguration.FOG_THRESHOLD_CONFIG);
}
@ -180,12 +162,8 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
if (monitor == null) {
monitor = new FogMonitor();
// Pre-populate dialog with an observations from DB
monitor.createDataStructures();
monitor.getAdjAreas();
monitor.processProductAtStartup(MonName.fog.name());
monitor.fireMonitorEvent(monitor);
}
return monitor;
}
@ -209,10 +187,8 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
// [Jan 21, 2010, zhao]
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
obData.setThresholdMgr(FogThresholdMgr.getInstance());
obsData = new ObsData();
algorithmData = new TreeMap<Date, Map<String, FOG_THREAT>>();
for (String zone : MonitoringArea.getPlatformMap().keySet()) {
obsData.addArea(zone, MonitoringArea.getPlatformMap().get(zone));
}
@ -251,7 +227,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
*/
@Override
public void processProductMessage(final AlertMessage filtered) {
if (fogPattern.matcher(filtered.dataURI).matches()) {
if (fssPattern.matcher(filtered.dataURI).matches()) {
processURI(filtered.dataURI, filtered);
}
}
@ -264,7 +240,6 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
* -- the xml configuration filename
*/
public void readTableConfig(String file) {
// TODO update for Maritime
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and stations list
try {
@ -594,35 +569,6 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
return null;
}
/**
* Gets adjacent areas.
*/
public void getAdjAreas() {
try {
this.geoAdjAreas = AdjacentWfoMgr.getAdjacentAreas(cwa);
} catch (SpatialException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
}
/**
* Gets geometry of adjacent areas.
*
* @return the geoAdjAreas
*/
public Geometry getGeoAdjAreas() {
return geoAdjAreas;
}
/**
* Sets the geoAdjAreas
*
* @param geoAdjAreas
*/
public void setGeoAdjAreas(Geometry geoAdjAreas) {
this.geoAdjAreas = geoAdjAreas;
}
/*
* (non-Javadoc)
*
@ -633,9 +579,6 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
@Override
protected void processAtStartup(ObReport report) {
obData.addReport(report);
String zone = findZone(report.getPlatformId());
getTableData().getArea(zone).addReport(report.getObservationTime(),
report);
}
/**
@ -663,5 +606,4 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
}
MonitoringArea.setPlatformMap(zones);
}
}

View file

@ -21,8 +21,6 @@ package com.raytheon.uf.viz.monitor.fog.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -42,6 +40,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.FogMonitor;
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
* May 20, 2014 3086 skorolev Cleaned code.
* Sep 04, 2014 3220 skorolev Removed "site".
* Sep 18, 2015 3873 skorolev Adjusted to AppName and removed areaConfigMgr.
*
* </pre>
*
@ -59,10 +58,7 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
*/
private FogThresholdMgr() {
super("DefaultFogDisplayThresholds.xml",
"DefaultFogMonitorThresholds.xml", AppName.FOG.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
"DefaultFogMonitorThresholds.xml", AppName.FOG);
init();
}
@ -75,7 +71,6 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
if (classInstance == null) {
classInstance = new FogThresholdMgr();
}
return classInstance;
}
@ -119,19 +114,4 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
}
return areaConfigMgr;
}
}

View file

@ -19,15 +19,19 @@
**/
package com.raytheon.uf.viz.monitor.fog.ui.dialogs;
import java.io.IOException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.fog.FogMonitor;
import com.raytheon.uf.viz.monitor.fog.threshold.FogThresholdMgr;
@ -51,6 +55,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 27, 2014 3667 skorolev Cleaned code.
* Feb 10, 2015 3886 skorolev Changed confirmation message.
* Aug 17, 2015 3841 skorolev Corrected handleOkBtnSelection.
*
* </pre>
*
@ -80,19 +85,15 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
* handleOkBtnSelection()
*/
@Override
protected void handleOkBtnSelection() {
protected void handleOkBtnSelection() throws LocalizationException,
SerializationException, IOException {
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.YES | SWT.NO,
"Confirm Cofiguration Changes", "Save changes?");
"Fog Monitor Confirm Changes", "Save changes?");
if (choice == SWT.YES) {
// Save the config xml file.
resetAndSave();
/**
* DR#11279: re-initialize threshold manager and the monitor
* using new monitor area configuration
*/
saveConfigs();
FogThresholdMgr.reInitialize();
fireConfigUpdateEvent();
// Open Threshold Dialog if zones/stations are added.
if ((!configMgr.getAddedZones().isEmpty())
|| (!configMgr.getAddedStations().isEmpty())) {
@ -102,19 +103,15 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
fogMonitorDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
// Clean added zones and stations. Close dialog.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
setReturnValue(true);
close();
}
});
fogMonitorDlg.open();
}
// Clean added zones and stations.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
}
fireConfigUpdateEvent();
resetStatus();
} else { // Return back to continue edit.
return;
}
@ -150,8 +147,8 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
@Override
protected FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
configMgr = FSSObsMonitorConfigurationManager
.getInstance(MonName.fog);
}
return configMgr;
}

View file

@ -60,6 +60,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs.
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Sep 18, 2015 3873 skorolev Adjusted to AppName and MonName.
*
* </pre>
*
@ -163,29 +164,6 @@ public class FogZoneTableDlg extends ZoneTableDlg {
}
}
/**
* Jan 25, 2010, #4281, zhao, Modified to pass an ObMultiHrsReports object
* to table dialog
*
* @Override public void notify(IMonitorEvent me) { if
* (zoneTable.isDisposed()) return;
*
* if (me.getSource() instanceof FogMonitor) { FogMonitor monitor
* = (FogMonitor)me.getSource();
* this.updateTableDlg(monitor.getObData()); }
*
* //if (me.getSource() instanceof FogMonitor) { //
* IMPORTANT!!!!!! For now we just grab the most recent time from
* the OBSTable // When we have the CAVE rendering working we will
* grab it from the CaveResource! // Date date = new Date(); //
* FogMonitor fog = (FogMonitor)me.getSource(); //
* FogDataGenerator fdg = new FogDataGenerator(); // TableData
* tZoneTableData = fdg.generateZoneData(fog.getTableData(),
* fog.getAlgorithmData(), date); //
* updateZoneTable(tZoneTableData, fog.getStationTableData(),
* date); //} }
*/
/*
* (non-Javadoc)
*
@ -304,8 +282,8 @@ public class FogZoneTableDlg extends ZoneTableDlg {
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null || configMgr.isPopulated()) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
configMgr = FSSObsMonitorConfigurationManager
.getInstance(MonName.fog);
}
return configMgr;
}

View file

@ -25,26 +25,22 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.fog.FogRecord;
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
import com.raytheon.uf.common.geospatial.SpatialException;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
import com.raytheon.uf.common.monitor.MonitorAreaUtils;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.AdjacentWfoMgr;
import com.raytheon.uf.common.monitor.data.CommonConfig;
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.viz.core.alerts.AlertMessage;
import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.IMonitor;
import com.raytheon.uf.viz.monitor.Monitor;
import com.raytheon.uf.viz.monitor.ObsMonitor;
@ -87,6 +83,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Sep 18, 2015 3873 skorolev Removed common definitions. Replaced deprecated NotificationMessage.
*
* </pre>
*
@ -126,12 +123,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
private final TableData stationTableData = new TableData(
CommonConfig.AppName.SAFESEAS);
/** All SafeSeas datauri start with this */
private final String OBS = "fssobs";
/** regex wild card filter */
private final String wildCard = "[\\w\\(\\)-_:.]+";
/** List of SAFESEAS resource listeners **/
private final List<ISSResourceListener> safeSeasResources = new ArrayList<ISSResourceListener>();
@ -144,31 +135,21 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
/** data holder for FOG data **/
private Map<Date, Map<String, FOG_THREAT>> algorithmData = null;
/** Adjacent areas for current cwa **/
private Geometry geoAdjAreas;
/** List of fogAlg listeners **/
private final List<ISSResourceListener> fogResources = new ArrayList<ISSResourceListener>();
/** Pattern for SAFESEAS **/
private final Pattern ssPattern = Pattern.compile(DataURI.SEPARATOR + OBS
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard);
/**
* Private constructor, singleton
*/
private SafeSeasMonitor() {
pluginPatterns.add(ssPattern);
ssAreaConfig = new FSSObsMonitorConfigurationManager(MonName.ss.name());
pluginPatterns.add(fssPattern);
ssAreaConfig = FSSObsMonitorConfigurationManager
.getInstance(MonName.ss);
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS);
obData.setThresholdMgr(SSThresholdMgr.getInstance());
obData.getZoneTableData();
createDataStructures();
processProductAtStartup();
readTableConfig(MonitorThresholdConfiguration.SAFESEAS_THRESHOLD_CONFIG);
}
/**
@ -177,10 +158,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
public static synchronized SafeSeasMonitor getInstance() {
if (monitor == null) {
monitor = new SafeSeasMonitor();
// Pre-populate dialog with an observation (METAR) for KOMA
monitor.createDataStructures();
monitor.getAdjAreas();
monitor.processProductAtStartup("ss");
monitor.fireMonitorEvent(monitor);
}
return monitor;
@ -205,6 +182,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
private void createDataStructures() {
obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS);
obData.setThresholdMgr(SSThresholdMgr.getInstance());
obData.getZoneTableData();
algorithmData = new HashMap<Date, Map<String, FOG_THREAT>>();
}
@ -273,7 +251,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
*/
@Override
public void processProductMessage(final AlertMessage filtered) {
if (ssPattern.matcher(filtered.dataURI).matches()) {
if (fssPattern.matcher(filtered.dataURI).matches()) {
processURI(filtered.dataURI, filtered);
}
}
@ -594,36 +572,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
return zoneDialog;
}
/**
* Gets adjacent areas
*/
public void getAdjAreas() {
try {
this.setGeoAdjAreas(AdjacentWfoMgr.getAdjacentAreas(cwa));
} catch (SpatialException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
}
/**
* Sets geometry of adjacent areas
*
* @param geoAdjAreas
* the geoAdjAreas to set
*/
public void setGeoAdjAreas(Geometry geoAdjAreas) {
this.geoAdjAreas = geoAdjAreas;
}
/**
* Gets geometry of adjacent areas
*
* @return the geoAdjAreas
*/
public Geometry getGeoAdjAreas() {
return geoAdjAreas;
}
/*
* Updates data of Fog monitor
*
@ -685,5 +633,4 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
}
MonitoringArea.setPlatformMap(zones);
}
}

View file

@ -21,8 +21,6 @@ package com.raytheon.uf.viz.monitor.safeseas.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -42,6 +40,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
* Feb 03, 2014 #2757 skorolev Fixed reInitialize().
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Removed "site".
* Sep 18, 2015 3873 skorolev Adjusted to AppName and removed areaConfigMgr.
*
* </pre>
*
@ -57,9 +56,7 @@ public class SSThresholdMgr extends AbstractThresholdMgr {
*/
public SSThresholdMgr() {
super("DefaultSSDisplayThresholds.xml",
"DefaultSSMonitorThresholds.xml", AppName.SAFESEAS.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
"DefaultSSMonitorThresholds.xml", AppName.SAFESEAS);
init();
}
@ -114,18 +111,4 @@ public class SSThresholdMgr extends AbstractThresholdMgr {
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.ss.name());
}
return areaConfigMgr;
}
}

View file

@ -19,15 +19,19 @@
**/
package com.raytheon.uf.viz.monitor.safeseas.ui.dialogs;
import java.io.IOException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.safeseas.SafeSeasMonitor;
import com.raytheon.uf.viz.monitor.safeseas.threshold.SSThresholdMgr;
@ -50,7 +54,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 27, 2014 3667 skorolev Cleaned code.
* Feb 10, 2015 3886 skorolev Changed confirmation message.
* Feb 10, 2015 3886 skorolev Changed confirmation message.
* Aug 17, 2015 3841 skorolev Corrected handleOkBtnSelection.
*
*
* </pre>
@ -74,19 +79,25 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
SafeSeasMonitor.getInstance();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#
* handleOkBtnSelection()
*/
@Override
protected void handleOkBtnSelection() {
protected void handleOkBtnSelection() throws LocalizationException,
SerializationException, IOException {
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.YES | SWT.NO,
"Confirm Cofiguration Changes", "Save changes?");
"SAFESEAS Monitor Confirm Changes", "Save changes?");
if (choice == SWT.YES) {
// Save the config xml file.
resetAndSave();
saveConfigs();
SSThresholdMgr.reInitialize();
fireConfigUpdateEvent();
// Open Threshold Dialog if zones/stations are added.
if ((!configMgr.getAddedZones().isEmpty())
|| (!configMgr.getAddedStations().isEmpty())) {
// Open Threshold Dialog if zones/stations are added.
if (editDialog() == SWT.YES) {
ssMonitorDlg = new SSDispMonThreshDlg(shell,
CommonConfig.AppName.SAFESEAS,
@ -94,19 +105,15 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
ssMonitorDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
// Clean added zones and stations. Close dialog.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
setReturnValue(true);
close();
}
});
ssMonitorDlg.open();
}
// Clean added zones and stations.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
}
fireConfigUpdateEvent();
resetStatus();
} else { // Return back to continue edit.
return;
}
@ -142,7 +149,8 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
@Override
public FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
configMgr = FSSObsMonitorConfigurationManager
.getInstance(MonName.ss);
}
return configMgr;
}

View file

@ -57,7 +57,8 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
* Nov 10, 2012 1297 skorolev Added initiateProdArray
* Dec 7, 2012 #1351 skorolev Changes for non-blocking dialogs.
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Sep 18, 2015 3873 skorolev Adjusted to AppName and MonName.
*
* </pre>
*
@ -160,8 +161,7 @@ public class SSZoneTableDlg extends ZoneTableDlg {
Map<String, FOG_THREAT> fogAlgThreats = monitor
.getAlgorithmData(nominalTime);
obData.setFogAlgCellType(monitor.getAlgCellTypes(fogAlgThreats));
this.updateTableDlg(monitor.getObData().getObHourReports(
nominalTime));
this.updateTableDlg(obData.getObHourReports(nominalTime));
}
}
}
@ -329,7 +329,8 @@ public class SSZoneTableDlg extends ZoneTableDlg {
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null || configMgr.isPopulated()) {
configMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
configMgr = FSSObsMonitorConfigurationManager
.getInstance(MonName.ss);
}
return configMgr;
}

View file

@ -25,18 +25,16 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.viz.core.alerts.AlertMessage;
import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.IMonitor;
import com.raytheon.uf.viz.monitor.Monitor;
import com.raytheon.uf.viz.monitor.ObsMonitor;
@ -74,6 +72,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Sep 18, 2015 3873 skorolev Removed common definitions. Replaced deprecated NotificationMessage.
*
* </pre>
*
@ -105,34 +104,26 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
*/
private ObMultiHrsReports obData;
/** All SNOW datauri start with this */
private final String OBS = "fssobs";
/** regex wild card filter */
private final String wildCard = "[\\w\\(\\)-_:.]+";
/** Time which Zone/County dialog shows. **/
private Date dialogTime = null;
/** Array of snow listeners **/
private final List<ISnowResourceListener> snowResources = new ArrayList<ISnowResourceListener>();
/** Pattern for SNOW **/
private final Pattern snowPattern = Pattern.compile(DataURI.SEPARATOR + OBS
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard);
/**
* Private constructor, singleton
*/
private SnowMonitor() {
pluginPatterns.add(snowPattern);
snowConfig = new FSSObsMonitorConfigurationManager(MonName.snow.name());
pluginPatterns.add(fssPattern);
snowConfig = FSSObsMonitorConfigurationManager
.getInstance(MonName.snow);
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW);
// Set up thresholds.
obData.setThresholdMgr(SnowThresholdMgr.getInstance());
// Retrieve existing data.
processProductAtStartup();
obData.getZoneTableData();
}
@ -144,7 +135,6 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
public static synchronized SnowMonitor getInstance() {
if (monitor == null) {
monitor = new SnowMonitor();
monitor.processProductAtStartup("snow");
monitor.fireMonitorEvent(monitor);
}
return monitor;
@ -236,7 +226,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
*/
@Override
public void processProductMessage(final AlertMessage filtered) {
if (snowPattern.matcher(filtered.dataURI).matches()) {
if (fssPattern.matcher(filtered.dataURI).matches()) {
processURI(filtered.dataURI, filtered);
}
}

View file

@ -21,8 +21,6 @@ package com.raytheon.uf.viz.monitor.snow.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -42,6 +40,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowMonitor;
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
* May 21, 2014 3086 skorolev Cleaned code.
* Sep 04, 2014 3220 skorolev Removed "site".
* Sep 18, 2015 3873 skorolev Adjusted to AppName and removed areaConfigMgr.
*
* </pre>
*
@ -56,11 +55,7 @@ public class SnowThresholdMgr extends AbstractThresholdMgr {
*/
private SnowThresholdMgr() {
super("DefaultSnowDisplayThresholds.xml",
"DefaultSnowMonitorThresholds.xml", AppName.SNOW.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
"DefaultSnowMonitorThresholds.xml", AppName.SNOW);
init();
}
@ -115,18 +110,4 @@ public class SnowThresholdMgr extends AbstractThresholdMgr {
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
}
return areaConfigMgr;
}
}

View file

@ -19,15 +19,19 @@
**/
package com.raytheon.uf.viz.monitor.snow.ui.dialogs;
import java.io.IOException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.snow.SnowMonitor;
import com.raytheon.uf.viz.monitor.snow.threshold.SnowThresholdMgr;
@ -50,7 +54,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 27, 2014 3667 skorolev Cleaned code.
* Feb 10, 2015 3886 skorolev Changed confirmation message.
* Feb 10, 2015 3886 skorolev Changed confirmation message.
* Aug 17, 2015 3841 skorolev Corrected handleOkBtnSelection.
* </pre>
*
* @author mpduff
@ -79,15 +84,15 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
* handleApplyBtnSelection()
*/
@Override
protected void handleOkBtnSelection() {
protected void handleOkBtnSelection() throws LocalizationException,
SerializationException, IOException {
if (dataIsChanged()) {
int choice = showMessage(shell, SWT.YES | SWT.NO,
"Confirm Cofiguration Changes", "Save changes?");
"SNOW Monitor Confirm Changes", "Save changes?");
if (choice == SWT.YES) {
// Save the config xml file.
resetAndSave();
saveConfigs();
SnowThresholdMgr.reInitialize();
fireConfigUpdateEvent();
// Open Threshold Dialog if zones/stations are added.
if ((!configMgr.getAddedZones().isEmpty())
|| (!configMgr.getAddedStations().isEmpty())) {
@ -102,19 +107,15 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
@Override
public void dialogClosed(Object returnValue) {
// Clean added zones and stations. Close dialog.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
setReturnValue(true);
close();
}
});
snowMonitorDlg.open();
}
// Clean added zones and stations.
configMgr.getAddedZones().clear();
configMgr.getAddedStations().clear();
}
fireConfigUpdateEvent();
resetStatus();
} else { // Return back to continue edit.
return;
}
@ -135,8 +136,8 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
@Override
protected FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
configMgr = FSSObsMonitorConfigurationManager
.getInstance(MonName.snow);
}
return configMgr;
}

View file

@ -55,6 +55,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Sep 18, 2015 3873 skorolev Adjusted to AppName and MonName.
*
* </pre>
*
@ -140,7 +141,6 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
if (zoneTable.isDisposed()) {
return;
}
if (me.getSource() instanceof SnowMonitor) {
SnowMonitor monitor = (SnowMonitor) me.getSource();
Date date = monitor.getDialogTime();
@ -265,8 +265,8 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null || configMgr.isPopulated()) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
configMgr = FSSObsMonitorConfigurationManager
.getInstance(MonName.snow);
}
return configMgr;
}

View file

@ -23,6 +23,7 @@ import com.raytheon.uf.viz.monitor.data.ObReport;
* skorolev Initial creation
* May 15, 2012 14510 zhao Modified generateObReport()
* Jan 06, 2014 2653 skorolev Included SNOW data into ObReport.
* Sep 20, 2015 3873 skorolev Added IsStationary and getReportType.
*
*
* </pre>
@ -46,10 +47,10 @@ public class GenerateFSSObReport {
public static ObReport generateObReport(PluginDataObject report) {
// Generate the observation report.
ObReport obReport = new ObReport();
FSSObsRecord metar = (FSSObsRecord) report;
FSSObsRecord fssData = (FSSObsRecord) report;
try {
obReport.setObservationTime(metar.getTimeObs().getTime());
obReport.setRefHour(metar.getRefHour().getTime());
obReport.setObservationTime(fssData.getTimeObs().getTime());
obReport.setRefHour(fssData.getRefHour().getTime());
} catch (Exception e) {
statusHandler
.error("Warning: missing obsTime or refHour at getTimeObs() when processing obs data; "
@ -57,63 +58,82 @@ public class GenerateFSSObReport {
+ "; trying to set obsTime and refHour from dataURI");
obReport.setTimesFromFssobDataURI(report.getDataURI());
}
obReport.setPlatformId(metar.getPlatformId());
obReport.setStationary(true);
obReport.setLatitude((float) metar.getLatitude());
obReport.setLongitude((float) metar.getLongitude());
obReport.setPlatformId(fssData.getPlatformId());
obReport.setStationary(fssData.getIsStationary());
obReport.setLatitude((float) fssData.getLatitude());
obReport.setLongitude((float) fssData.getLongitude());
// Table data:
obReport.setCeiling(metar.getCeiling());
obReport.setWindDir(metar.getWindDir());
obReport.setWindSpeed(metar.getWindSpeed());
obReport.setMaxWindSpeed(metar.getMaxWindSpeed());
obReport.setWindGust(metar.getWindGust());
obReport.setRelativeHumidity(metar.getRelativeHumidity());
obReport.setCeiling(fssData.getCeiling());
obReport.setWindDir(fssData.getWindDir());
obReport.setWindSpeed(fssData.getWindSpeed());
obReport.setMaxWindSpeed(fssData.getMaxWindSpeed());
obReport.setWindGust(fssData.getWindGust());
obReport.setRelativeHumidity(fssData.getRelativeHumidity());
try {
obReport.setVisibility(metar.getVisibility());
obReport.setVisibility(fssData.getVisibility());
} catch (Exception e) {
obReport.setVisibility(0);
}
obReport.setDewpoint(metar.getDewpoint());
obReport.setTemperature(metar.getTemperature());
obReport.setDewpointDepr(metar.getDewpointDepr());
obReport.setDewpoint(fssData.getDewpoint());
obReport.setTemperature(fssData.getTemperature());
obReport.setDewpointDepr(fssData.getDewpointDepr());
obReport.setPresentWx(getPrWX(metar.getPresWeather()));
obReport.setPresentWx(getPrWX(fssData.getPresWeather()));
obReport.setHighResWaveHeight(ObConst.MISSING);
obReport.setWaveSteepness(metar.getWaveSteepness());
obReport.setWaveSteepness(fssData.getWaveSteepness());
obReport.setSeaLevelPress(metar.getSeaLevelPress());
obReport.setWavePeriod(metar.getWavePeriod());
obReport.setWindGust(metar.getWindGust());
obReport.setPSwellHeight(metar.getPrimarySwellWaveHeight().floatValue());
obReport.setPSwellPeriod(metar.getPrimarySwellWavePeriod());
obReport.setPSwellDir(metar.getPrimarySwellWaveDir().floatValue());
obReport.setSSwellHeight(metar.getSecondarySwellWaveHeight()
obReport.setSeaLevelPress(fssData.getSeaLevelPress());
obReport.setWavePeriod(fssData.getWavePeriod());
obReport.setWindGust(fssData.getWindGust());
obReport.setPSwellHeight(fssData.getPrimarySwellWaveHeight()
.floatValue());
obReport.setSSwellPeriod(metar.getSecondarySwellWavePeriod());
obReport.setSSwellDir(metar.getSecondarySwellWaveDir().floatValue());
obReport.setPressure(metar.getPressureAltimeter());
obReport.setPressureChange(metar.getPressChange3Hour());
obReport.setPSwellPeriod(fssData.getPrimarySwellWavePeriod());
obReport.setPSwellDir(fssData.getPrimarySwellWaveDir().floatValue());
obReport.setSSwellHeight(fssData.getSecondarySwellWaveHeight()
.floatValue());
obReport.setSSwellPeriod(fssData.getSecondarySwellWavePeriod());
obReport.setSSwellDir(fssData.getSecondarySwellWaveDir().floatValue());
obReport.setPressure(fssData.getPressureAltimeter());
obReport.setPressureChange(fssData.getPressChange3Hour());
try {
obReport.setPressChangeChar(Short.parseShort(metar
obReport.setPressChangeChar(Short.parseShort(fssData
.getPressChangeChar()));
} catch (NumberFormatException e) {
obReport.setPressChangeChar((short) 0);
}
obReport.setHourlyPrecip(metar.getHourlyPrecip());
obReport.setHourlyPrecip(fssData.getHourlyPrecip());
obReport.setRawMessage(metar.getRawMessage());
obReport.setReportType(ReportType.METAR);
obReport.setSnincrHourly(metar.getSnincrHourly());
obReport.setSnincrTotal(metar.getSnincrTotal());
obReport.setFrostbiteTime(metar.getFrostbiteTime());
obReport.setWindChill(metar.getWindChill());
obReport.setSnowDepth(metar.getSnowDepth());
obReport.setSeaSurfaceTemp(metar.getSeaSurfaceTemp());
obReport.setRawMessage(fssData.getRawMessage());
ReportType reportType = getReportType(fssData.getReportType());
obReport.setReportType(reportType);
obReport.setSnincrHourly(fssData.getSnincrHourly());
obReport.setSnincrTotal(fssData.getSnincrTotal());
obReport.setFrostbiteTime(fssData.getFrostbiteTime());
obReport.setWindChill(fssData.getWindChill());
obReport.setSnowDepth(fssData.getSnowDepth());
obReport.setSeaSurfaceTemp(fssData.getSeaSurfaceTemp());
return obReport;
}
private static ReportType getReportType(String reportType) {
if (reportType == null) {
reportType = "";
}
switch (reportType) {
case "1003":
case "1004":
case "1005":
case "1006":
case "1007":
return ReportType.MARITIME;
// TODO:MESONET
default:
return ReportType.METAR;
}
}
/**
* Construct Present Weather string.
*

View file

@ -24,10 +24,10 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.alerts.AlertMessage;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.events.IMonitorEvent;
import com.raytheon.uf.viz.monitor.listeners.IMonitorConfigurationListener;
import com.raytheon.uf.viz.monitor.listeners.IMonitorListener;
@ -46,7 +46,9 @@ import com.raytheon.viz.alerts.observers.ProductAlertObserver;
* 2/27/2009 2047 grichard Use 'foreach' in 'arrived' methods.
* 3/2/2009 2047 grichard Added stationId resolution method.
* 3/5/2009 2047 grichard Made plugin and station names arrays.
* Dec 18, 2009 3424 zhao Made addMinitorListener public
* Dec 18, 2009 3424 zhao Made addMinitorListener public.
* Sep 20, 2015 3873 skorolev Replaced deprecated NotificationMessage.
*
* </pre>
*
* @author dhladky
@ -199,7 +201,6 @@ public abstract class Monitor implements IMonitor, IMonitorThresholdListener,
final Monitor fmonitor = this;
final String ftype = type;
// System.out.println("Listener class: "+type);
VizApp.runAsync(new Runnable() {
public void run() {

View file

@ -28,11 +28,15 @@ import java.util.regex.Pattern;
import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecordTransform;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.geospatial.SpatialException;
import com.raytheon.uf.common.inventory.exception.DataCubeException;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
import com.raytheon.uf.common.monitor.data.AdjacentWfoMgr;
import com.raytheon.uf.common.pointdata.PointDataContainer;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -41,12 +45,11 @@ import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.alerts.AlertMessage;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.datacube.DataCubeContainer;
import com.raytheon.uf.viz.monitor.data.MonitoringArea;
import com.raytheon.uf.viz.monitor.data.ObReport;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent;
import com.vividsolutions.jts.geom.Geometry;
/**
*
@ -62,6 +65,7 @@ import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent;
* Feb 04, 2014 2757 skorolev Added filter for removed stations
* May 08, 2014 3086 skorolev Added current site definition.
* Sep 04, 2014 3220 skorolev Removed cwa and monitorUsefrom vals.
* Sep 18, 2015 3873 skorolev Included common definitions.
*
* </pre>
*
@ -106,6 +110,39 @@ public abstract class ObsMonitor extends Monitor {
/** Current CWA **/
public static String cwa = LocalizationManager.getInstance().getSite();
/** Adjacent areas for current cwa **/
private Geometry geoAdjAreas;
/** All FSSObs datauri start with this **/
protected final String OBS = "fssobs";
/** regex wild card filter **/
protected final String wildCard = "[\\w\\(\\)\\-_:.]+";
/** Pattern for FSSObs **/
protected final Pattern fssPattern = Pattern.compile(DataURI.SEPARATOR
+ OBS + DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard + DataURI.SEPARATOR + wildCard
+ DataURI.SEPARATOR + wildCard);
/**
* Constructor.
*/
public ObsMonitor() {
this.getAdjAreas();
}
/**
* Gets adjacent areas
*/
public void getAdjAreas() {
try {
this.setGeoAdjAreas(AdjacentWfoMgr.getAdjacentAreas(cwa));
} catch (SpatialException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
}
/**
* This method processes the incoming messages
*
@ -199,20 +236,13 @@ public abstract class ObsMonitor extends Monitor {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
try {
// Filter removed stations
ArrayList<String> zones = MonitoringArea
.getZoneIds(objectToSend
.getPlatformId());
if (!zones.isEmpty()) {
ObReport result = GenerateFSSObReport
.generateObReport(objectToSend);
statusHandler
.handle(Priority.INFO,
"New FSSrecord ===> "
+ objectToSend
.getDataURI());
process(result);
}
ObReport result = GenerateFSSObReport
.generateObReport(objectToSend);
statusHandler.handle(
Priority.INFO,
"New FSSrecord ===> "
+ objectToSend.getDataURI());
process(result);
} catch (Exception e) {
statusHandler
.handle(Priority.PROBLEM,
@ -240,7 +270,7 @@ public abstract class ObsMonitor extends Monitor {
* @param monitorName
*
*/
public void processProductAtStartup(String monitorName) {
public void processProductAtStartup() {
/**
* Assume this number for MaxNumObsTimes is larger enough to cover data
@ -274,19 +304,14 @@ public abstract class ObsMonitor extends Monitor {
FSSObsRecord[] obsRecords = requestFSSObs(vals, selectedTimes);
for (FSSObsRecord objectToSend : obsRecords) {
// Filter removed stations
ArrayList<String> zones = MonitoringArea
.getZoneIds(objectToSend.getPlatformId());
if (!zones.isEmpty()) {
ObReport result = GenerateFSSObReport
.generateObReport(objectToSend);
processAtStartup(result);
}
ObReport result = GenerateFSSObReport
.generateObReport(objectToSend);
processAtStartup(result);
}
}
} catch (DataCubeException e) {
statusHandler.handle(Priority.PROBLEM,
"No data in database at startup. " + monitorName);
"No data in database at startup.");
}
}
@ -315,4 +340,19 @@ public abstract class ObsMonitor extends Monitor {
constraints);
return FSSObsRecordTransform.toFSSObsRecords(pdc);
}
/**
* @return the geoAdjAreas
*/
public Geometry getGeoAdjAreas() {
return geoAdjAreas;
}
/**
* @param geoAdjAreas
* the geoAdjAreas to set
*/
public void setGeoAdjAreas(Geometry geoAdjAreas) {
this.geoAdjAreas = geoAdjAreas;
}
}

View file

@ -22,8 +22,8 @@ package com.raytheon.uf.viz.monitor;
import java.util.Collection;
import com.raytheon.uf.common.jms.notification.NotificationMessage;
import com.raytheon.uf.viz.core.alerts.AlertMessage;
import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent;
@ -36,7 +36,8 @@ import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 9, 2010 dhladky Initial creation
* Apr 9, 2010 dhladky Initial creation
* Sep 20, 2015 3873 skorolev Replaced deprecated NotificationMessage.
*
* </pre>
*

View file

@ -21,16 +21,24 @@ package com.raytheon.uf.viz.monitor.data;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.Set;
import com.raytheon.uf.common.geospatial.SpatialException;
import com.raytheon.uf.common.monitor.MonitorAreaUtils;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.ReportType;
import com.raytheon.uf.common.monitor.xml.StationIdXML;
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.viz.monitor.config.CommonTableConfig.CellType;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
import com.vividsolutions.jts.geom.Coordinate;
/**
* This class is a container of ObZoneHourReports objects for a caller-specified
@ -40,13 +48,14 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Dec. 1, 2009 3424 zhao Initial creation.
* Oct.29, 2012 1297 skorolev Changed HashMap to Map
* Oct.31 2012 1297 skorolev Cleaned code.
* Sep 04 2014 3220 skorolev Added updateZones method.
* Mar 17 2015 3888 dhladky check for nulls
* Sep 25 2015 3873 skorolev Corrected addReport for moving platforms.
*
* </pre>
*
@ -73,8 +82,15 @@ public class ObHourReports {
*/
private Map<String, ObZoneHourReports> hourReports;
/**
* current threshold manager
*/
private AbstractThresholdMgr thresholdMgr;
private Set<String> zones = new HashSet<String>();
private FSSObsMonitorConfigurationManager configMgr;
/**
* constructor
*
@ -85,10 +101,12 @@ public class ObHourReports {
this.nominalTime = nominalTime;
this.appName = appName;
this.thresholdMgr = thresholdMgr;
configMgr = this.thresholdMgr.getCfgMgr();
hourReports = new HashMap<String, ObZoneHourReports>();
Map<String, List<String>> zoneStationMap = MonitoringArea
.getPlatformMap();
for (String zone : zoneStationMap.keySet()) {
zones.clear();
zones.addAll(configMgr.getAreaList());
for (String zone : zones) {
hourReports.put(zone, new ObZoneHourReports(nominalTime, zone,
appName, thresholdMgr));
}
@ -101,28 +119,80 @@ public class ObHourReports {
*/
public void addReport(ObReport report) {
String station = report.getPlatformId();
List<String> zones = MonitoringArea.getZoneIds(station);
if (zones.size() == 0) {
statusHandler
.error("Error: station: "
+ station
+ " is not associated with any zone in the monitoring area");
return;
List<String> stationZones = configMgr.getAreaByStationId(station);
// If station has no associated zone:
if (stationZones.isEmpty()) {
if (appName.equals(AppName.FOG) || appName.equals(AppName.SAFESEAS)) {
// Associate moving platform with monitoring zones
double shipDist = configMgr.getShipDistance();
stationZones.addAll(findZoneForShip(report, shipDist));
} else {
statusHandler
.warn("Error: station: "
+ station
+ " is not associated with any zone in the monitoring area");
return;
}
}
boolean hasZone = false;
for (String zone : zones) {
// Add station report to all associated zones.
for (String zone : stationZones) {
if (hourReports.containsKey(zone)) {
hasZone = true;
hourReports.get(zone).addReport(report);
}
}
if (hasZone == false) {
statusHandler
.error("Error in addreport() of ObHourReports: unable to add obs report to data archive");
}
return;
}
/**
* Find zones to include a moving platform.
*
* @param report
* from moving platform
* @param shipDist
* distance from area configuration file
*/
private Set<String> findZoneForShip(ObReport report, double shipDist) {
double latShip = report.getLatitude();
double lonShip = report.getLongitude();
Set<String> shipZones = new HashSet<String>();
for (String zone : zones) {
try {
// use only marine zones
if (zone.charAt(2) == 'Z') {
Coordinate zcoor = MonitorAreaUtils.getZoneCenter(zone);
double shipToZone = distance(latShip, lonShip, zcoor.y,
zcoor.x);
if (shipToZone <= shipDist) {
// associate moving platform with monitoring zone.
shipZones.add(zone);
statusHandler.handle(Priority.DEBUG,
"<<<======>>>" + zone + "\tplatform = "
+ report.getPlatformId() + "\tdist = "
+ shipToZone + "\t shipDist = "
+ shipDist);
StationIdXML stnXML = new StationIdXML();
stnXML.setName(report.getPlatformId());
stnXML.setType(ReportType.MARITIME.name());
configMgr.getAreaXml(zone).addStationIdXml(stnXML);
}
} else {
continue;
}
} catch (SpatialException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);
}
}
// Update configuration file.
configMgr.saveConfigXml();
return shipZones;
}
/**
* Gets HourReports
*
* @return hourReports
*/
public Map<String, ObZoneHourReports> getHourReports() {
@ -186,8 +256,8 @@ public class ObHourReports {
}
/**
* Returns the ObZoneHourReports object of a caller-specified zone. If such
* object not available, returns null.
* Gets ObZoneHourReports Returns the ObZoneHourReports object of a
* caller-specified zone. If such object not available, returns null.
*
* @param zone
* @return hour reports
@ -200,6 +270,8 @@ public class ObHourReports {
}
/**
* Gets NominalTime
*
* @return nominalTime
*/
public Date getNominalTime() {
@ -207,6 +279,8 @@ public class ObHourReports {
}
/**
* Gets AppName
*
* @return appName
*/
public CommonConfig.AppName getAppName() {
@ -215,51 +289,79 @@ public class ObHourReports {
/**
* Updates zones in the Hour Reports
*
* @param configMgr
*/
public void updateZones() {
Map<String, List<String>> zoneStationMap = MonitoringArea
.getPlatformMap();
// remove zones or stations
List<String> hourZones = new CopyOnWriteArrayList<String>(
hourReports.keySet());
for (String zone : hourZones) {
if (hourReports.keySet().contains(zone)) {
List<String> stations = new CopyOnWriteArrayList<String>(
hourReports.get(zone).getZoneHourReports().keySet());
for (String stn : stations) {
if (zoneStationMap.get(zone) != null) {
if (!zoneStationMap.get(zone).contains(stn)) {
hourReports.get(zone).getZoneHourReports()
.remove(stn);
}
}
}
if (!zoneStationMap.keySet().contains(zone)) {
hourReports.remove(zone);
}
}
}
// Updated list of zones
List<String> updtZones = configMgr.getAreaList();
// remove zones
hourReports.keySet().retainAll(updtZones);
// add zones
for (String zone : zoneStationMap.keySet()) {
List<String> stations = new CopyOnWriteArrayList<String>(
zoneStationMap.get(zone));
for (String stn : stations) {
if (hourReports.get(zone) != null) {
if (!hourReports.get(zone).getZoneHourReports()
.containsKey(stn)) {
hourReports
.get(zone)
.getZoneHourReports()
.put(stn,
new ObStnHourReports(nominalTime, zone,
stn, appName, thresholdMgr));
}
}
}
if (!hourReports.containsKey(zone)) {
for (String zone : updtZones) {
if (!hourReports.keySet().contains(zone)) {
hourReports.put(zone, new ObZoneHourReports(nominalTime, zone,
appName, thresholdMgr));
}
}
// add and(or) remove stations
for (String zone : updtZones) {
// Updated list of stations in this zone
List<String> updtStns = configMgr.getAreaStations(zone);
// remove stations
hourReports.get(zone).getZoneHourReports().keySet()
.retainAll(updtStns);
// add stations
for (String stn : updtStns) {
if (!hourReports.get(zone).getZoneHourReports()
.containsKey(stn)) {
hourReports
.get(zone)
.getZoneHourReports()
.put(stn,
new ObStnHourReports(nominalTime, zone,
stn, appName, thresholdMgr));
}
}
// update hourReports for current zone
hourReports.get(zone).getZoneHourReports();
}
}
/**
* Distance between two coordinates.
*
* @param lat1
* @param lon1
* @param lat2
* @param lon2
* @return distance in km
*/
public static double distance(double lat1, double lon1, double lat2,
double lon2) {
// Earth's radius of 6378.137 kilometers
float EarthRadius = 6378.137f;
double dLat = toRad(lat2 - lat1);
double dLon = toRad(lon2 - lon1);
lat1 = toRad(lat1);
lat2 = toRad(lat2);
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2)
* Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return EarthRadius * c;
}
/**
* From grad to radian.
*
* @param value
* @return
*/
private static double toRad(double value) {
return value * Math.PI / 180;
}
}

View file

@ -24,15 +24,22 @@ import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
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 java.util.concurrent.ConcurrentHashMap;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.CellType;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.ObsHistType;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -50,10 +57,11 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
* Dec. 1, 2009 3424 zhao Initial creation.
* Dec 24, 2009 3424 zhao added getTrendDataSet() that returns ObTrendDataSet object
* Jan 25, 2010 4281, 3888, 3877 wkwock/zhao added getHistTableData method
* Oct.31, 2012 1297 skorolev Clean code.
* Jan. 29, 2013 15654 zhao add Wind Chill calculation for SNOW
* Sep 04, 2014 3220 skorolev Updated getStationTableData method.
*
* Oct 31, 2012 1297 skorolev Clean code.
* Jan 29, 2013 15654 zhao add Wind Chill calculation for SNOW
* Sep 04, 2014 3220 skorolev Updated getStationTableData method.
* Sep 25, 2015 3873 skorolev Added multiHrsTabData.
*
* </pre>
*
* @author zhao
@ -61,6 +69,8 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
*/
public class ObMultiHrsReports {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(ObMultiHrsReports.class);
/**
* Thresholds manager
@ -78,17 +88,18 @@ public class ObMultiHrsReports {
private CommonConfig.AppName appName;
/**
* key is nominal time, value is ObHourReports object
* FSSObs records cache. Key is nominal time, value is ObHourReports object
*/
private SortedMap<Date, ObHourReports> multiHrsReports;
private SortedMap<Date, ObHourReports> multiHrsReports = new TreeMap<Date, ObHourReports>();
/**
* The maximum number of most recent hours within which observation reports
* are to be archived. TODO: move MAX_FRAMES to a configuration file?
* Monitor Table data cache. Key is nominal time, value is TableData
*/
private final int MAX_FRAMES = 64;
private ConcurrentHashMap<Date, TableData> multiHrsTabData = new ConcurrentHashMap<Date, TableData>();
private int maxFrames = MAX_FRAMES;
private int maxFrames = ObConst.MAX_FRAMES;
private FSSObsMonitorConfigurationManager cfgMgr = null;
/**
* Constructor
@ -97,28 +108,16 @@ public class ObMultiHrsReports {
*/
public ObMultiHrsReports(CommonConfig.AppName appName) {
this.appName = appName;
multiHrsReports = new TreeMap<Date, ObHourReports>();
if (appName.equals(AppName.FOG) || appName.equals(AppName.SAFESEAS)) {
initFogAlgCellType();
}
}
/**
* Add an array of ObReport objects to the ObMultiHrsReports object (Don't
* use! VK)
*
* @param result
*/
public void addReports(ObReport[] results) {
for (ObReport report : results) {
/**
* DR #8723: if wind speed is zero, wind direction should be N/A,
* not 0
*/
if (report.getWindSpeed() < 0.0001) { // zero wind speed
report.setWindDir(ObConst.MISSING);
if (appName.equals(AppName.FOG) || appName.equals(AppName.SAFESEAS)) {
if (appName.equals(AppName.FOG)) {
cfgMgr = FSSObsMonitorConfigurationManager
.getInstance(MonName.fog);
} else if (appName.equals(AppName.SAFESEAS)) {
cfgMgr = FSSObsMonitorConfigurationManager
.getInstance(MonName.ss);
}
addReport(report);
initFogAlgCellType();
}
}
@ -129,8 +128,6 @@ public class ObMultiHrsReports {
* @return returns multiHrsReports
*/
public void addReport(ObReport report) {
// Date nominalTime = TableUtil
// .getNominalTime(report.getObservationTime());
Date nominalTime = report.getRefHour();
/**
* DR #8723: if wind speed is zero, wind direction should be N/A, not 0
@ -151,50 +148,56 @@ public class ObMultiHrsReports {
/**
* DR15654: set Wind Chill for SNOW
*/
if ( appName == AppName.SNOW ) {
if ( report.getTemperature() != ObConst.MISSING && report.getWindSpeed() != ObConst.MISSING ) {
report.setWindChill(calcWindChill( report.getTemperature(), report.getWindSpeed() ));
if (appName == AppName.SNOW) {
if (report.getTemperature() != ObConst.MISSING
&& report.getWindSpeed() != ObConst.MISSING) {
report.setWindChill(calcWindChill(report.getTemperature(),
report.getWindSpeed()));
}
}
if (multiHrsReports.containsKey(nominalTime)) {
multiHrsReports.get(nominalTime).addReport(report);
ObHourReports obHourReports;
// new nominal time; create a new ObHourReports object
if (multiHrsReports.isEmpty()
|| !multiHrsReports.containsKey(nominalTime)) {
obHourReports = new ObHourReports(nominalTime, appName,
thresholdMgr);
} else {
// new nominal time; create a new ObHourReports object
// the map is full; delete the oldest entry
if (multiHrsReports.size() >= maxFrames) {
// the map is full; delete the oldest entry
multiHrsReports.remove(multiHrsReports.firstKey());
}
ObHourReports obHourReports = new ObHourReports(nominalTime,
appName, thresholdMgr);
obHourReports.addReport(report);
multiHrsReports.put(nominalTime, obHourReports);
// update multiHrsReports with new data
obHourReports = multiHrsReports.get(nominalTime);
}
obHourReports.addReport(report);
// update data cache
multiHrsReports.put(nominalTime, obHourReports);
TableData tblData = obHourReports.getZoneTableData();
multiHrsTabData.put(nominalTime, tblData);
}
/**
* DR 15654:
* Wind Chill calculation formula based on
* http://www.nws.noaa.gov/om/windchill/
* as of Jan. 29, 2013
*
* @param temperature in degree F
* @param windSpeed in knots
* @return wind chill in degree F
*/
private float calcWindChill(float temp, float windSpd) {
if ( temp > 50.0 || windSpd < 3.0 ) {
return ObConst.MISSING;
}
/**
* 1 knots = 1.15078 mph
*/
float spd = (float) Math.pow(1.15078*windSpd, 0.16);
return 35.74f + 0.6215f*temp - 35.75f*spd + 0.4275f*temp*spd;
}
/**
* DR 15654: Wind Chill calculation formula based on
* http://www.nws.noaa.gov/om/windchill/ as of Jan. 29, 2013
*
* @param temp
* in degree F
* @param windSpd
* in knots
* @return wind chill in degree F
*/
private float calcWindChill(float temp, float windSpd) {
if (temp > 50.0 || windSpd < 3.0) {
return ObConst.MISSING;
}
/**
* 1 knots = 1.15078 mph
*/
float spd = (float) Math.pow(1.15078 * windSpd, 0.16);
return 35.74f + 0.6215f * temp - 35.75f * spd + 0.4275f * temp * spd;
}
/**
/**
* Returns a zone TableData object of the latest nominal time. If no data
* available (the map is empty), returns an empty zone TableData object
* (table cells filled with "N/A").
@ -211,26 +214,31 @@ public class ObMultiHrsReports {
/**
* Returns a zone TableData object for a caller-specified nominal-time. If
* no data available, returns an empty/default zone TableData object (table
* cells filled with "N/A").
* cells filled with "N/A"). Updates multiHrsTabData table cache.
*
* @param nominalTime
* @return
*/
public TableData getZoneTableData(Date nominalTime) {
TableData tabData = null;
if (nominalTime == null || !multiHrsReports.containsKey(nominalTime)) {
return getEmptyZoneTableData();
}
if (appName == AppName.FOG) {
return this.getObHourReports(nominalTime).getFogZoneTableData(
tabData = this.getObHourReports(nominalTime).getFogZoneTableData(
fogAlgCellType);
}
if (appName == AppName.SAFESEAS) {
return this.getObHourReports(nominalTime).getSSZoneTableData(
} else if (appName == AppName.SAFESEAS) {
tabData = this.getObHourReports(nominalTime).getSSZoneTableData(
fogAlgCellType);
}
return this.getObHourReports(nominalTime).getZoneTableData();
// return multiHrsReports.get(nominalTime).getZoneTableData();
} else {
tabData = this.getObHourReports(nominalTime).getZoneTableData();
}
// update table data cache
if (multiHrsTabData.replace(nominalTime, tabData) == null) {
multiHrsTabData.put(nominalTime, tabData);
}
return tabData;
}
/**
@ -243,15 +251,27 @@ public class ObMultiHrsReports {
.getSystemTime().getTime());
ObHourReports hourReports = new ObHourReports(nominalTime, appName,
thresholdMgr);
TableData tabData = null;
if (appName == AppName.FOG) {
return hourReports.getFogZoneTableData(fogAlgCellType);
tabData = hourReports.getFogZoneTableData(fogAlgCellType);
} else {
tabData = hourReports.getZoneTableData();
}
return hourReports.getZoneTableData();
// update data cache
multiHrsReports.put(nominalTime, hourReports);
// update cache with empty table data
if (multiHrsTabData.replace(nominalTime, tabData) == null) {
multiHrsTabData.put(nominalTime, tabData);
}
return tabData;
}
/**
* Returns the station TableData object for the latest nominal time. If no
* data available, an empty/default station TableData object is returned
*
* @param zone
* @return
*/
public TableData getStationTableData(String zone) {
if (multiHrsReports.isEmpty()) {
@ -264,9 +284,13 @@ public class ObMultiHrsReports {
* Returns a station TableData object for a caller-specified nominal-time
* and zone ID. If no data available, an empty/default station TableData
* object is returned.
*
* @param nominalTime
* @param zone
* @return
*/
public TableData getStationTableData(Date nominalTime, String zone) {
if(zone.equals("")){
if (zone.equals("")) {
return this.getEmptyZoneTableData();
}
if (nominalTime == null) {
@ -296,6 +320,7 @@ public class ObMultiHrsReports {
* @param zone
* @param Station
* @param varName
* @param productName
* @return ObTrendDataSet object, or null if no data available
*/
public ObTrendDataSet getTrendDataSet(String zone, String station,
@ -304,81 +329,45 @@ public class ObMultiHrsReports {
if (multiHrsReports.isEmpty()) {
return null;
}
// Trend plot for the past 24 hours.
// Instead of using present time as the latest time,
// here we use the latest nominal time as the latest time
// and get data within 24 hours before the latest nominal time
// [probably present time should be used as the latest time for trending
// plots-- fix this later]
Date latestNominalTime = multiHrsReports.lastKey();
// determine trending start nominal time
Date startNominalTime = multiHrsReports.firstKey();
// startNominalTime must be within 24 hours before latestNominalTime
long diff = (latestNominalTime.getTime() - startNominalTime.getTime())
/ (60 * 60 * 60); // difference in hour between the two dates
if (diff > 24) {
// find the startNominalTime
Calendar cal = Calendar.getInstance();
cal.setTime(latestNominalTime);
cal.add(Calendar.DAY_OF_YEAR, -1);
Date expectedStartNominalTime = cal.getTime(); // expected, but may
// not exist in
// multiHrsReports
if (multiHrsReports.containsKey(expectedStartNominalTime)) {
startNominalTime = expectedStartNominalTime;
} else {
// this iterator is ordered since multiHrsReports is a sorted
// map
Iterator<Date> iterator = multiHrsReports.keySet().iterator();
while (iterator.hasNext()) {
Date nominalTime = iterator.next();
if (nominalTime.compareTo(expectedStartNominalTime) >= 0) {
startNominalTime = nominalTime;
break;
}
}
}
}
// get data
ObTrendDataSet trendData = new ObTrendDataSet(zone, varName,
productName, appName, thresholdMgr);
// trendData.setThresholdMgr(thresholdMgr);
Iterator<Date> nominalTimeIterator = multiHrsReports.keySet()
.iterator();
Date start = findStartNominalTime();
while (nominalTimeIterator.hasNext()) {
Date nominalTime = nominalTimeIterator.next();
if (nominalTime.compareTo(startNominalTime) >= 0) {
Set<Date> obsTimes = this.getObHourReports(nominalTime)
if (nominalTime.compareTo(start) >= 0) {
ObStnHourReports stnHrRpts = this.getObHourReports(nominalTime)
.getObZoneHourReports(zone)
.getObStnHourReports(station).getObsTimes();
if (obsTimes != null) {
for (Date obsTime : obsTimes) {
trendData.addDataPoint(obsTime,
new Float(this.getObHourReports(nominalTime)
.getObZoneHourReports(zone)
.getObStnHourReports(station)
.getObReport(obsTime).get(varName)));
.getObStnHourReports(station);
if (stnHrRpts != null) {
Set<Date> obsTimes = stnHrRpts.getObsTimes();
if (obsTimes != null) {
for (Date obsTime : obsTimes) {
trendData.addDataPoint(obsTime, new Float(stnHrRpts
.getObReport(obsTime).get(varName)));
}
} else {
continue;
}
}
}
}
return trendData;
}
/**
* Gets History Table Data
*
* @param zone
* : current zone
* @param station
* station ID
* : station ID
* @param obsType
* ObsHistType
* @return TableData object for obs history table
* : ObsHistType
* @return
*/
public TableData getHistTableData(String zone, String station,
ObsHistType obsType) {
@ -387,37 +376,69 @@ public class ObMultiHrsReports {
if (multiHrsReports.isEmpty()) {
return tblData;
}
ArrayList<TableRowData> tblRows = new ArrayList<TableRowData>();
Iterator<Date> nominalTimeIterator = multiHrsReports.keySet()
.iterator();
Date start = findStartNominalTime();
while (nominalTimeIterator.hasNext()) {
Date nominalTime = nominalTimeIterator.next();
if (nominalTime.compareTo(start) >= 0) {
ObStnHourReports stnHrRpts = this.getObHourReports(nominalTime)
.getObZoneHourReports(zone)
.getObStnHourReports(station);
if (stnHrRpts != null) {
Set<Date> obsTimes = stnHrRpts.getObsTimes();
if (obsTimes != null) {
for (Date obsTime : obsTimes) {
ObReport report = stnHrRpts.getObReport(obsTime);
tblRows.add(TableUtil.getHistTableRowData(appName,
obsType, report));
}
} else {
continue;
}
}
}
}
/**
* sort first column descending in obs time
*/
ArrayList<TableRowData> tblRows2 = new ArrayList<TableRowData>();
for (int i = 0; i < tblRows.size(); i++) {
tblRows2.add(tblRows.get(tblRows.size() - 1 - i));
}
tblData.setTableRows(tblRows2);
return tblData;
}
private Date findStartNominalTime() {
// Trend plot for the past 24 hours.
// Instead of using present time as the latest time,
// here we use the latest nominal time as the latest time
// and get data within 24 hours before the latest nominal time
// [probably present time should be used as the latest time for trending
// plots-- fix this later]
Date latestNominalTime = multiHrsReports.lastKey();
// determine trending start nominal time
Date startNominalTime = multiHrsReports.firstKey();
// startNominalTime must be within 24 hours before latestNominalTime
long diff = (latestNominalTime.getTime() - startNominalTime.getTime())
/ (60 * 60 * 60); // difference in hour between the two dates
/ TimeUtil.MILLIS_PER_HOUR;
// difference in hours between the two dates
if (diff > 24) {
// find the startNominalTime
Calendar cal = Calendar.getInstance();
cal.setTime(latestNominalTime);
cal.add(Calendar.DAY_OF_YEAR, -1);
Date expectedStartNominalTime = cal.getTime(); // expected, but may
// not exist in
// multiHrsReports
// expected, but may not exist in multiHrsReports
Date expectedStartNominalTime = cal.getTime();
if (multiHrsReports.containsKey(expectedStartNominalTime)) {
startNominalTime = expectedStartNominalTime;
} else {
// this iterator is ordered since multiHrsReports is a sorted
// map
Iterator<Date> iterator = multiHrsReports.keySet().iterator();
while (iterator.hasNext()) {
Date nominalTime = iterator.next();
if (nominalTime.compareTo(expectedStartNominalTime) >= 0) {
@ -427,81 +448,50 @@ public class ObMultiHrsReports {
}
}
}
// get data
ArrayList<TableRowData> tblRows = new ArrayList<TableRowData>();
Iterator<Date> nominalTimeIterator = multiHrsReports.keySet()
.iterator();
while (nominalTimeIterator.hasNext()) {
Date nominalTime = nominalTimeIterator.next();
if (nominalTime.compareTo(startNominalTime) >= 0) {
Set<Date> obsTimes = this.getObHourReports(nominalTime)
.getObZoneHourReports(zone)
.getObStnHourReports(station).getObsTimes();
if (obsTimes != null) {
for (Date obsTime : obsTimes) {
ObReport report = getObHourReports(nominalTime)
.getObZoneHourReports(zone)
.getObStnHourReports(station)
.getObReport(obsTime);
tblRows.add(TableUtil.getHistTableRowData(appName,
obsType, report));
}
}
}
}
/**
* sort first column descending in obs time
*/
ArrayList<TableRowData> tblRows2 = new ArrayList<TableRowData>();
for (int i = 0; i < tblRows.size(); i++) {
tblRows2.add(tblRows.get(tblRows.size() - 1 - i));
}
tblData.setTableRows(tblRows2);
return tblData;
return startNominalTime;
}
/**
* Returns a SortedMap object <nominal time, ObHourReports object>
* Gets table cache
*
* @return multiHrsReports
* @return
*/
public ConcurrentHashMap<Date, TableData> getMultiHrsTabData() {
return multiHrsTabData;
}
/**
* Sets table cache
*
* @param multiHrsTabData
*/
public void setMultiHrsTabData(
ConcurrentHashMap<Date, TableData> multiHrsTabData) {
this.multiHrsTabData = multiHrsTabData;
}
/**
* Gets data cache
*
* @return SortedMap object <nominal time, ObHourReports object>
*/
public SortedMap<Date, ObHourReports> getMultiHrsReports() {
return multiHrsReports;
}
/**
* Returns a SortedMap object (key is nominal time, value is zone TableData
* object)
* Sets data cache
*
* @return
* @param multiHrsReports
*/
public SortedMap<Date, TableData> getMultiHrsTableData() {
SortedMap<Date, TableData> multiHrsTblData = new TreeMap<Date, TableData>();
if (appName == AppName.FOG) {
for (Date nominalTime : multiHrsReports.keySet()) {
multiHrsTblData.put(
nominalTime,
multiHrsReports.get(nominalTime).getFogZoneTableData(
fogAlgCellType));
}
return multiHrsTblData;
}
for (Date nominalTime : multiHrsReports.keySet()) {
multiHrsTblData.put(nominalTime, multiHrsReports.get(nominalTime)
.getZoneTableData());
}
return multiHrsTblData;
public void setMultiHrsReports(
SortedMap<Date, ObHourReports> multiHrsReports) {
this.multiHrsReports = multiHrsReports;
}
/**
* Returns the latest nominal time if the map is not empty; otherwise,
* returns the nominal time of the present date-time
* Gets the Latest NominalTime Returns the latest nominal time if the map is
* not empty; otherwise, returns the nominal time of the present date-time
*
* @return
*/
@ -517,31 +507,39 @@ public class ObMultiHrsReports {
}
/**
* Returns a set of nominal times
* Gets Nominal Times
*
* @return
* @return a set of nominal times
*/
public Set<Date> getNominalTimes() {
return multiHrsReports.keySet();
}
/**
* Returns the ObHourReports object of the latest nominal time. If no data
* available, returns an empty ObHourReports object.
* Gets ObHourReports Returns the ObHourReports object of the latest nominal
* time. If no data available, returns an empty ObHourReports object.
*
* @return
*/
public ObHourReports getObHourReports() {
if (multiHrsReports.isEmpty()) {
return new ObHourReports(TableUtil.getNominalTime(SimulatedTime
.getSystemTime().getTime()), appName, thresholdMgr);
ObHourReports obHrsReps = new ObHourReports(
TableUtil.getNominalTime(SimulatedTime.getSystemTime()
.getTime()), appName, thresholdMgr);
// Save table data cache.
Date refTm = obHrsReps.getNominalTime();
TableData tabData = obHrsReps.getZoneTableData();
multiHrsTabData.clear();
multiHrsTabData.put(refTm, tabData);
return obHrsReps;
}
return multiHrsReports.get(multiHrsReports.lastKey());
}
/**
* Returns an ObHourReports object of a caller-specified nominal time. If no
* data available, returns an empty ObHourReports object.
* Gets ObHourReports Returns an ObHourReports object of a caller-specified
* nominal time. If no data available, returns an empty ObHourReports
* object.
*
* @param nominalTime
* @return
@ -574,6 +572,7 @@ public class ObMultiHrsReports {
}
/**
* Gets Threshold Manager
*
* @return the threshold manager
*/
@ -591,6 +590,7 @@ public class ObMultiHrsReports {
}
/**
* Gets map of types for ALG cell
*
* @return fogAlgCellType
*/
@ -603,11 +603,20 @@ public class ObMultiHrsReports {
*/
private void initFogAlgCellType() {
fogAlgCellType = new HashMap<String, CellType>();
Set<String> zones = MonitoringArea.getPlatformMap().keySet();
List<String> zones = cfgMgr.getAreaList();
Iterator<String> itr = zones.iterator();
while (itr.hasNext()) {
fogAlgCellType.put(itr.next(), CellType.NotAvailable);
}
setFogAlgCellType(fogAlgCellType);
}
/**
* Updates table cache
*/
public void updateTableCache() {
for (Date time : multiHrsReports.keySet()) {
getZoneTableData(time);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -29,6 +29,7 @@ import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.monitor.xml.AreaIdXML;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.CellType;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.ObsHistType;
@ -50,6 +51,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
* May 23, 2012 14410 zhao Modified getCellTypeForBlizWarn and getCellTypeForHsnowWarn modules
* Feb 28, 2013 14410 zhao Modified getCellTypeForBlizWarn
* May 23, 2014 3086 skorolev Corrected ObsHistType. Cleaned code.
* Sep 18, 2015 3873 skorolev Added coordinates in the hover text for a newly added zones.Corrected code for Fog and SNOW table data.
*
* </pre>
*
@ -110,13 +112,23 @@ public final class TableUtil {
isZone = true;
}
String hoverText = null;
DataUsageKey dataUsageKey;
if (tm.getDataUsageKey() != null) {
dataUsageKey = tm.getDataUsageKey();
} else {
dataUsageKey = DataUsageKey.DISPLAY;
}
String hoverText = "";
if (isZone) {
hoverText = getZoneHoverText(areaId);
AreaIdXML zoneXML = tm.areaConfigMgr.getAreaXml(zone);
if (zoneXML != null) {
hoverText = getZoneHoverText(zoneXML);
}
} else {
hoverText = getStationHoverText(areaId);
}
// zone or station ID
tblRowData.setTableCellData(0, new TableCellData(areaId, hoverText,
CellType.AreaId, false));
@ -131,14 +143,18 @@ public final class TableUtil {
visValue = visValue * 16.0f; // vis in units of "miles/16"; this is
// used to compare with Red/Yellow
// threshold values
String mccVIS = "";
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccVIS = MonitorConfigConstants.FogDisplay.FOG_DISP_METEO_VIS
.getXmlKey();
} else {
mccVIS = MonitorConfigConstants.FogMonitor.FOG_MONITOR_METEO_VIS
.getXmlKey();
}
TableCellData visCellData = new TableCellData(
visString,
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.FogDisplay.FOG_DISP_METEO_VIS
.getXmlKey(), visValue), true);
TableCellData visCellData = new TableCellData(visString,
tm.getThresholdValueCellType(dataUsageKey, zone, mccVIS,
visValue), true);
visCellData.setValue(visValue); // visValue, instead of visString,
// will be used for sorting
@ -320,7 +336,8 @@ public final class TableUtil {
* dialog)
* @param zone
* @param report
* @param tm Abstract Threshold Manager
* @param tm
* Abstract Threshold Manager
* @param fogCellType
* @return
*/
@ -336,9 +353,19 @@ public final class TableUtil {
isZone = true;
}
String hoverText = null;
DataUsageKey dataUsageKey;
if (tm.getDataUsageKey() != null) {
dataUsageKey = tm.getDataUsageKey();
} else {
dataUsageKey = DataUsageKey.DISPLAY;
}
String hoverText = "";
if (isZone) {
hoverText = getZoneHoverText(areaId);
AreaIdXML zoneXML = tm.areaConfigMgr.getAreaXml(zone);
if (zoneXML != null) {
hoverText = getZoneHoverText(zoneXML);
}
} else {
hoverText = getStationHoverText(areaId);
}
@ -390,42 +417,52 @@ public final class TableUtil {
.getXmlKey(), report
.getWindDir()), true));
}
String mccWind;
// wind speed
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccWind = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_WIND_WIND_SPEED
.getXmlKey();
} else {
mccWind = MonitorConfigConstants.SafeSeasMonitor.SS_MON_METEO_WIND_SPEED
.getXmlKey();
}
tblRowData.setTableCellData(
6,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
tm.getThresholdValueCellType(dataUsageKey, zone,
mccWind, report.getWindSpeed()), true));
tblRowData
.setTableCellData(
6,
new TableCellData(
Math.round(new Float(report.getWindSpeed())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_WIND_WIND_SPEED
.getXmlKey(), report
.getWindSpeed()), true));
// peak wind
String mccPeakWind;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccPeakWind = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_WIND_PEAK_WIND
.getXmlKey();
} else {
mccPeakWind = MonitorConfigConstants.SafeSeasMonitor.SS_MON_METEO_PEAK_WIND
.getXmlKey();
}
tblRowData.setTableCellData(
7,
new TableCellData(
Math.round(new Float(report.getMaxWindSpeed())), tm
.getThresholdValueCellType(dataUsageKey, zone,
mccPeakWind, report.getMaxWindSpeed()),
true));
// wind gust
String mccWindGust;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccWindGust = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_WIND_GUST_SPEED
.getXmlKey();
} else {
mccWindGust = MonitorConfigConstants.SafeSeasMonitor.SS_MON_METEO_GUST_SPEED
.getXmlKey();
}
tblRowData
.setTableCellData(
7,
new TableCellData(
Math.round(new Float(report.getMaxWindSpeed())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_WIND_PEAK_WIND
.getXmlKey(), report
.getMaxWindSpeed()), true));
tblRowData
.setTableCellData(
8,
new TableCellData(
Math.round(new Float(report.getWindGust())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_WIND_GUST_SPEED
.getXmlKey(), report
.getWindGust()), true));
tblRowData.setTableCellData(
8,
new TableCellData(Math.round(new Float(report.getWindGust())),
tm.getThresholdValueCellType(dataUsageKey, zone,
mccWindGust, report.getWindGust()), true));
// visibility
float visValue = report.getVisibility(); // vis value in miles (statute
@ -443,20 +480,25 @@ public final class TableUtil {
// to compare with Red/Yellow threshold
// values
TableCellData visCellData = new TableCellData(
visString,
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_VIS
.getXmlKey(), visValue), true);
String mccVis;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccVis = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_VIS
.getXmlKey();
} else {
mccVis = MonitorConfigConstants.SafeSeasMonitor.SS_MON_METEO_VIS
.getXmlKey();
}
TableCellData visCellData = new TableCellData(visString,
tm.getThresholdValueCellType(dataUsageKey, zone, mccVis,
visValue), true);
visCellData.setValue(visValue); // visValue, instead of visString,
// will be used for sorting
tblRowData.setTableCellData(9, visCellData);
}
// temperature
tblRowData
.setTableCellData(
10,
@ -468,7 +510,7 @@ public final class TableUtil {
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_TEMP
.getXmlKey(), report
.getTemperature()), true));
// dewpoint
tblRowData
.setTableCellData(
11,
@ -480,7 +522,7 @@ public final class TableUtil {
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_DEWPT
.getXmlKey(), report
.getDewpoint()), true));
// SLP
tblRowData
.setTableCellData(
12,
@ -492,7 +534,7 @@ public final class TableUtil {
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_SLP
.getXmlKey(), report
.getSeaLevelPress()), true));
// SST
tblRowData
.setTableCellData(
13,
@ -504,7 +546,7 @@ public final class TableUtil {
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_SST
.getXmlKey(), report
.getSeaSurfaceTemp()), true));
// wave height
tblRowData
.setTableCellData(
14,
@ -517,7 +559,7 @@ public final class TableUtil {
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_WAVE_HT
.getXmlKey(), report
.getHighResWaveHeight()), true));
// wave steep
tblRowData
.setTableCellData(
15,
@ -529,79 +571,102 @@ public final class TableUtil {
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_WAVE_STEEP
.getXmlKey(), report
.getWaveSteepness()), true));
tblRowData
.setTableCellData(
16,
new TableCellData(
Math.round(new Float(report.getPSwellHeight())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_PRIM_HT
.getXmlKey(), report
.getPSwellHeight()), true));
tblRowData
.setTableCellData(
17,
new TableCellData(
Math.round(new Float(report.getPSwellPeriod())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_PRIM_PD
.getXmlKey(), report
.getPSwellPeriod()), true));
tblRowData
.setTableCellData(
18,
new TableCellData(
Math.round(new Float(report.getPSwellDir())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_PRIM_DIR_FROM
.getXmlKey(), report
.getPSwellDir()), true));
tblRowData
.setTableCellData(
19,
new TableCellData(
Math.round(new Float(report.getSSwellHeight())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_SEC_HT
.getXmlKey(), report
.getSSwellHeight()), true));
tblRowData
.setTableCellData(
20,
new TableCellData(
Math.round(new Float(report.getSSwellPeriod())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_SEC_PD
.getXmlKey(), report
.getSSwellPeriod()), true));
// swell height
String mccSwell;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccSwell = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_PRIM_HT
.getXmlKey();
} else {
mccSwell = MonitorConfigConstants.SafeSeasMonitor.SS_MON_SWELL_PRIM_HT
.getXmlKey();
}
tblRowData.setTableCellData(
16,
new TableCellData(
Math.round(new Float(report.getPSwellHeight())), tm
.getThresholdValueCellType(dataUsageKey, zone,
mccSwell, report.getPSwellHeight()),
true));
// swell period
String mccSwellPD;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccSwellPD = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_PRIM_PD
.getXmlKey();
} else {
mccSwellPD = MonitorConfigConstants.SafeSeasMonitor.SS_MON_SWELL_PRIM_PD
.getXmlKey();
}
tblRowData.setTableCellData(
17,
new TableCellData(
Math.round(new Float(report.getPSwellPeriod())), tm
.getThresholdValueCellType(dataUsageKey, zone,
mccSwellPD, report.getPSwellPeriod()),
true));
// swell dir TODO: from only
String mccSwellDirFrom;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccSwellDirFrom = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_WIND_DIR_FROM
.getXmlKey();
} else {
mccSwellDirFrom = MonitorConfigConstants.SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM
.getXmlKey();
}
tblRowData.setTableCellData(
18,
new TableCellData(Math.round(new Float(report.getPSwellDir())),
tm.getThresholdValueCellType(dataUsageKey, zone,
mccSwellDirFrom, report.getPSwellDir()), true));
// swell2 height
String mccSwell2HT;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccSwell2HT = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_SEC_HT
.getXmlKey();
} else {
mccSwell2HT = MonitorConfigConstants.SafeSeasMonitor.SS_MON_SWELL_SEC_HT
.getXmlKey();
}
tblRowData.setTableCellData(
19,
new TableCellData(
Math.round(new Float(report.getSSwellPeriod())), tm
.getThresholdValueCellType(dataUsageKey, zone,
mccSwell2HT, report.getSSwellPeriod()),
true));
// swell2 period
String mccSwell2PD;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccSwell2PD = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_SEC_PD
.getXmlKey();
} else {
mccSwell2PD = MonitorConfigConstants.SafeSeasMonitor.SS_MON_SWELL_SEC_PD
.getXmlKey();
}
tblRowData.setTableCellData(
20,
new TableCellData(
Math.round(new Float(report.getSSwellPeriod())), tm
.getThresholdValueCellType(dataUsageKey, zone,
mccSwell2PD, report.getSSwellPeriod()),
true));
// swell2 dir TODO: only from
String mccSwell2DirFrom;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccSwell2DirFrom = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_SEC_DIR_FROM
.getXmlKey();
} else {
mccSwell2DirFrom = MonitorConfigConstants.SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM
.getXmlKey();
}
tblRowData
.setTableCellData(
21,
new TableCellData(
Math.round(new Float(report.getPSwellDir())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_SWELL_SEC_DIR_FROM
.getXmlKey(), report
.getSSwellDir()), true));
new TableCellData(Math.round(new Float(report
.getPSwellDir())),
tm.getThresholdValueCellType(dataUsageKey,
zone, mccSwell2DirFrom,
report.getSSwellDir()), true));
// fog
if (isZone) {
// zone table: fog monitored at zone level
tblRowData.setTableCellData(22, new TableCellData("", fogCellType,
@ -637,9 +702,19 @@ public final class TableUtil {
isZone = true;
}
String hoverText = null;
DataUsageKey dataUsageKey;
if (tm.getDataUsageKey() != null) {
dataUsageKey = tm.getDataUsageKey();
} else {
dataUsageKey = DataUsageKey.DISPLAY;
}
String hoverText = "";
if (isZone) {
hoverText = getZoneHoverText(areaId);
AreaIdXML zoneXML = tm.areaConfigMgr.getAreaXml(zone);
if (zoneXML != null) {
hoverText = getZoneHoverText(zoneXML);
}
} else {
hoverText = getStationHoverText(areaId);
}
@ -704,54 +779,64 @@ public final class TableUtil {
.getXmlKey(), report
.getWindDir()), true));
}
tblRowData
.setTableCellData(
6,
new TableCellData(
Math.round(new Float(report.getWindSpeed())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_WIND_SPEED
.getXmlKey(), report
.getWindSpeed()), true));
tblRowData
.setTableCellData(
7,
new TableCellData(
Math.round(new Float(report.getMaxWindSpeed())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_PEAK_WIND
.getXmlKey(), report
.getMaxWindSpeed()), true));
tblRowData
.setTableCellData(
8,
new TableCellData(
Math.round(new Float(report.getWindGust())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_GUST_SPEED
.getXmlKey(), report
.getWindGust()), true));
tblRowData
.setTableCellData(
9,
new TableCellData(
Math.round(new Float(report.getTemperature())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_TEMP
.getXmlKey(), report
.getTemperature()), true));
// wind speed
String wsk;
if (dataUsageKey == DataUsageKey.DISPLAY) {
wsk = MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_WIND_SPEED
.getXmlKey();
} else {
wsk = MonitorConfigConstants.SnowMonitor.SNOW_MON_METEO_WIND_SPEED
.getXmlKey();
}
tblRowData.setTableCellData(
6,
new TableCellData(Math.round(new Float(report.getWindSpeed())),
tm.getThresholdValueCellType(dataUsageKey, zone, wsk,
report.getWindSpeed()), true));
// wind peak
String wpk;
if (dataUsageKey == DataUsageKey.DISPLAY) {
wpk = MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_PEAK_WIND
.getXmlKey();
} else {
wpk = MonitorConfigConstants.SnowMonitor.SNOW_MON_METEO_PEAK_WIND
.getXmlKey();
}
tblRowData.setTableCellData(
7,
new TableCellData(
Math.round(new Float(report.getMaxWindSpeed())), tm
.getThresholdValueCellType(dataUsageKey, zone,
wpk, report.getMaxWindSpeed()), true));
// wind gust
String wgk;
if (dataUsageKey == DataUsageKey.DISPLAY) {
wgk = MonitorConfigConstants.SnowDisplay.SNOW_DISP_WIND_GUST_SPEED
.getXmlKey();
} else {
wgk = MonitorConfigConstants.SnowMonitor.SNOW_MON_METEO_GUST_SPEED
.getXmlKey();
}
tblRowData.setTableCellData(
8,
new TableCellData(Math.round(new Float(report.getWindGust())),
tm.getThresholdValueCellType(dataUsageKey, zone, wgk,
report.getWindGust()), true));
// temperature
String tmprk;
if (dataUsageKey == DataUsageKey.DISPLAY) {
tmprk = MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_TEMP
.getXmlKey();
} else {
tmprk = MonitorConfigConstants.SnowMonitor.SNOW_MON_METEO_TEMP
.getXmlKey();
}
tblRowData.setTableCellData(
9,
new TableCellData(
Math.round(new Float(report.getTemperature())), tm
.getThresholdValueCellType(dataUsageKey, zone,
tmprk, report.getTemperature()), true));
tblRowData
.setTableCellData(
@ -777,13 +862,17 @@ public final class TableUtil {
// used to compare with Red/Yellow
// threshold values
TableCellData visCellData = new TableCellData(
visString,
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
zone,
MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_VIS
.getXmlKey(), visValue), true);
String visKey;
if (dataUsageKey == DataUsageKey.DISPLAY) {
visKey = MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_VIS
.getXmlKey();
} else {
visKey = MonitorConfigConstants.SnowMonitor.SNOW_MON_METEO_VIS
.getXmlKey();
}
TableCellData visCellData = new TableCellData(visString,
tm.getThresholdValueCellType(dataUsageKey, zone, visKey,
visValue), true);
visCellData.setValue(visValue); // visValue, instead of visString,
// will be used for sorting
@ -802,14 +891,14 @@ public final class TableUtil {
MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_SLP
.getXmlKey(), report
.getSeaLevelPress()), true));
// wind chill
tblRowData
.setTableCellData(
13,
new TableCellData(
Math.round(new Float(report.getWindChill())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
dataUsageKey,
zone,
MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_WIND_CHILL
.getXmlKey(), report
@ -838,14 +927,14 @@ public final class TableUtil {
MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP
.getXmlKey(), report
.getHourlyPrecip()), true));
// snow depth
tblRowData
.setTableCellData(
16,
new TableCellData(
Math.round(new Float(report.getSnowDepth())),
tm.getThresholdValueCellType(
DataUsageKey.DISPLAY,
dataUsageKey,
zone,
MonitorConfigConstants.SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH
.getXmlKey(), report
@ -884,8 +973,9 @@ public final class TableUtil {
* @param zone
* @return
*/
private static String getZoneHoverText(String zone) {
private static String getZoneHoverText(AreaIdXML zoneXML) {
String zone = zoneXML.getAreaId();
ISpatialQuery sq = null;
String sql = null;
String hoverText = zone.substring(0, 2) + ", ";
@ -914,6 +1004,11 @@ public final class TableUtil {
} else {
hoverText += (String) results[0].toString();
}
} else {
if (zoneXML.getCLat() != null) {
hoverText += "(" + zoneXML.getCLat() + ", "
+ zoneXML.getCLon() + ")";
}
}
} catch (Exception e) {
e.printStackTrace();
@ -956,6 +1051,8 @@ public final class TableUtil {
} else if (stnType.intValue() == 1000) {
hoverText = stnId + "#MESONET -- " + stnName;
}
} else {
hoverText = stnId;
}
} catch (Exception e) {
@ -976,7 +1073,7 @@ public final class TableUtil {
*/
public static CellType getCellTypeForSCA(String zone, ObReport report,
AbstractThresholdMgr tm) {
// TODO:
float windSpd = report.getWindSpeed();
float windGust = report.getWindGust();
float waveHgt = report.getHighResWaveHeight();
@ -1027,7 +1124,7 @@ public final class TableUtil {
*/
public static CellType getCellTypeForGaleWarn(String zone, ObReport report,
AbstractThresholdMgr tm) {
// TODO:
CellType type = CellType.NotAvailable;
CellType windSpeedType = tm
.getThresholdValueCellType(
@ -1064,7 +1161,7 @@ public final class TableUtil {
*/
public static CellType getCellTypeForStormWarn(String zone,
ObReport report, AbstractThresholdMgr tm) {
// TODO:
CellType type = CellType.NotAvailable;
CellType windSpeedType = tm
.getThresholdValueCellType(
@ -1101,7 +1198,7 @@ public final class TableUtil {
*/
public static CellType getCellTypeForHFWW(String zone, ObReport report,
AbstractThresholdMgr tm) {
// TODO:
CellType type = CellType.NotAvailable;
CellType windSpeedType = tm
.getThresholdValueCellType(
@ -1138,16 +1235,31 @@ public final class TableUtil {
*/
public static CellType getCellTypeForFog(String zone, ObReport report,
AbstractThresholdMgr tm) {
// TODO:
float visValue = report.getVisibility();// in miles
if (visValue == ObConst.MISSING) {
return CellType.NotAvailable;
}
visValue = visValue / milesPerNauticalMile; // in nautical miles
return tm.getThresholdValueCellType(DataUsageKey.DISPLAY, zone,
MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_VIS
.getXmlKey(), visValue);
CellType retVal = CellType.NotAvailable;
DataUsageKey dataUsageKey;
if (tm.getDataUsageKey() != null) {
dataUsageKey = tm.getDataUsageKey();
} else {
dataUsageKey = DataUsageKey.DISPLAY;
}
float visValue = report.getVisibility();// in miles
if (visValue != ObConst.MISSING) {
visValue = visValue / milesPerNauticalMile; // in nautical miles
String mccSafeseas;
if (dataUsageKey == DataUsageKey.DISPLAY) {
mccSafeseas = MonitorConfigConstants.SafeSeasDisplay.SS_DISP_METEO_VIS
.getXmlKey();
} else {
mccSafeseas = MonitorConfigConstants.SafeSeasMonitor.SS_MON_METEO_VIS
.getXmlKey();
}
retVal = tm.getThresholdValueCellType(dataUsageKey, zone,
mccSafeseas, visValue);
}
return retVal;
}
/**
@ -1332,7 +1444,6 @@ public final class TableUtil {
CellType type = CellType.NotAvailable; // default, assuming no
// observation available
CellType snowDepth = tm
.getThresholdValueCellType(
DataUsageKey.DISPLAY,
@ -1670,5 +1781,5 @@ public final class TableUtil {
CommonTableConfig.obsHistCols.PTend));
return tblRowData;
}
// TODO: add MESONET data
}

View file

@ -19,7 +19,7 @@
**/
package com.raytheon.uf.viz.monitor.listeners;
import com.raytheon.uf.viz.core.notification.INotificationObserver;
import com.raytheon.uf.common.jms.notification.INotificationObserver;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
/**
@ -32,6 +32,8 @@ import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 29, 2009 dhladky Initial creation
* Sep 20, 2015 3873 skorolev Replaced deprecated INotificationObserver
*
* </pre>
*
* @author dhladky

View file

@ -31,8 +31,13 @@ import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
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.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.CellType;
import com.raytheon.uf.viz.monitor.filename.DefaultFilenameMgr;
@ -53,6 +58,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* Mar 22, 2010 #4282 zhao obtain zone IDs from monitoring-area-config-manager
* Feb 16, 2011 #7346 zhao added getDirectionalThresholdValueCellType(...)
* Apr 28, 2014 3086 skorolev Updated getAreaConfigMgr method.
* Sep 18, 2015 3873 skorolev Added getCfgMgr().
*
* </pre>
*
@ -61,25 +67,28 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
*/
public abstract class AbstractThresholdMgr {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(AbstractThresholdMgr.class);
/**
* Monitor Area Configuration Manager.
*/
protected FSSObsMonitorConfigurationManager areaConfigMgr;
public FSSObsMonitorConfigurationManager areaConfigMgr;
/**
* Default file name for the FOG display thresholds.
* Default file name for the display thresholds.
*/
private String defDisplayThreshName = "Unknown";
/**
* Default file name for the FOG monitor thresholds.
* Default file name for the monitor thresholds.
*/
private String defMonitorThreshName = "Unknown";
/**
* Application name that will be the starting path for the XML data.
*/
private final String appName;
private final AppName appName;
/**
* Full path and file name for the current FOG display file.
@ -117,10 +126,8 @@ public abstract class AbstractThresholdMgr {
/** current site **/
protected String site;
/*
* TODO : remove this when debugging is complete
*/
public ThresholdsXML threshXmlCopy;
/** threshold usage **/
protected DataUsageKey dataUsageKey;
/**
* Constructor.
@ -129,12 +136,12 @@ public abstract class AbstractThresholdMgr {
* @param defMonitorThreshName
*/
public AbstractThresholdMgr(String defDisplayThreshName,
String defMonitorThreshName, String appName) {
String defMonitorThreshName, AppName appName) {
this.defDisplayThreshName = defDisplayThreshName;
this.defMonitorThreshName = defMonitorThreshName;
this.appName = appName;
this.site = LocalizationManager.getInstance().getCurrentSite();
this.areaConfigMgr = getMonitorAreaConfigInstance();
this.areaConfigMgr = getCfgMgr();
}
/**
@ -148,7 +155,7 @@ public abstract class AbstractThresholdMgr {
defaultFileNameMgr.readXmlConfig();
/*
* Setup the Fog display threshold manager
* Setup the display threshold manager
*/
if (defaultFileNameMgr.getDefaultThresholdFilename() != null
&& defaultFileNameMgr.getDefaultThresholdFilename().length() > 0) {
@ -175,7 +182,7 @@ public abstract class AbstractThresholdMgr {
}
/*
* Setup the Fog monitor threshold manager
* Setup the monitor threshold manager
*/
currFullMonitorXmlFileName = getMonitorThresholdPath()
+ defMonitorThreshName;
@ -201,7 +208,7 @@ public abstract class AbstractThresholdMgr {
LocalizationFile locFile = pm.getLocalizationFile(context,
pathAndFileName);
System.out.println("--- validate path = "
statusHandler.handle(Priority.DEBUG, "--- validate path = "
+ locFile.getFile().getAbsolutePath());
return locFile.getFile().exists();
@ -235,7 +242,6 @@ public abstract class AbstractThresholdMgr {
return monitorThreshMgr.getYellowValue(areaID, key);
}
}
return 0;
}
@ -284,30 +290,24 @@ public abstract class AbstractThresholdMgr {
if (hasArea(areaID, dataUsage) == false) {
return CellType.NotMonitored;
}
if (Double.isNaN(value) == true) {
return CellType.NotMonitored;
}
if (value == ObConst.MISSING) {
return CellType.NotAvailable;
}
double red = Double.NaN;
double yellow = Double.NaN;
if (dataUsage == DataUsageKey.DISPLAY) {
red = displayThreshMgr.getRedValue(areaID, key);
yellow = displayThreshMgr.getYellowValue(areaID, key);
return calcCellType(key, red, yellow, value);
} else if (dataUsage == DataUsageKey.MONITOR) {
red = monitorThreshMgr.getRedValue(areaID, key);
yellow = monitorThreshMgr.getYellowValue(areaID, key);
return calcCellType(key, red, yellow, value);
}
return CellType.NotMonitored;
}
@ -328,11 +328,9 @@ public abstract class AbstractThresholdMgr {
if (hasArea(areaID, dataUsage) == false) {
return CellType.NotMonitored;
}
if (Double.isNaN(value) == true) {
return CellType.NotMonitored;
}
if (value == ObConst.MISSING) {
return CellType.NotAvailable;
}
@ -357,7 +355,6 @@ public abstract class AbstractThresholdMgr {
return calcDirectionalCellType(redFrom, redTo, yellowFrom,
yellowTo, value);
}
return CellType.NotMonitored;
}
@ -379,25 +376,21 @@ public abstract class AbstractThresholdMgr {
return CellType.R;
}
}
if (redFrom > redTo) {
if (value > redFrom || value < redTo) {
return CellType.R;
}
}
if (yellowFrom < yellowTo) {
if (value > yellowFrom && value < yellowTo) {
return CellType.Y;
}
}
if (yellowFrom > yellowTo) {
if (value > yellowFrom || value < yellowTo) {
return CellType.Y;
}
}
return CellType.G;
}
@ -427,7 +420,6 @@ public abstract class AbstractThresholdMgr {
} else if (value <= yellow) {
return CellType.Y;
}
return CellType.G;
} else {
if (value < yellow) {
@ -435,7 +427,6 @@ public abstract class AbstractThresholdMgr {
} else if (value <= red) {
return CellType.Y;
}
return CellType.R;
}
} else if (redIsHigher == true) {
@ -444,7 +435,6 @@ public abstract class AbstractThresholdMgr {
} else if (value < red) {
return CellType.Y;
}
return CellType.R;
} else if (redIsHigher == false) {
if (value <= red) {
@ -452,10 +442,8 @@ public abstract class AbstractThresholdMgr {
} else if (value <= yellow) {
return CellType.Y;
}
return CellType.G;
}
return CellType.NotMonitored;
}
@ -472,11 +460,9 @@ public abstract class AbstractThresholdMgr {
+ defDisplayThreshName;
return;
}
if (fileName.endsWith(".xml") == false) {
fileName.concat(".xml");
}
if (fileName.compareTo(defDisplayThreshName) == 0) {
defaultFileNameMgr.setDefaultThresholdFilename("");
} else {
@ -495,9 +481,7 @@ public abstract class AbstractThresholdMgr {
loadDefaultDisplayThreshold();
return;
}
currFullDisplayXmlFileName = getDisplayThresholdPath() + fileName;
displayThreshMgr.setFullPathFileName(currFullDisplayXmlFileName);
displayThreshMgr.readThresholdXml();
}
@ -511,23 +495,18 @@ public abstract class AbstractThresholdMgr {
if (filename == null || filename.trim().length() == 0) {
currFullDisplayXmlFileName = getDisplayThresholdPath()
+ defDisplayThreshName;
List<String> areaIDs = null;
try {
areaIDs = areaConfigMgr.getAreaList();
} catch (Exception e) {
e.printStackTrace();
return;
}
// Sort the area IDs
Collections.sort(areaIDs);
ArrayList<String> threshKeys = getThresholdKeys(DataUsageKey.DISPLAY);
System.out.println("---- " + currFullDisplayXmlFileName);
statusHandler.handle(Priority.DEBUG, "---- "
+ currFullDisplayXmlFileName);
displayThreshMgr.createConfigFromDefaults(
currFullDisplayXmlFileName, areaIDs, threshKeys);
} else {
@ -543,21 +522,16 @@ public abstract class AbstractThresholdMgr {
public void loadDefaultMonitorThreshold() {
currFullMonitorXmlFileName = getMonitorThresholdPath()
+ defMonitorThreshName;
List<String> areaIDs = null;
try {
areaIDs = areaConfigMgr.getAreaList();
} catch (Exception e) {
e.printStackTrace();
return;
}
// Sort the area IDs
Collections.sort(areaIDs);
ArrayList<String> threshKeys = getThresholdKeys(DataUsageKey.MONITOR);
monitorThreshMgr.createConfigFromDefaults(currFullMonitorXmlFileName,
areaIDs, threshKeys);
}
@ -572,9 +546,7 @@ public abstract class AbstractThresholdMgr {
if (newFileName.trim().compareTo(defDisplayThreshName) == 0) {
return;
}
currFullDisplayXmlFileName = getDisplayThresholdPath() + newFileName;
displayThreshMgr.setFullPathFileName(currFullDisplayXmlFileName);
displayThreshMgr.saveThresholdXml();
}
@ -601,7 +573,6 @@ public abstract class AbstractThresholdMgr {
if (usageKey == DataUsageKey.DISPLAY) {
return defDisplayThreshName;
}
// Return the Monitor threshold file name as the default.
return defMonitorThreshName;
}
@ -616,61 +587,60 @@ public abstract class AbstractThresholdMgr {
return defaultFileNameMgr.getDefaultThresholdFilename();
}
/**
* Gets Thresholds XML Data
*
* @param usageKey
* @return
*/
public ThresholdsXML getThresholdsXmlData(DataUsageKey usageKey) {
if (usageKey == DataUsageKey.DISPLAY) {
return displayThreshMgr.getThresholdXML();
}
return monitorThreshMgr.getThresholdXML();
}
/**
* Get the path where the display thresholds XML files are contained.
* Gets the path where the display thresholds XML files are contained.
*
* @return File path.
*/
public String getDisplayThresholdPath() {
String fs = String.valueOf(File.separatorChar);
StringBuilder sb = new StringBuilder();
sb.append(appName).append(fs);
sb.append(appName.name().toLowerCase()).append(fs);
sb.append("threshold").append(fs);
sb.append("display").append(fs);
return sb.toString();
}
/**
* Get the path where the monitor thresholds XML files are contained.
* Gets the path where the monitor thresholds XML files are contained.
*
* @return File path.
*/
public String getMonitorThresholdPath() {
String fs = String.valueOf(File.separatorChar);
StringBuilder sb = new StringBuilder();
sb.append(appName).append(fs);
sb.append(appName.name().toLowerCase()).append(fs);
sb.append("threshold").append(fs);
sb.append("monitor").append(fs);
return sb.toString();
}
/**
* Get the path where the XML file containing the user selected default file
* is located.
* Gets the path where the XML file containing the user selected default
* file is located.
*
* @return The path of the user selected default file XML.
*/
public String getDefaultThresholdFilePath() {
String fs = String.valueOf(File.separatorChar);
StringBuilder sb = new StringBuilder();
sb.append(appName).append(fs);
sb.append(appName.name().toLowerCase()).append(fs);
sb.append("threshold").append(fs);
sb.append("display").append(fs);
sb.append("defaultThresh").append(fs);
return sb.toString();
}
@ -686,7 +656,6 @@ public abstract class AbstractThresholdMgr {
} else if (dataUsageKey == DataUsageKey.MONITOR) {
return monitorThreshMgr.getThresholdsXmlCopy();
}
return null;
}
@ -698,7 +667,6 @@ public abstract class AbstractThresholdMgr {
*/
public boolean deleteFile(LocalizationFile fileName) {
boolean deletedUserSelectedDefault = false;
String fileNameStr = fileName.getFile().getName();
/*
@ -712,7 +680,6 @@ public abstract class AbstractThresholdMgr {
loadDefaultDisplayThreshold();
deletedUserSelectedDefault = true;
}
/*
* Delete the file.
*/
@ -721,7 +688,6 @@ public abstract class AbstractThresholdMgr {
} catch (Exception e) {
e.printStackTrace();
}
return deletedUserSelectedDefault;
}
@ -736,7 +702,6 @@ public abstract class AbstractThresholdMgr {
if (dataUsageKey == DataUsageKey.DISPLAY) {
return displayThreshMgr.getThresholdXML().hasAreaId(areaID);
}
return monitorThreshMgr.getThresholdXML().hasAreaId(areaID);
}
@ -764,34 +729,17 @@ public abstract class AbstractThresholdMgr {
ArrayList<AreaXML> areasArray = displayXML.getAreas();
for (AreaXML area : areasArray) {
System.out.println("--- " + area.getAreaId());
statusHandler.handle(Priority.DEBUG, "--- " + area.getAreaId());
ArrayList<AreaThresholdXML> atXmlArray = area.getAreaThresholds();
for (AreaThresholdXML atXml : atXmlArray) {
System.out.println("****** " + atXml.getKey());
System.out.println(" R " + atXml.getRed());
System.out.println(" Y " + atXml.getYellow());
}
}
}
public void printDisplayThresholdsXMLCopy() {
if (threshXmlCopy == null) {
threshXmlCopy = displayThreshMgr.getThresholdsXmlCopy();
}
ArrayList<AreaXML> areasArray = threshXmlCopy.getAreas();
for (AreaXML area : areasArray) {
System.out.println("--- " + area.getAreaId());
ArrayList<AreaThresholdXML> atXmlArray = area.getAreaThresholds();
for (AreaThresholdXML atXml : atXmlArray) {
System.out.println("****** " + atXml.getKey());
System.out.println(" R " + atXml.getRed());
System.out.println(" Y " + atXml.getYellow());
statusHandler.handle(Priority.DEBUG,
"****** " + atXml.getKey());
statusHandler.handle(Priority.DEBUG,
" R " + atXml.getRed());
statusHandler.handle(Priority.DEBUG,
" Y " + atXml.getYellow());
}
}
}
@ -801,6 +749,37 @@ public abstract class AbstractThresholdMgr {
*
* @return manager
*/
protected abstract FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance();
public FSSObsMonitorConfigurationManager getCfgMgr() {
FSSObsMonitorConfigurationManager mgr = null;
switch (this.appName) {
case FOG:
mgr = FSSObsMonitorConfigurationManager.getInstance(MonName.fog);
break;
case SAFESEAS:
mgr = FSSObsMonitorConfigurationManager.getInstance(MonName.ss);
break;
case SNOW:
mgr = FSSObsMonitorConfigurationManager.getInstance(MonName.snow);
break;
default:
statusHandler.error("Unable to handle unknown appName: "
+ this.appName);
break;
}
return mgr;
}
/**
* @return
*/
public DataUsageKey getDataUsageKey() {
return dataUsageKey;
}
/**
* @param dataUsageKey
*/
public void setDataUsageKey(DataUsageKey dataUsageKey) {
this.dataUsageKey = dataUsageKey;
}
}

View file

@ -50,6 +50,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* ------------ ---------- ----------- --------------------------
* Dec 15, 2009 #3963 lvenable Initial creation
* Dec 4, 2012 #1351 skorolev Cleaned code
* Sep 18, 2015 #3873 skorolev Added error message for corrupted or empty default threshold file.
*
* </pre>
*
@ -86,10 +87,11 @@ public class ThresholdMgr {
*/
public void readThresholdXml() {
try {
cfgXML = null;
ThresholdsXML newCfgXML = null;
IPathManager pm = PathManagerFactory.getPathManager();
File path = pm.getStaticFile(currFullPathAndFileName);
cfgXML = JAXB.unmarshal(path, ThresholdsXML.class);
newCfgXML = JAXB.unmarshal(path, ThresholdsXML.class);
this.setThresholdXML(newCfgXML);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR, e.getMessage());
}
@ -145,7 +147,11 @@ public class ThresholdMgr {
ThresholdsXML.class);
createXmlFromDefaults(cfgXmlDefaults, areaIDs, keys);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR, e.getMessage());
statusHandler
.handle(Priority.ERROR,
"Default threshold configuration file "
+ fullDefaultPathName
+ " is corrupted.\nDelete the files in the folder on the server side and restart CAVE.");
return false;
}
return true;

View file

@ -19,6 +19,7 @@
**/
package com.raytheon.uf.viz.monitor.ui.dialogs;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@ -42,10 +43,12 @@ import org.eclipse.swt.widgets.Scale;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import com.raytheon.uf.common.localization.exception.LocalizationException;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.xml.AreaIdXML.ZoneType;
import com.raytheon.uf.common.serialization.SerializationException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -79,6 +82,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Oct 27, 2014 3667 skorolev Corrected functionality of dialog. Cleaned code.
* Nov 12, 2014 3650 skorolev Added confirmation box for unsaved changes in the dialog.
* Mar 08, 2015 3888 dhladky Restored threshold pop-up when adding new stations/zones.
* Sep 18, 2015 3873 skorolev Added formIsValid method.
*
* </pre>
*
@ -230,6 +234,23 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
/** Flag set when user wants to close with unsaved modifications. */
protected boolean closeFlag = false;
private final static String INVALID_AREA_MSG = "Invalid Area ID = '%s' entered.\n"
+ "Please enter a correctly formatted Area ID:\n"
+ "Zone ID must have six characters.\n"
+ "A third character should be C for county and Z for marine zone.\n"
+ "Use only capital characters.";
private final static String INVALID_COORD_MSG = "Invalid Lat/Lon entered:\n"
+ "Latitude = '%s'\n"
+ "Longitude = '%s'\n"
+ "Please enter correctly formatted Lat and Lon values:\n"
+ "Latitude should be between -90,90.\n"
+ "Longitude should be between -180,180.";
private final static String MODIFY_THRESHOLD_MSG = "New zones have been added, and their monitoring thresholds "
+ "have been set to default values; would you like to modify "
+ "their threshold values now?";
/**
* Constructor.
*
@ -782,7 +803,13 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
okBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
handleOkBtnSelection();
try {
handleOkBtnSelection();
} catch (LocalizationException | SerializationException
| IOException e) {
statusHandler.handle(Priority.PROBLEM,
"There is a problem saving changes. ", e);
}
}
});
@ -878,6 +905,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
* Handles the Add New button click.
*/
private void handleAddNewAction() {
// Zone configure
if (zoneRdo.getSelection() == true) {
if (addNewZoneDlg == null) {
addNewZoneDlg = new AddNewZoneDlg(shell, appName, this);
@ -893,9 +921,9 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
});
}
addNewZoneDlg.open();
} else {
if (associatedList.getSelectionIndex() != -1) {
String area = associatedList.getItem(associatedList
} else { // Station configure
if (maRegionalList.getSelectionIndex() != -1) {
String area = maRegionalList.getItem(maRegionalList
.getSelectionIndex());
if (addNewStnDlg == null) {
addNewStnDlg = new AddNewStationDlg(shell, appName, area,
@ -916,9 +944,9 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
MessageBox messageBox = new MessageBox(shell,
SWT.ICON_INFORMATION | SWT.NONE);
messageBox.setText("Selection error.");
messageBox.setMessage("Please select associated zone.");
messageBox.setMessage("Please select a monitoring zone.");
messageBox.open();
associatedList.select(0);
maRegionalList.select(0);
}
}
}
@ -935,8 +963,6 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
public void dialogClosed(Object returnValue) {
if (returnValue instanceof String) {
// Update the edit dialog
String selectedZone = returnValue.toString();
maZones.remove(selectedZone);
populateLeftLists();
}
editDlg = null;
@ -1096,7 +1122,6 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
monitorAreaList
.setItems(maZones.toArray(new String[maZones.size()]));
monitorAreaList.setSelection(maZones.indexOf(zone));
handleMonitorAreaListSelection();
additionalZones.remove(zone);
configMgr.addArea(zone, zone.charAt(2) == 'Z' ? ZoneType.MARITIME
: ZoneType.REGULAR);
@ -1104,6 +1129,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
configMgr.getAddedZones().add(zone);
}
configMgr.removeAdjArea(zone);
handleMonitorAreaListSelection();
} else { // Station mode
if (associatedList.getSelectionCount() == 0) {
showMessage(shell, SWT.ERROR, "Selection Needed",
@ -1148,6 +1174,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
monitorAreaList.remove(monitorAreaList.getSelectionIndex());
associatedList.removeAll();
if (mode == Mode.Zone) {
// entry is a zone to remove.
if (!additionalZones.contains(entry)) {
additionalZones.add(entry);
}
@ -1165,6 +1192,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
entry.charAt(2) == 'Z' ? ZoneType.MARITIME
: ZoneType.REGULAR);
} else { // Station mode
// entry is a station to remove.
additionalStns.add(entry);
Collections.sort(additionalStns);
additionalList.setItems(additionalStns
@ -1307,7 +1335,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
* Handles the monitor area list selection.
*/
private void handleMonitorAreaListSelection() {
if (monitorAreaList.getSelectionIndex() == -1) {
if (monitorAreaList.getSelectionIndex() < 0) {
return;
}
if (mode == Mode.Zone) {
@ -1343,11 +1371,15 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
}
/**
* Reset and Saving configuration parameters.
* Save configuration parameters.
*
* @throws SerializationException
* @throws LocalizationException
* @throws IOException
*/
protected void resetAndSave() {
protected void saveConfigs() throws LocalizationException,
SerializationException, IOException {
getValues();
resetStatus();
configMgr.saveConfigXml();
configMgr.saveAdjacentAreaConfigXml();
}
@ -1363,8 +1395,13 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
/**
* Handles OK button. Save changes and close the dialog (or just close if
* there are no changes).
*
* @throws IOException
* @throws SerializationException
* @throws LocalizationException
*/
protected abstract void handleOkBtnSelection();
protected abstract void handleOkBtnSelection()
throws LocalizationException, SerializationException, IOException;
/**
* Adds a new zone to monitor area and refresh GUI
@ -1416,6 +1453,21 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
return false;
}
public boolean formIsValid(String area, String latString, String lonString) {
boolean retVal = true;
if (area.equals("") || area.length() != 6
|| (area.charAt(2) != 'C' && area.charAt(2) != 'Z')) {
displayInputErrorMsg(String.format(INVALID_AREA_MSG, area));
retVal = false;
}
if (latString == null || latString.isEmpty() || lonString == null
|| lonString.isEmpty()) {
latLonErrorMsg(latString, lonString);
retVal = false;
}
return retVal;
}
/*
* (non-Javadoc)
*
@ -1465,16 +1517,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
public void latLonErrorMsg(String latStr, String lonStr) {
MessageBox messageBox = new MessageBox(shell, SWT.ICON_INFORMATION
| SWT.OK);
messageBox.setText("Invalid Lat/Lon");
StringBuilder errMsg = new StringBuilder("Invalid Lat/Lon entered:");
errMsg.append("\nLatitude = ");
errMsg.append(latStr);
errMsg.append("\nLongitude = ");
errMsg.append(lonStr);
errMsg.append("\nPlease enter correctly formatted Lat and Lon values:");
errMsg.append("\nLatitude should be between -90,90.");
errMsg.append("\nLongitude should be between -180,180.");
messageBox.setMessage(errMsg.toString());
messageBox.setMessage(INVALID_COORD_MSG);
messageBox.open();
}
@ -1482,7 +1525,6 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
* Reset data status.
*/
protected void resetStatus() {
this.timeWindowChanged = false;
this.maZonesRemoved = false;
this.maStationsRemoved = false;
@ -1512,11 +1554,8 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
* @return
*/
protected int editDialog() {
String message = "New zones have been added, and their monitoring thresholds "
+ "have been set to default values; would you like to modify "
+ "their threshold values now?";
int yesno = showMessage(shell, SWT.ICON_QUESTION | SWT.YES | SWT.NO,
"Edit Thresholds Now?", message);
"Edit Thresholds Now?", MODIFY_THRESHOLD_MSG);
return yesno;
}
@ -1538,6 +1577,35 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
return state;
}
public java.util.List<String> getMaZones() {
return maZones;
}
public java.util.List<String> getMaStations() {
return maStations;
}
public java.util.List<String> getAdditionalZones() {
return additionalZones;
}
public java.util.List<String> getAdditionalStns() {
return additionalStns;
}
/**
* Displays Input Error Message
*
* @param msg
*/
public void displayInputErrorMsg(String msg) {
MessageBox messageBox = new MessageBox(shell, SWT.ICON_INFORMATION
| SWT.OK);
messageBox.setText("Invalid input");
messageBox.setMessage(msg);
messageBox.open();
}
/**
* Gets Configuration manager.
*

View file

@ -54,7 +54,10 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.core.map.IMapDescriptor;
import com.raytheon.uf.viz.monitor.IMonitor;
@ -96,6 +99,7 @@ import com.vividsolutions.jts.io.ParseException;
* May 15, 2014 3086 skorolev Replaced MonitorConfigurationManager with FSSObsMonitorConfigurationManager.
* Sep 15, 2014 3220 skorolev Added refreshZoneTableData method.
* Nov 03, 2014 3741 skorolev Updated zoom procedures.
* Sep 25, 2015 3873 skorolev Added center definition for moving platforms.
*
* </pre>
*
@ -191,6 +195,8 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
private final DateFormat dFormat = new SimpleDateFormat(
"E MMM dd HH:mm:ss yyyy");
public static String datePattern = "yyyy-MM-dd HH:mm:ss";
/** list of variables to plot. **/
public List<String> prodArray;
@ -653,6 +659,7 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
initiateProdArray();
dlgTitle = getTrendPlotName(prodArray) + " Trend Plot for " + station
+ "#" + dataSrc;
if (graphType == GraphType.Trend) {
TrendPlotDlg tpd = (TrendPlotDlg) openedDlgs.get(dlgTitle);
if (tpd == null) {
@ -812,11 +819,29 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
try {
Coordinate stnCenter = MonitorAreaUtils
.getStationCenter(selectedStation);
if (stnCenter != null) {
zoomAndRecenter(stnCenter, STATION_ZOOM_LEVEL);
if (stnCenter == null) {
// Center for moving platforms.
SimpleDateFormat datef = new SimpleDateFormat(datePattern);
datef.setTimeZone(TimeZone.getTimeZone("GMT"));
String sql = "select longitude, latitude from fssobs where stationid = '"
+ selectedStation + "'";
List<Object[]> results = DirectDbQuery.executeQuery(sql,
"metadata", QueryLanguage.SQL);
double x;
double y;
if (!results.isEmpty()) {
x = Double.parseDouble(results.get(0)[0].toString());
y = Double.parseDouble(results.get(0)[1].toString());
stnCenter = new Coordinate();
stnCenter.x = x;
stnCenter.y = y;
}
}
} catch (SpatialException | ParseException e) {
statusHandler.handle(Priority.ERROR, e.getLocalizedMessage(), e);
zoomAndRecenter(stnCenter, STATION_ZOOM_LEVEL);
} catch (SpatialException | ParseException | VizException e) {
statusHandler.handle(Priority.ERROR,
"Unable to find the station center for station: "
+ selectedStation, e);
}
}
@ -943,20 +968,30 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
int stInd = name.indexOf("_");
if (prod.size() > 1) {
varName = name.substring(0, stInd);
if (varName.equals("SCA")) {
switch (varName) {
case "SCA":
varName = "Small Craft Advisory";
} else if (varName.equals("GALE")) {
break;
case "GALE":
varName = "Gale Warning";
} else if (varName.equals("STORM")) {
break;
case "STORM":
varName = "Storm Warning";
} else if (varName.equals("HURRICANE")) {
break;
case "HURRICANE":
varName = "Hurricane Force Wind Warning";
} else if (varName.equals("BLIZ")) {
break;
case "BLIZ":
varName = "Blizzard Warning";
} else if (varName.equals("FRZ")) {
break;
case "FRZ":
varName = "Freezing Precipitation";
} else if (varName.equals("HSW")) {
break;
case "HSW":
varName = "Heavy Snow Warning";
break;
default:
statusHandler.error("Invalid name for variable " + varName);
}
} else {
varName = name.substring(stInd + 1);

View file

@ -21,8 +21,10 @@ package com.raytheon.uf.viz.monitor.util;
import java.util.HashMap;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
/**
* TODO Add Description
* Monitor Configuration Constants.
*
* <pre>
*
@ -30,57 +32,59 @@ import java.util.HashMap;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Mar 16, 2009 2076 avarani Initial creation
* Sep 18, 2015 3873 skorolev Corrected appName.
*
* </pre>
*
* @author avarani
* @version 1.0
*/
public class MonitorConfigConstants
{
public class MonitorConfigConstants {
private static HashMap<String, Boolean> ryHigherMapSS;
private static HashMap<String, Boolean> ryHigherMapSnow;
private static HashMap<String, Boolean> ryHigherMapFog;
private static boolean rankSwellPeriodHigh = false;
/*
* SAFESEAS
*/
public static enum SafeSeasDisplay
{
SS_DISP_PROD_SCA_WIND_SPEED("Display.Product.SCA.wind_speed"),
SS_DISP_PROD_SCA_GUST_SPEED("Display.Product.SCA.gust_speed"),
SS_DISP_PROD_SCA_PEAK_WIND("Display.Product.SCA.peak_wind_speed"),
SS_DISP_PROD_SCA_WAVE_HT("Display.Product.SCA.wave_height"),
SS_DISP_PROD_GALE_WIND_SPEED("Display.Product.Gale.wind_speed"),
SS_DISP_PROD_GALE_GUST_SPEED("Display.Product.Gale.gust_speed"),
SS_DISP_PROD_GALE_PEAK_WIND("Display.Product.Gale.peak_wind_speed"),
SS_DISP_PROD_STORM_WIND_SPEED("Display.Product.Storm.wind_speed"),
SS_DISP_PROD_STORM_GUST_SPEED("Display.Product.Storm.gust_speed"),
SS_DISP_PROD_STORM_PEAK_WIND("Display.Product.Storm.peak_wind_speed"),
SS_DISP_PROD_HFWW_WIND_SPEED("Display.Product.Hurricane.wind_speed"),
SS_DISP_PROD_HFWW_GUST_SPEED("Display.Product.Hurricane.gust_speed"),
SS_DISP_PROD_HFWW_PEAK_WIND("Display.Product.Hurricane.peak_wind_speed"),
SS_DISP_WIND_WIND_SPEED("Display.Wind.wind_speed"),
SS_DISP_WIND_PEAK_WIND("Display.Wind.peak_wind_speed"),
SS_DISP_WIND_GUST_SPEED("Display.Wind.gust_speed"),
SS_DISP_WIND_DIR_FROM("Display.Wind.dirFrom"),
SS_DISP_WIND_DIR_TO("Display.Wind.dirTo"),
SS_DISP_METEO_VIS("Display.Meteo.visibility"),
SS_DISP_METEO_TEMP("Display.Meteo.temperature"),
SS_DISP_METEO_DEWPT("Display.Meteo.dewpoint"),
SS_DISP_METEO_SLP("Display.Meteo.slp"),
SS_DISP_METEO_SST("Display.Meteo.sea_surface_temp"),
SS_DISP_METEO_WAVE_HT("Display.Meteo.wave_height"),
SS_DISP_METEO_WAVE_STEEP("Display.Meteo.wave_steepness"),
SS_DISP_SWELL_PRIM_HT("Display.Swell.Primary.height"),
SS_DISP_SWELL_PRIM_PD("Display.Swell.Primary.period"),
SS_DISP_SWELL_PRIM_DIR_FROM("Display.Swell.Primary.dirFrom"),
SS_DISP_SWELL_PRIM_DIR_TO("Display.Swell.Primary.dirTo"),
SS_DISP_SWELL_SEC_HT("Display.Swell.Secondary.height"),
SS_DISP_SWELL_SEC_PD("Display.Swell.Secondary.period"),
SS_DISP_SWELL_SEC_DIR_FROM("Display.Swell.Secondary.dirFrom"),
SS_DISP_SWELL_SEC_DIR_TO("Display.Swell.Secondary.dirTo");
* SAFESEAS
*/
public static enum SafeSeasDisplay {
SS_DISP_PROD_SCA_WIND_SPEED("Display.Product.SCA.wind_speed"), SS_DISP_PROD_SCA_GUST_SPEED(
"Display.Product.SCA.gust_speed"), SS_DISP_PROD_SCA_PEAK_WIND(
"Display.Product.SCA.peak_wind_speed"), SS_DISP_PROD_SCA_WAVE_HT(
"Display.Product.SCA.wave_height"), SS_DISP_PROD_GALE_WIND_SPEED(
"Display.Product.Gale.wind_speed"), SS_DISP_PROD_GALE_GUST_SPEED(
"Display.Product.Gale.gust_speed"), SS_DISP_PROD_GALE_PEAK_WIND(
"Display.Product.Gale.peak_wind_speed"), SS_DISP_PROD_STORM_WIND_SPEED(
"Display.Product.Storm.wind_speed"), SS_DISP_PROD_STORM_GUST_SPEED(
"Display.Product.Storm.gust_speed"), SS_DISP_PROD_STORM_PEAK_WIND(
"Display.Product.Storm.peak_wind_speed"), SS_DISP_PROD_HFWW_WIND_SPEED(
"Display.Product.Hurricane.wind_speed"), SS_DISP_PROD_HFWW_GUST_SPEED(
"Display.Product.Hurricane.gust_speed"), SS_DISP_PROD_HFWW_PEAK_WIND(
"Display.Product.Hurricane.peak_wind_speed"), SS_DISP_WIND_WIND_SPEED(
"Display.Wind.wind_speed"), SS_DISP_WIND_PEAK_WIND(
"Display.Wind.peak_wind_speed"), SS_DISP_WIND_GUST_SPEED(
"Display.Wind.gust_speed"), SS_DISP_WIND_DIR_FROM(
"Display.Wind.dirFrom"), SS_DISP_WIND_DIR_TO(
"Display.Wind.dirTo"), SS_DISP_METEO_VIS(
"Display.Meteo.visibility"), SS_DISP_METEO_TEMP(
"Display.Meteo.temperature"), SS_DISP_METEO_DEWPT(
"Display.Meteo.dewpoint"), SS_DISP_METEO_SLP(
"Display.Meteo.slp"), SS_DISP_METEO_SST(
"Display.Meteo.sea_surface_temp"), SS_DISP_METEO_WAVE_HT(
"Display.Meteo.wave_height"), SS_DISP_METEO_WAVE_STEEP(
"Display.Meteo.wave_steepness"), SS_DISP_SWELL_PRIM_HT(
"Display.Swell.Primary.height"), SS_DISP_SWELL_PRIM_PD(
"Display.Swell.Primary.period"), SS_DISP_SWELL_PRIM_DIR_FROM(
"Display.Swell.Primary.dirFrom"), SS_DISP_SWELL_PRIM_DIR_TO(
"Display.Swell.Primary.dirTo"), SS_DISP_SWELL_SEC_HT(
"Display.Swell.Secondary.height"), SS_DISP_SWELL_SEC_PD(
"Display.Swell.Secondary.period"), SS_DISP_SWELL_SEC_DIR_FROM(
"Display.Swell.Secondary.dirFrom"), SS_DISP_SWELL_SEC_DIR_TO(
"Display.Swell.Secondary.dirTo");
String XMLKey;
@ -92,22 +96,21 @@ public class MonitorConfigConstants
return XMLKey;
}
}
public static enum SafeSeasMonitor
{
SS_MON_METEO_WIND_SPEED("Monitor.Meteo.wind_speed"),
SS_MON_METEO_PEAK_WIND("Monitor.Meteo.peak_wind_speed"),
SS_MON_METEO_GUST_SPEED("Monitor.Meteo.gust_speed"),
SS_MON_METEO_WAVE_HT("Monitor.Meteo.wave_height"),
SS_MON_METEO_VIS("Monitor.Meteo.visibility"),
SS_MON_SWELL_PRIM_HT("Monitor.Swell.Primary.height"),
SS_MON_SWELL_PRIM_PD("Monitor.Swell.Primary.period"),
SS_MON_SWELL_PRIM_DIR_FROM("Monitor.Swell.Primary.dirFrom"),
SS_MON_SWELL_PRIM_DIR_TO("Monitor.Swell.Primary.dirTo"),
SS_MON_SWELL_SEC_HT("Monitor.Swell.Secondary.height"),
SS_MON_SWELL_SEC_PD("Monitor.Swell.Secondary.period"),
SS_MON_SWELL_SEC_DIR_FROM("Monitor.Swell.Secondary.dirFrom"),
SS_MON_SWELL_SEC_DIR_TO("Monitor.Swell.Secondary.dirTo");
public static enum SafeSeasMonitor {
SS_MON_METEO_WIND_SPEED("Monitor.Meteo.wind_speed"), SS_MON_METEO_PEAK_WIND(
"Monitor.Meteo.peak_wind_speed"), SS_MON_METEO_GUST_SPEED(
"Monitor.Meteo.gust_speed"), SS_MON_METEO_WAVE_HT(
"Monitor.Meteo.wave_height"), SS_MON_METEO_VIS(
"Monitor.Meteo.visibility"), SS_MON_SWELL_PRIM_HT(
"Monitor.Swell.Primary.height"), SS_MON_SWELL_PRIM_PD(
"Monitor.Swell.Primary.period"), SS_MON_SWELL_PRIM_DIR_FROM(
"Monitor.Swell.Primary.dirFrom"), SS_MON_SWELL_PRIM_DIR_TO(
"Monitor.Swell.Primary.dirTo"), SS_MON_SWELL_SEC_HT(
"Monitor.Swell.Secondary.height"), SS_MON_SWELL_SEC_PD(
"Monitor.Swell.Secondary.period"), SS_MON_SWELL_SEC_DIR_FROM(
"Monitor.Swell.Secondary.dirFrom"), SS_MON_SWELL_SEC_DIR_TO(
"Monitor.Swell.Secondary.dirTo");
String XMLKey;
@ -121,34 +124,33 @@ public class MonitorConfigConstants
}
/*
* SNOW
* SNOW
*/
public static enum SnowDisplay
{
SNOW_DISP_PROD_BLIZZ_VIS("Display.Product.Blizzard.visibility"),
SNOW_DISP_PROD_BLIZZ_WIND_SPEED("Display.Product.Blizzard.wind_speed"),
SNOW_DISP_PROD_BLIZZ_GUST_SPEED("Display.Product.Blizzard.gust_speed"),
SNOW_DISP_PROD_BLIZZ_PEAK_WIND("Display.Product.Blizzard.peak_wind_speed"),
SNOW_DISP_PROD_FRZ_TEMP("Display.Product.Freezing_Precip.temperature"),
SNOW_DISP_PROD_FRZ_HOURLY_PRECIP("Display.Product.Freezing_Precip.hourly_precip"),
SNOW_DISP_PROD_HSW_SNINCR_HOURLY("Display.Product.Heavy_Snow_Warning.snincr_hourly"),
SNOW_DISP_PROD_HSW_SNINCR_TOTAL("Display.Product.Heavy_Snow_Warning.snincr_total"),
SNOW_DISP_PROD_HSW_SNOW_DEPTH("Display.Product.Heavy_Snow_Warning.snow_depth"),
SNOW_DISP_WIND_WIND_SPEED("Display.Product.Wind.wind_speed"),
SNOW_DISP_WIND_PEAK_WIND("Display.Product.Wind.peak_wind_speed"),
SNOW_DISP_WIND_GUST_SPEED("Display.Product.Wind.gust_speed"),
SNOW_DISP_WIND_DIR_FROM("Display.Product.Wind.dirFrom"),
SNOW_DISP_WIND_DIR_TO("Display.Product.Wind.dirTo"),
SNOW_DISP_METEO_TEMP("Display.Meteo.temperature"),
SNOW_DISP_METEO_DEWPT("Display.Meteo.dewpoint"),
SNOW_DISP_METEO_VIS("Display.Meteo.visibility"),
SNOW_DISP_METEO_SLP("Display.Meteo.slp"),
SNOW_DISP_METEO_HOURLY_PRECIP("Display.Meteo.hourly_precip"),
SNOW_DISP_METEO_WIND_CHILL("Display.Meteo.wind_chill"),
SNOW_DISP_METEO_FROSTBITE("Display.Meteo.frostbite_time"),
SNOW_DISP_METEO_SNOW_DEPTH("Display.Meteo.snow_depth"),
SNOW_DISP_METEO_SNINCR_HOURLY("Display.Meteo.snincr_hourly"),
SNOW_DISP_METEO_SNINCR_TOTAL("Display.Meteo.snincr_total");
public static enum SnowDisplay {
SNOW_DISP_PROD_BLIZZ_VIS("Display.Product.Blizzard.visibility"), SNOW_DISP_PROD_BLIZZ_WIND_SPEED(
"Display.Product.Blizzard.wind_speed"), SNOW_DISP_PROD_BLIZZ_GUST_SPEED(
"Display.Product.Blizzard.gust_speed"), SNOW_DISP_PROD_BLIZZ_PEAK_WIND(
"Display.Product.Blizzard.peak_wind_speed"), SNOW_DISP_PROD_FRZ_TEMP(
"Display.Product.Freezing_Precip.temperature"), SNOW_DISP_PROD_FRZ_HOURLY_PRECIP(
"Display.Product.Freezing_Precip.hourly_precip"), SNOW_DISP_PROD_HSW_SNINCR_HOURLY(
"Display.Product.Heavy_Snow_Warning.snincr_hourly"), SNOW_DISP_PROD_HSW_SNINCR_TOTAL(
"Display.Product.Heavy_Snow_Warning.snincr_total"), SNOW_DISP_PROD_HSW_SNOW_DEPTH(
"Display.Product.Heavy_Snow_Warning.snow_depth"), SNOW_DISP_WIND_WIND_SPEED(
"Display.Product.Wind.wind_speed"), SNOW_DISP_WIND_PEAK_WIND(
"Display.Product.Wind.peak_wind_speed"), SNOW_DISP_WIND_GUST_SPEED(
"Display.Product.Wind.gust_speed"), SNOW_DISP_WIND_DIR_FROM(
"Display.Product.Wind.dirFrom"), SNOW_DISP_WIND_DIR_TO(
"Display.Product.Wind.dirTo"), SNOW_DISP_METEO_TEMP(
"Display.Meteo.temperature"), SNOW_DISP_METEO_DEWPT(
"Display.Meteo.dewpoint"), SNOW_DISP_METEO_VIS(
"Display.Meteo.visibility"), SNOW_DISP_METEO_SLP(
"Display.Meteo.slp"), SNOW_DISP_METEO_HOURLY_PRECIP(
"Display.Meteo.hourly_precip"), SNOW_DISP_METEO_WIND_CHILL(
"Display.Meteo.wind_chill"), SNOW_DISP_METEO_FROSTBITE(
"Display.Meteo.frostbite_time"), SNOW_DISP_METEO_SNOW_DEPTH(
"Display.Meteo.snow_depth"), SNOW_DISP_METEO_SNINCR_HOURLY(
"Display.Meteo.snincr_hourly"), SNOW_DISP_METEO_SNINCR_TOTAL(
"Display.Meteo.snincr_total");
String XMLKey;
@ -160,16 +162,15 @@ public class MonitorConfigConstants
return XMLKey;
}
}
public static enum SnowMonitor
{
SNOW_MON_METEO_WIND_SPEED("Monitor.Meteo.wind_speed"),
SNOW_MON_METEO_PEAK_WIND("Monitor.Meteo.peak_wind_speed"),
SNOW_MON_METEO_GUST_SPEED("Monitor.Meteo.gust_speed"),
SNOW_MON_METEO_TEMP("Monitor.Meteo.temperature"),
SNOW_MON_METEO_WIND_CHILL("Monitor.Meteo.wind_chill"),
SNOW_MON_METEO_VIS("Monitor.Meteo.visibility"),
SNOW_MON_METEO_SNOW_DEPTH("Monitor.Meteo.snow_depth");
public static enum SnowMonitor {
SNOW_MON_METEO_WIND_SPEED("Monitor.Meteo.wind_speed"), SNOW_MON_METEO_PEAK_WIND(
"Monitor.Meteo.peak_wind_speed"), SNOW_MON_METEO_GUST_SPEED(
"Monitor.Meteo.gust_speed"), SNOW_MON_METEO_TEMP(
"Monitor.Meteo.temperature"), SNOW_MON_METEO_WIND_CHILL(
"Monitor.Meteo.wind_chill"), SNOW_MON_METEO_VIS(
"Monitor.Meteo.visibility"), SNOW_MON_METEO_SNOW_DEPTH(
"Monitor.Meteo.snow_depth");
String XMLKey;
@ -183,19 +184,18 @@ public class MonitorConfigConstants
}
// FOG
public static enum FogDisplay
{
FOG_DISP_METEO_VIS("Display.Meteo.visibility"),
FOG_DISP_METEO_CEILING("Display.Meteo.ceiling"),
FOG_DISP_METEO_TEMP("Display.Meteo.temperature"),
FOG_DISP_METEO_DEWPT("Display.Meteo.dewpoint"),
FOG_DISP_METEO_T_TD("Display.Meteo.t_td"),
FOG_DISP_METEO_REL_HUMIDITY("Display.Meteo.relative_humidity"),
FOG_DISP_WIND_WIND_SPEED("Display.Wind.wind_speed"),
FOG_DISP_WIND_PEAK_WIND("Display.Wind.peak_wind_speed"),
FOG_DISP_WIND_GUST_SPEED("Display.Wind.gust_speed"),
FOG_DISP_WIND_DIR_FROM("Display.Wind.dirFrom"),
FOG_DISP_WIND_DIR_TO("Display.Wind.dirTo");
public static enum FogDisplay {
FOG_DISP_METEO_VIS("Display.Meteo.visibility"), FOG_DISP_METEO_CEILING(
"Display.Meteo.ceiling"), FOG_DISP_METEO_TEMP(
"Display.Meteo.temperature"), FOG_DISP_METEO_DEWPT(
"Display.Meteo.dewpoint"), FOG_DISP_METEO_T_TD(
"Display.Meteo.t_td"), FOG_DISP_METEO_REL_HUMIDITY(
"Display.Meteo.relative_humidity"), FOG_DISP_WIND_WIND_SPEED(
"Display.Wind.wind_speed"), FOG_DISP_WIND_PEAK_WIND(
"Display.Wind.peak_wind_speed"), FOG_DISP_WIND_GUST_SPEED(
"Display.Wind.gust_speed"), FOG_DISP_WIND_DIR_FROM(
"Display.Wind.dirFrom"), FOG_DISP_WIND_DIR_TO(
"Display.Wind.dirTo");
String XMLKey;
@ -207,11 +207,10 @@ public class MonitorConfigConstants
return XMLKey;
}
}
public static enum FogMonitor
{
public static enum FogMonitor {
FOG_MONITOR_METEO_VIS("Monitor.Meteo.visiblity");
String XMLKey;
FogMonitor(String s) {
@ -222,340 +221,248 @@ public class MonitorConfigConstants
return XMLKey;
}
}
public static Boolean rValueIsHigher(String key, String appName)
{
if ( appName.equals("safeseas") ) {
if ( ryHigherMapSS == null ) {
createRYHigherMapSS();
}
if ( ryHigherMapSS.containsKey(key) == true ) {
return ryHigherMapSS.get(key);
}
} else if ( appName.equals("snow") ) {
if ( ryHigherMapSnow == null ) {
createRYHigherMapSnow();
}
if ( ryHigherMapSnow.containsKey(key) == true ) {
return ryHigherMapSnow.get(key);
}
} else if ( appName.equals("fog") ) {
if ( ryHigherMapFog == null ) {
createRYHigherMapFog();
}
if ( ryHigherMapFog.containsKey(key) == true ) {
return ryHigherMapFog.get(key);
}
} else {
// do nothing here
}
public static Boolean rValueIsHigher(String key, AppName appName) {
if (appName.equals(AppName.SAFESEAS)) {
if (ryHigherMapSS == null) {
createRYHigherMapSS();
}
if (ryHigherMapSS.containsKey(key) == true) {
return ryHigherMapSS.get(key);
}
} else if (appName.equals(AppName.SNOW)) {
if (ryHigherMapSnow == null) {
createRYHigherMapSnow();
}
if (ryHigherMapSnow.containsKey(key) == true) {
return ryHigherMapSnow.get(key);
}
} else if (appName.equals(AppName.FOG)) {
if (ryHigherMapFog == null) {
createRYHigherMapFog();
}
if (ryHigherMapFog.containsKey(key) == true) {
return ryHigherMapFog.get(key);
}
} else {
// do nothing here
}
return false;
}
private static void createRYHigherMapSS()
{
private static void createRYHigherMapSS() {
ryHigherMapSS = new HashMap<String, Boolean>();
/*
* SafeSeas Display
*/
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_SCA_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_SCA_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_SCA_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_SCA_WAVE_HT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_GALE_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_GALE_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_GALE_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_STORM_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_STORM_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_STORM_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_HFWW_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_HFWW_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_HFWW_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_DIR_TO.getXmlKey(), null);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_SCA_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_SCA_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_SCA_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_PROD_SCA_WAVE_HT.getXmlKey(),
true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_GALE_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_GALE_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_GALE_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS
.put(SafeSeasDisplay.SS_DISP_PROD_STORM_WIND_SPEED.getXmlKey(),
true);
ryHigherMapSS
.put(SafeSeasDisplay.SS_DISP_PROD_STORM_GUST_SPEED.getXmlKey(),
true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_STORM_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_HFWW_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_HFWW_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_PROD_HFWW_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_WIND_SPEED.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_PEAK_WIND.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_GUST_SPEED.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_WIND_DIR_FROM.getXmlKey(),
null);
ryHigherMapSS
.put(SafeSeasDisplay.SS_DISP_WIND_DIR_TO.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_VIS.getXmlKey(), false);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_TEMP.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_DEWPT.getXmlKey(), true);
ryHigherMapSS
.put(SafeSeasDisplay.SS_DISP_METEO_DEWPT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_SLP.getXmlKey(), false);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_SST.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_WAVE_HT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_WAVE_STEEP.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_PRIM_HT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_PRIM_PD.getXmlKey(), rankSwellPeriodHigh);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_PRIM_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_PRIM_DIR_TO.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_HT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_PD.getXmlKey(), rankSwellPeriodHigh);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_DIR_TO.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_WAVE_HT.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_METEO_WAVE_STEEP.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_PRIM_HT.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_PRIM_PD.getXmlKey(),
rankSwellPeriodHigh);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_SWELL_PRIM_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_SWELL_PRIM_DIR_TO.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_HT.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_PD.getXmlKey(),
rankSwellPeriodHigh);
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_SWELL_SEC_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_DIR_TO.getXmlKey(),
null);
/*
* SafeSeas Monitor // TODO
* SafeSeas Monitor
*/
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey(), false);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey(), false);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey(), false);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey(),
true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey(),
false);
ryHigherMapSS.put(
SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey(),
null);
ryHigherMapSS
.put(SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey(), true);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey(),
false);
ryHigherMapSS.put(
SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey(), null);
ryHigherMapSS.put(SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey(),
null);
}
private static void createRYHigherMapSnow()
{
ryHigherMapSnow = new HashMap<String, Boolean>();
private static void createRYHigherMapSnow() {
ryHigherMapSnow = new HashMap<String, Boolean>();
/*
* Snow Display
*/
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_BLIZZ_VIS.getXmlKey(), false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_BLIZZ_WIND_SPEED.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_BLIZZ_GUST_SPEED.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_BLIZZ_PEAK_WIND.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_FRZ_TEMP.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_FRZ_HOURLY_PRECIP.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_HSW_SNINCR_HOURLY.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_HSW_SNINCR_TOTAL.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_HSW_SNOW_DEPTH.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_WIND_SPEED.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_PEAK_WIND.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_GUST_SPEED.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_DIR_FROM.getXmlKey(), null);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_DIR_TO.getXmlKey(), null);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey(), false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_DEWPT.getXmlKey(), false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_BLIZZ_VIS.getXmlKey(),
false);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_PROD_BLIZZ_WIND_SPEED.getXmlKey(), true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_PROD_BLIZZ_GUST_SPEED.getXmlKey(), true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_PROD_BLIZZ_PEAK_WIND.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_PROD_FRZ_TEMP.getXmlKey(),
true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_PROD_FRZ_HOURLY_PRECIP.getXmlKey(), true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_PROD_HSW_SNINCR_HOURLY.getXmlKey(), true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_PROD_HSW_SNINCR_TOTAL.getXmlKey(), true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_PROD_HSW_SNOW_DEPTH.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_WIND_SPEED.getXmlKey(),
true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_PEAK_WIND.getXmlKey(),
true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_GUST_SPEED.getXmlKey(),
true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_WIND_DIR_FROM.getXmlKey(),
null);
ryHigherMapSnow
.put(SnowDisplay.SNOW_DISP_WIND_DIR_TO.getXmlKey(), null);
ryHigherMapSnow
.put(SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey(), false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_DEWPT.getXmlKey(),
false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey(), false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_SLP.getXmlKey(), false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_WIND_CHILL.getXmlKey(), false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_FROSTBITE.getXmlKey(), false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_SNINCR_HOURLY.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_SNINCR_TOTAL.getXmlKey(), true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP.getXmlKey(), true);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_WIND_CHILL.getXmlKey(),
false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_FROSTBITE.getXmlKey(),
false);
ryHigherMapSnow.put(SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH.getXmlKey(),
true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_METEO_SNINCR_HOURLY.getXmlKey(), true);
ryHigherMapSnow.put(
SnowDisplay.SNOW_DISP_METEO_SNINCR_TOTAL.getXmlKey(), true);
/*
* Snow Monitor
*/
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_WIND_SPEED.getXmlKey(), true);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_PEAK_WIND.getXmlKey(), true);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_GUST_SPEED.getXmlKey(), true);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_WIND_SPEED.getXmlKey(),
true);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_PEAK_WIND.getXmlKey(),
true);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_GUST_SPEED.getXmlKey(),
true);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_TEMP.getXmlKey(), false);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_WIND_CHILL.getXmlKey(), false);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_WIND_CHILL.getXmlKey(),
false);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_VIS.getXmlKey(), false);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_SNOW_DEPTH.getXmlKey(), true);
ryHigherMapSnow.put(SnowMonitor.SNOW_MON_METEO_SNOW_DEPTH.getXmlKey(),
true);
}
private static void createRYHigherMapFog()
{
ryHigherMapFog = new HashMap<String, Boolean>();
private static void createRYHigherMapFog() {
ryHigherMapFog = new HashMap<String, Boolean>();
/*
* Fog Display
*/
ryHigherMapFog.put(FogDisplay.FOG_DISP_METEO_VIS.getXmlKey(), false);
ryHigherMapFog.put(FogDisplay.FOG_DISP_METEO_CEILING.getXmlKey(), false);
ryHigherMapFog
.put(FogDisplay.FOG_DISP_METEO_CEILING.getXmlKey(), false);
ryHigherMapFog.put(FogDisplay.FOG_DISP_METEO_TEMP.getXmlKey(), true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_METEO_DEWPT.getXmlKey(), true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_METEO_T_TD.getXmlKey(), false);
ryHigherMapFog.put(FogDisplay.FOG_DISP_METEO_REL_HUMIDITY.getXmlKey(), true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_WIND_WIND_SPEED.getXmlKey(), true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_WIND_PEAK_WIND.getXmlKey(), true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_WIND_GUST_SPEED.getXmlKey(), true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_METEO_REL_HUMIDITY.getXmlKey(),
true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_WIND_WIND_SPEED.getXmlKey(),
true);
ryHigherMapFog
.put(FogDisplay.FOG_DISP_WIND_PEAK_WIND.getXmlKey(), true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_WIND_GUST_SPEED.getXmlKey(),
true);
ryHigherMapFog.put(FogDisplay.FOG_DISP_WIND_DIR_FROM.getXmlKey(), null);
ryHigherMapFog.put(FogDisplay.FOG_DISP_WIND_DIR_TO.getXmlKey(), null);
/*
* Fog Monitor
*/
ryHigherMapFog.put(FogMonitor.FOG_MONITOR_METEO_VIS.getXmlKey(), false);
}
// FOG Parameters
// public static final String FOG_IR_MIN = "fog.ir.min";
// public static final String FOG_IR_DELTA_YELLOW_LOW = "fog.ir.delta.yellow.low";
// public static final String FOG_IR_DELTA_YELLOW_HIGH = "fog.ir.delta.yellow.high";
// public static final String FOG_IR_DELTA_RED_LOW = "fog.ir.delta.red.low";
// public static final String FOG_IR_DELTA_RED_HIGH = "fog.ir.delta.red.high";
// public static final String FOG_IR_MAX = "fog.ir.max";
// public static final String FOG_IR_ICE_SNOW = "fog.ir.ice_snow_threshold";
// public static final String FOG_IR_CLOUD = "fog.ir.cloud_threshold";
// public static final String FOG_IR_CLOUD_FREE = "fog.ir.cloud_free_threshold";
// public static final String FOG_VIS_MIN = "fog.vis.min";
// public static final String FOG_VIS_YELLOW_LOW = "fog.vis.yellow.low";
// public static final String FOG_VIS_YELLOW_HIGH = "fog.vis.yellow.high";
// public static final String FOG_VIS_RED_LOW = "fog.vis.red.low";
// public static final String FOG_VIS_RED_HIGH = "fog.vis.red.high";
// public static final String FOG_VIS_MAX = "fog.vis.max";
// public static final String FOG_VIS_SMOOTHNESS = "fog.vis.smoothness_threshold";
// public static final String FOG_VIS_TWILIGHT_ANG = "fog.vis.twilight_threshold";
// public static final String FOG_VIS_FRACTAL_DIM = "fog.vis.fractal_dim_threshold";
// public static final String FOG_SCALE_STATE = "fog.scale_state";
// public static final String FOG_ICE_SNOW = "fog.ice_snow";
// public static final String FOG_CLOUD = "fog.cloud";
// public static final String FOG_CLOUD_FREE = "fog.cloud_free";
// public static final String FOG_SMOOTHNESS = "fog.smoothness";
// public static final String FOG_ADJACENCY = "fog.adjacency";
// public static final String FOG_ADJACENCY_THRESH = "fog.adjacency_threshold";
// public static final String FOG_TWILIGHT_ANG = "fog.twilight_ang";
// public static final String FOG_FRACTAL_DIM = "fog.fractal_dim";
//
// public static enum FogParameters {
// FOG_IR_MIN(MonitorConfigConstants.FOG_IR_MIN),
// FOG_IR_DELTA_YELLOW_LOW(MonitorConfigConstants.FOG_IR_DELTA_YELLOW_LOW),
// FOG_IR_DELTA_YELLOW_HIGH(MonitorConfigConstants.FOG_IR_DELTA_YELLOW_HIGH),
// FOG_IR_DELTA_RED_LOW(MonitorConfigConstants.FOG_IR_DELTA_RED_LOW),
// FOG_IR_DELTA_RED_HIGH(MonitorConfigConstants.FOG_IR_DELTA_RED_HIGH),
// FOG_IR_MAX(MonitorConfigConstants.FOG_IR_MAX),
// FOG_IR_ICE_SNOW(MonitorConfigConstants.FOG_IR_ICE_SNOW),
// FOG_IR_CLOUD(MonitorConfigConstants.FOG_IR_CLOUD),
// FOG_IR_CLOUD_FREE(MonitorConfigConstants.FOG_IR_CLOUD_FREE),
// FOG_VIS_MIN(MonitorConfigConstants.FOG_VIS_MIN),
// FOG_VIS_YELLOW_LOW(MonitorConfigConstants.FOG_VIS_YELLOW_LOW),
// FOG_VIS_YELLOW_HIGH(MonitorConfigConstants.FOG_VIS_YELLOW_HIGH),
// FOG_VIS_RED_LOW(MonitorConfigConstants.FOG_VIS_RED_LOW),
// FOG_VIS_RED_HIGH(MonitorConfigConstants.FOG_VIS_RED_HIGH),
// FOG_VIS_MAX(MonitorConfigConstants.FOG_VIS_MAX),
// FOG_VIS_SMOOTHNESS(MonitorConfigConstants.FOG_VIS_SMOOTHNESS),
// FOG_VIS_TWILIGHT_ANG(MonitorConfigConstants.FOG_VIS_TWILIGHT_ANG),
// FOG_VIS_FRACTAL_DIM(MonitorConfigConstants.FOG_VIS_FRACTAL_DIM),
// FOG_SCALE_STATE(MonitorConfigConstants.FOG_SCALE_STATE),
// FOG_ICE_SNOW(MonitorConfigConstants.FOG_ICE_SNOW),
// FOG_CLOUD(MonitorConfigConstants.FOG_CLOUD),
// FOG_CLOUD_FREE(MonitorConfigConstants.FOG_CLOUD_FREE),
// FOG_SMOOTHNESS(MonitorConfigConstants.FOG_SMOOTHNESS),
// FOG_ADJACENCY(MonitorConfigConstants.FOG_ADJACENCY),
// FOG_ADJACENCY_THRESH(MonitorConfigConstants.FOG_ADJACENCY_THRESH),
// FOG_TWILIGHT_ANG(MonitorConfigConstants.FOG_TWILIGHT_ANG),
// FOG_FRACTAL_DIM(MonitorConfigConstants.FOG_FRACTAL_DIM);
//
// String XMLKey;
//
// FogParameters(String s) {
// XMLKey = s;
// }
//
// @Override
// public String toString() {
// return XMLKey;
// }
// }
// SCAN
// public static final String SCAN_PLUGIN_NAME = "pluginName";
// public static final String SCAN_STATION_NAME = "stationName";
// public static final String SCAN_CELL_TABLE_ATTRIB = "cellTableAttributes";
// public static final String SCAN_MESO_TABLE_ATTRIB = "mesoTableAttributes";
// public static final String SCAN_TVS_TABLE_ATTRIB = "tvsTableAttributes";
//
// public static final String[] CELL_TABLE = { "cellTable", "time", "radar",
// "ident", "azm", "rng", "rank", "tvs", "mdaSR", "posh", "poh", "hsize",
// "vil", "dbz", "dbzHt", "top", "dir", "spd", "azm15", "rng15", "azm30",
// "rng30", "azm45", "rng45", "azm60", "rng60", "mvtErr", "mvtMn", "lat",
// "lon", "polh", "svrwx", "hvyPr", "pPos", "cgRate", "vcp", "cape",
// "sreh", "county" };
//
// public static final String[] MESO_TABLE = { "mesoTable", "time", "radar",
// "strmID","ident", "azm", "rng", "mdaSR", "class", "llVr", "llgtg",
// "base", "depth", "relDep", "maxVr", "htMxVr", "tvs", "dir", "spd",
// "msi","lat", "lon", "county" };
//
// public static final String[] TVS_TABLE = { "tvsTable", "time", "radar",
// "strmID", "ident", "type", "azm", "rng", "avgDv", "llDv", "maxDv",
// "mxDvHt", "base", "depth", "top", "shear", "shrHt", "lat", "lon", "county" };
//
public static final String[] TABLE_FIELDS = { "low", "mid", "upp", "rank",
"trend", "mClr", "clucon", "inTbl", "min", "intrvl", "range", "alarm",
"aAlarm", "units" };
"trend", "mClr", "clucon", "inTbl", "min", "intrvl", "range",
"alarm", "aAlarm", "units" };
public static final String[] FFMP_TABLE = { "ffmpTable", "name", "rate",
"qpe", "guidance", "ratio", "diff" };
//
// public static enum ScanTables {
// CELL, MESO, TVS;
// }
//
// public static enum cellTable {
// TIME(1), RADAR(2), IDENT(3), AZM(4), RNG(5), RANK(6), TVS(7), MDASR(8),
// POSH(9), POH(10), HSIZE(11), VIL(12), DBZ(13), DBZHT(14), TOP(15), DIR(16),
// SPD(17), AZM15(18), RNG15(19), AZM30(20), RNG30(21), AZM45(22), RNG45(23),
// AZM60(24), RNG60(25), MVTERR(26), MVTMN(27), LAT(28), LON(29), POLH(30),
// SVRWX(31), HVYPR(32), PPOS(33), CGRATE(34), VCP(35), CAPE(36), SREH(37),
// COUNTY(38);
//
// int index;
//
// cellTable(int i) {
// index = i;
// }
//
// @Override
// public String toString() {
// return CELL_TABLE[index];
// }
//
// public String toString(tableFields field) {
// return CELL_TABLE[0] + "." + CELL_TABLE[index] + "." + field.toString();
// }
// }
//
// public static enum mesoTable {
// TIME(1), RADAR(2), STRMID(3), IDENT(4), AZM(5), RNG(6), MDASR(7), CLASS(8),
// LLVR(9), LLGTG(10), BASE(11), DEPTH(12), RELDEP(13), MAXVR(14), HTMXVR(15),
// TVS(16), DIR(18), SPD(19), MSI(20), LAT(21), LON(22), COUNTY(23);
//
// int index;
//
// mesoTable(int i) {
// index = i;
// }
//
// @Override
// public String toString() {
// return MESO_TABLE[index];
// }
//
// public String toString(tableFields t) {
// return MESO_TABLE[0] + "." + MESO_TABLE[index] + "." + t.toString();
// }
// }
//
// public static enum tvsTable {
// TIME(1), RADAR(2), STRMID(3), IDENT(4), TYPE(5), AM(6), RNG(7), AVGDV(8),
// LLDV(9), MAXDV(10), MXDVHT(11), BASE(12), DEPTH(13), TOP(14), SHEAR(15),
// SHRHT(16), LAT(17), LON(18), COUNTY(19);
//
// int index;
//
// tvsTable(int i) {
// index = i;
// }
//
// @Override
// public String toString() {
// return TVS_TABLE[index];
// }
//
// public String toString(tableFields t) {
// return TVS_TABLE[0] + "." + TVS_TABLE[index] + "." + t.toString();
// }
// }
//
"qpe", "guidance", "ratio", "diff" };
public static enum tableFields {
LOW(0), MID(1), UPP(2), RANK(3), TREND(4), MCLR(5), CLUCON(6), INTBL(7),
MIN(8), INTRVL(9), RANGE(10), ALARM(11), AALARM(12), UNITS(13);
LOW(0), MID(1), UPP(2), RANK(3), TREND(4), MCLR(5), CLUCON(6), INTBL(7), MIN(
8), INTRVL(9), RANGE(10), ALARM(11), AALARM(12), UNITS(13);
int index;
@ -568,8 +475,7 @@ public class MonitorConfigConstants
return TABLE_FIELDS[index];
}
}
public static enum ffmpTable {
NAME(1), RATE(2), QPE(3), QPF(4), GUIDANCE(5), RATIO(6), DIFF(7);
@ -585,12 +491,11 @@ public class MonitorConfigConstants
}
public String toString(tableFields field) {
return FFMP_TABLE[0] + "." + FFMP_TABLE[index] + "." + field.toString();
return FFMP_TABLE[0] + "." + FFMP_TABLE[index] + "."
+ field.toString();
}
}
// Other Constants
public static final String AREA_IDS_KEY = "AreaIDs.";
@ -603,30 +508,33 @@ public class MonitorConfigConstants
public static final String STATIONS_KEY = "Stations";
public static final String COLUMN_LIST_KEY = "ColumnList";
public static final String SCAN_RADAR_ICAO = "radarIcao";
public static final String SCAN_WMO_NUMBER = "wmoNumber";
public static final String SCAN_START_INTERVAL = "startInterval";
public static final String SCAN_CELL_TILT = "cellTilt";
public static final String SCAN_DMD_TILT = "dmdTilt";
private MonitorConfigConstants() {
// no instantiation
}
public static void setRankSwellPeriodHigh(boolean rankSwellPeriodHigh) {
MonitorConfigConstants.rankSwellPeriodHigh = rankSwellPeriodHigh;
if ( ryHigherMapSS != null ) {
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_PRIM_PD.getXmlKey(), rankSwellPeriodHigh);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_PD.getXmlKey(), rankSwellPeriodHigh);
}
}
public static void setRankSwellPeriodHigh(boolean rankSwellPeriodHigh) {
MonitorConfigConstants.rankSwellPeriodHigh = rankSwellPeriodHigh;
if (ryHigherMapSS != null) {
ryHigherMapSS.put(
SafeSeasDisplay.SS_DISP_SWELL_PRIM_PD.getXmlKey(),
rankSwellPeriodHigh);
ryHigherMapSS.put(SafeSeasDisplay.SS_DISP_SWELL_SEC_PD.getXmlKey(),
rankSwellPeriodHigh);
}
}
public static boolean isRankSwellPeriodHigh() {
return rankSwellPeriodHigh;
}
public static boolean isRankSwellPeriodHigh() {
return rankSwellPeriodHigh;
}
}

View file

@ -22,6 +22,9 @@ package com.raytheon.uf.viz.radarapps.requests;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import com.raytheon.rcm.config.RcmResourceProvider;
import com.raytheon.uf.viz.radarapps.core.LocalizationRcmResourceProvider;
/**
* The activator class controls the plug-in life cycle
*/
@ -39,14 +42,12 @@ public class Activator extends AbstractUIPlugin {
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
RcmResourceProvider.setInstance(new LocalizationRcmResourceProvider());
}
/*
* (non-Javadoc)

View file

@ -22,6 +22,9 @@ package com.raytheon.uf.viz.radarapps.rps;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import com.raytheon.rcm.config.RcmResourceProvider;
import com.raytheon.uf.viz.radarapps.core.LocalizationRcmResourceProvider;
/**
* The activator class controls the plug-in life cycle
*/
@ -39,14 +42,12 @@ public class Activator extends AbstractUIPlugin {
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
RcmResourceProvider.setInstance(new LocalizationRcmResourceProvider());
}
/*
* (non-Javadoc)

View file

@ -30,6 +30,13 @@
#
# Author: lefebvre/mathewson
# ----------------------------------------------------------------------------
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 09/30/15 18141 ryu Allow processing for TCV issued by CPHC
########################################################################
# The MenuItems list defines the GFE menu item(s) under which the
# Procedure is to appear.
@ -40,6 +47,7 @@ from numpy import *
import SmartScript
import AbsTime
import HazardUtils
import VTECPartners
import LogStream, logging
import UFStatusHandler
@ -89,7 +97,7 @@ class Procedure (SmartScript.SmartScript):
continue
# only look at the KNHC records
if v['officeid'] != 'KNHC':
if v['officeid'] not in VTECPartners.VTEC_TPC_SITE:
continue
key = (v['phen'], v['sig'], v['etn'])

View file

@ -35,10 +35,12 @@ import javax.measure.converter.UnitConverter;
import javax.measure.unit.Unit;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.State;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
@ -46,6 +48,7 @@ import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.handlers.RadioState;
import org.eclipse.ui.handlers.RegistryToggleState;
import org.eclipse.ui.operations.RedoActionHandler;
import com.raytheon.uf.common.colormap.ColorMap;
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
@ -81,6 +84,7 @@ import com.raytheon.viz.mpe.MPECommandConstants;
import com.raytheon.viz.mpe.MPEDateFormatter;
import com.raytheon.viz.mpe.core.MPEDataManager;
import com.raytheon.viz.mpe.core.MPEDataManager.MPERadarLoc;
import com.raytheon.viz.mpe.ui.actions.ClearMPEData;
import com.raytheon.viz.mpe.ui.dialogs.hourlyradar.RadarDataManager;
import com.raytheon.viz.mpe.ui.displays.MPEMapRenderableDisplay;
import com.raytheon.viz.mpe.ui.rsc.MPEFieldResource;
@ -111,6 +115,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
* Jun 30, 2014 17457 snaples Added default case to switch in getXmrgfile.
* Jul 8, 2015 16790 snaples Updated setCurrentEditDate to refresh resources when dateMap is stale.
* Jul 29, 2015 17471 snaples Updated editTime to ensure that it always references "GMT" timezone.
* Sep 29, 2015 16790 snaples Fixed issue with date not following the CAVE time when changed, and fixed time matching issue.
*
* </pre>
*
@ -663,24 +668,10 @@ public class MPEDisplayManager {
* @return
*/
public boolean setCurrentEditDate(Date newDate, boolean force) {
MPEDataManager dm = MPEDataManager.getInstance();
// check for date in valid range
if ((newDate.before(dm.getEarliestDate())
|| newDate.after(dm.getLatestDate())) || force ) {
IEditorPart editor = EditorUtil.getActiveEditor();
if (editor instanceof IDisplayPaneContainer) {
IDisplayPaneContainer container = (IDisplayPaneContainer) editor;
for (IDisplayPane pane : container.getDisplayPanes()) {
pane.clear();
}
}
}
if (editTime.equals(newDate) == false) {
// new time, check for save
if (force == false && !isDataSaved()) {
if (!isDataSaved()) {
if (!okToProceed("Data Not Saved")) {
return false;
}
@ -692,6 +683,12 @@ public class MPEDisplayManager {
if (display.getContainer() != null) {
stopLooping(display.getContainer());
}
try {
display.getDescriptor().redoTimeMatching();
} catch (VizException e) {
Activator.statusHandler.handle(Priority.PROBLEM,
"Error in redoTimeMatching for MPEDisplayManager", e);
}
setCurrentDisplayedDate(newDate);
if (displayedFieldResource == null) {

View file

@ -26,6 +26,8 @@ import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@ -51,6 +53,7 @@ import com.raytheon.viz.mpe.core.MPEDataManager.MPEDateInfo;
import com.raytheon.viz.mpe.ui.MPEDisplayManager;
import com.raytheon.viz.mpe.ui.TransmitBestEstimateQPEProvider;
import com.raytheon.viz.mpe.ui.TransmitRFCBiasProvider;
import com.raytheon.viz.mpe.ui.actions.ClearMPEData;
import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
@ -71,6 +74,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
* if hour is greater than 18Z.
* Jan 05, 2015 14246 lbousaidi enable Transmit Best Estimate QPE.
* Jul 8, 2015 16790 snaples Updated call to setCurrentEditDate to pass force variable.
* Sep 29, 2015 17975 snaples Fixed issue with Hydro date not following the CAVE time when changed.
*
* </pre>
*
@ -161,26 +165,18 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
displayMgr = MPEDisplayManager.getInstance(pane);
dataMgr = MPEDataManager.getInstance();
dateMap = dataMgr.getDateMap(true);
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 = displayMgr.getCurrentEditDate();
hydroCal.setTime(prevHydDate);
hydroCal.setTime(displayMgr.getCurrentEditDate());
if ( cal.get(Calendar.HOUR_OF_DAY) >= 18 ){
hydroCal.add(Calendar.DATE, 1);
}
}else{
hydroCal.setTime(prevHydDate);
if ( hydroCal.get(Calendar.HOUR_OF_DAY) >= 18 ){
hydroCal.add(Calendar.DATE, 1);
}
}
/*
@ -551,20 +547,13 @@ public class ChooseDataPeriodDialog extends CaveJFACEDialog {
}
Calendar aCal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
aCal.setTime(dataMgr.getLatestDate());
aCal.setTime(displayMgr.getCurrentEditDate());
if ( cal.get(Calendar.HOUR_OF_DAY) >= 18 ){
if ( aCal.get(Calendar.HOUR_OF_DAY) >= 18 ){
aCal.add(Calendar.DATE, 1);
}
if (hydroCal.getTime().before(dataMgr.getEarliestDate())
|| hydroCal.getTime().after(aCal.getTime())) {
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));

View file

@ -81,6 +81,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Dec 15 2013 DCS 167 cgobs DualPol capabilities
* Jul 29, 2015 17471 snaples Added logging for Radar Bias results table query.
* Aug 11, 2015 4500 rjpeter Fix type casts.
* Sep 29, 2015 17975 snaples Fixed an issue with getDateMap query sometimes throwing errors.
*
* </pre>
*
* @author randerso
@ -728,18 +730,20 @@ public class MPEDataManager {
private void getDates(boolean update) {
String starttime = "";
String endtime = "";
if (update && latestAvailableDate != null) {
starttime = sdf.format(latestAvailableDate);
} else {
dateMap = new HashMap<Date, MPEDateInfo>();
starttime = sdf.format(getEarliestDate());
}
endtime = sdf.format(getLatestDate());
String sqlQuery = "select obstime,last_save_time,last_exec_time,auto_save from rwresult where rfc='"
+ RFC
+ "' and obstime between '"
+ starttime
+ "' and '"
+ sdf.format(getLatestDate()) + "'";
+ endtime + "'";
try {
List<Object[]> results = DirectDbQuery.executeQuery(sqlQuery,

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<svg width="80" height="80"
viewBox="0 0 80 80"
<svg width="100" height="100"
viewBox="0 0 100 100"
overflow="visible"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255,255,255);">

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -94,6 +94,7 @@ import com.vividsolutions.jts.precision.SimpleGeometryPrecisionReducer;
* 04/29/2015 DR 17310 D. Friedman Use Geometry.buffer() to fix self-intersections. Fix bug in alterVertexes.
* 05/07/2015 DR 17438 D. Friedman Clean up debug and performance logging.
* 05/08/2015 DR 17310 D. Friedman Prevent reducePoints from generating invalid polygons.
* 09/22/2015 DR 18033 Qinglu Lin Updated removeOverlaidLinesegments(), removed one computeSlope().
* </pre>
*
* @author mschenke
@ -1554,7 +1555,7 @@ public class PolygonUtil {
slope1 = slope;
count += 1;
} else {
if (Math.abs(Math.abs(slope) - Math.abs(slope1)) <= min) {
if (Math.abs(slope - slope1) <= min) {
count += 1;
} else {
count = 0;
@ -1879,16 +1880,6 @@ public class PolygonUtil {
}
}
static public double computeSlope(Coordinate[] coords, int i, int j) {
double min = 1.0E-08;
double dx = coords[i].x - coords[j].x;
double slope = 0.0;
if (Math.abs(dx) > min) {
slope = (coords[i].y - coords[j].y) / dx;
}
return slope;
}
/**
* Create a polygon whose two diagonal coordinates are a and b.
**/

View file

@ -19,6 +19,11 @@
**/
package com.raytheon.viz.warngen.gui;
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.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
@ -27,6 +32,7 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.tools.GenericToolsResourceData;
import com.raytheon.uf.viz.core.rsc.tools.action.AbstractGenericToolAction;
import com.raytheon.viz.ui.input.EditableManager;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
/**
* Simple action for loading the warngen layer
@ -40,6 +46,7 @@ import com.raytheon.viz.ui.input.EditableManager;
* Oct 10, 2010 6990 Qinglu Lin Used D. Friedman short solution,
* with minor changes.
* Aug 15, 2013 DR 16418 D. Friedman Always show the dialog.
* Sep 22, 2015 4859 dgilling Prevent dialog from showing in DRT mode.
*
* </pre>
*
@ -78,4 +85,17 @@ public class WarngenAction extends AbstractGenericToolAction<WarngenLayer> {
layer.showDialog(true);
return layer;
}
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (!SimulatedTimeOperations.isTransmitAllowed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
SimulatedTimeOperations
.displayFeatureLevelWarning(shell, "WarnGen");
return null;
}
return super.execute(arg0);
}
}

View file

@ -72,6 +72,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.PerformanceStatus;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.ISimulatedTimeChangeListener;
import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.TimeRange;
import com.raytheon.uf.common.time.util.TimeUtil;
@ -88,6 +89,7 @@ import com.raytheon.viz.ui.EditorUtil;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.viz.ui.input.EditableManager;
import com.raytheon.viz.ui.simulatedtime.SimulatedTimeOperations;
import com.raytheon.viz.warngen.Activator;
import com.raytheon.viz.warngen.WarngenConstants;
import com.raytheon.viz.warngen.comm.WarningSender;
@ -167,13 +169,14 @@ import com.vividsolutions.jts.geom.Polygon;
* chance for that to occur is trivial.
* May 7, 2015 ASM #17438 D. Friedman Clean up debug and performance logging.
* Jun 05, 2015 DR 17428 D. Friedman Fixed duration-related user interface issues. Added duration logging.
* Sep 22, 2015 4859 dgilling Prevent product generation in DRT mode.
* </pre>
*
* @author chammack
* @version 1
*/
public class WarngenDialog extends CaveSWTDialog implements
IWarningsArrivedListener {
IWarningsArrivedListener, ISimulatedTimeChangeListener {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(WarngenDialog.class);
@ -334,10 +337,13 @@ public class WarngenDialog extends CaveSWTDialog implements
warngenLayer = layer;
CurrentWarnings.addListener(this);
new TemplateRunnerInitJob().schedule();
SimulatedTime.getSystemTime().addSimulatedTimeChangeListener(this);
}
@Override
protected void disposed() {
SimulatedTime.getSystemTime().removeSimulatedTimeChangeListener(this);
if (bulletListFont != null) {
bulletListFont.dispose();
}
@ -876,6 +882,13 @@ public class WarngenDialog extends CaveSWTDialog implements
okButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
if (!SimulatedTimeOperations.isTransmitAllowed()) {
Shell shell = getShell();
SimulatedTimeOperations.displayFeatureLevelWarning(shell,
"Create WarnGen product");
return;
}
okPressed();
}
@ -1109,8 +1122,9 @@ public class WarngenDialog extends CaveSWTDialog implements
durList.add(data.displayString);
}
// Add the default duration to the list if what was missing
if (! isDefaultDurationInList && defaultDuration != null) {
durationList.setData(defaultDuration.displayString, defaultDuration);
if (!isDefaultDurationInList && defaultDuration != null) {
durationList
.setData(defaultDuration.displayString, defaultDuration);
durList.add(0, defaultDuration.displayString);
}
@ -1190,8 +1204,9 @@ public class WarngenDialog extends CaveSWTDialog implements
long t0 = System.currentTimeMillis();
try {
monitor.beginTask("Generating product", 1);
statusHandler.debug("using startTime " + startTime.getTime()
+ " endTime " + endTime.getTime());
statusHandler.debug("using startTime "
+ startTime.getTime() + " endTime "
+ endTime.getTime());
String result = TemplateRunner.runTemplate(
warngenLayer, startTime.getTime(),
endTime.getTime(), selectedBullets,
@ -1224,8 +1239,7 @@ public class WarngenDialog extends CaveSWTDialog implements
new Job("Transmitting Warning") {
@Override
protected IStatus run(IProgressMonitor monitor) {
statusHandler.debug(
": Transmitting Warning Job Running");
statusHandler.debug(": Transmitting Warning Job Running");
// Launch the text editor display as the warngen editor
// dialog using the result aka the warngen text product.
@ -1694,10 +1708,12 @@ public class WarngenDialog extends CaveSWTDialog implements
.equalsIgnoreCase(lastAreaSource);
boolean snapHatchedAreaToPolygon = isDifferentAreaSources;
boolean preservedSelection = !isDifferentAreaSources;
if (isDifferentAreaSources || !warngenLayer.getConfiguration()
.getHatchedAreaSource().getAreaSource().toLowerCase().equals("marinezones")) {
if (isDifferentAreaSources
|| !warngenLayer.getConfiguration().getHatchedAreaSource()
.getAreaSource().toLowerCase().equals("marinezones")) {
// If template has a different hatched area source from the previous
// template, then the warned area would be based on the polygon and not
// template, then the warned area would be based on the polygon and
// not
// preserved.
try {
warngenLayer.updateWarnedAreas(snapHatchedAreaToPolygon,
@ -1776,7 +1792,8 @@ public class WarngenDialog extends CaveSWTDialog implements
FollowupData data = (FollowupData) updateListCbo
.getData(updateListCbo.getItem(updateListCbo
.getSelectionIndex()));
statusHandler.debug("updateListSelected: " + (data != null ? data.getDisplayString() : "(null)"));
statusHandler.debug("updateListSelected: "
+ (data != null ? data.getDisplayString() : "(null)"));
Mode currMode = warngenLayer.getStormTrackState().mode;
if (data != null) {
// does not refesh if user selected already highlighted option
@ -1928,7 +1945,8 @@ public class WarngenDialog extends CaveSWTDialog implements
@Override
public void dialogClosed(Object returnValue) {
int duration = (Integer) returnValue;
statusHandler.debug("changeSelected.dialogClosed: " + duration);
statusHandler.debug("changeSelected.dialogClosed: "
+ duration);
if (duration != -1) {
durationList.setEnabled(false);
endTime.add(Calendar.MINUTE, duration);
@ -2643,13 +2661,13 @@ public class WarngenDialog extends CaveSWTDialog implements
}
private void restoreDuration(int duration) {
warngenLayer.getStormTrackState().duration =
warngenLayer.getStormTrackState().newDuration = duration;
warngenLayer.getStormTrackState().duration = warngenLayer
.getStormTrackState().newDuration = duration;
warngenLayer.getStormTrackState().geomChanged = true;
}
private int getSelectedDuration() {
Exception excToReport= null;
Exception excToReport = null;
DurationData data = null;
try {
data = (DurationData) durationList.getData(durationList
@ -2669,12 +2687,33 @@ public class WarngenDialog extends CaveSWTDialog implements
}
duration = 30;
}
statusHandler.handle(Priority.WARN,
"Unable to determine duration from selection in WarnGen dialog. Using default of "
+ duration + " minutes.", excToReport);
statusHandler
.handle(Priority.WARN,
"Unable to determine duration from selection in WarnGen dialog. Using default of "
+ duration + " minutes.", excToReport);
}
statusHandler.debug("selected duration is " + duration);
return duration;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.common.time.ISimulatedTimeChangeListener#timechanged()
*/
@Override
public void timechanged() {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
if ((getShell().isVisible())
&& (!SimulatedTimeOperations.isTransmitAllowed())) {
SimulatedTimeOperations.displayFeatureLevelWarning(
getShell(), "WarnGen");
}
}
});
}
}

View file

@ -231,6 +231,7 @@
<alias base="FFG-TAR">RFCFFG_ParameterInfo</alias>
<alias base="FFG-TIR">RFCFFG_ParameterInfo</alias>
<alias base="FFG-TUA">RFCFFG_ParameterInfo</alias>
<alias base="NationalBlend">NationalBlend</alias>
<alias base="PGBlended">PGBlended</alias>
<alias base="PGBlended-Night">PGBlended</alias>
<alias base="NCOM-USEAST">ncom</alias>

View file

@ -11,8 +11,10 @@
Feb 24, 2015 DR 16671 byin Added HPBL for RUC13
May 21, 2015 DR 17515 bhunder Added parameters for URMA25
Jun 29, 2015 #4537 rferrel Added parameters for HRRR.
Oct 08, 2015 #4958 dgilling Added parameters for NationalBlend.
-->
<aliasList caseSensitive="true" namespace="gfeParamName">
<alias base="APTMP">aptmp</alias>
<alias base="AV">av</alias>
<alias base="CAPE">cape</alias>
<alias base="CFRZR">cfrzr</alias>

View file

@ -27,8 +27,8 @@
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 01/14/13 njensen Initial Creation.
#
# 01/14/2013 #1497 njensen Initial Creation.
# 10/12/2015 #4967 randerso Updated for new JEP API
#
#
@ -67,6 +67,8 @@ def __getMaskIndiciesForJava(mask):
return xcoords, ycoords
# Originally added for use by BOX SmartInitUtils.SIU_fillEditArea() to speed up their smartInits
# Should be used by other smartInits that need similar functionality
def fillEditArea(grid, fillMask, borderMask):
editPointsX, editPointsY = __getMaskIndiciesForJava(fillMask)
borderPointsX, borderPointsY = __getMaskIndiciesForJava(borderMask)
@ -74,7 +76,7 @@ def fillEditArea(grid, fillMask, borderMask):
gridObj = JavaSmartUtils.fillEditArea(grid, grid.shape[1], grid.shape[0], \
editPointsY, editPointsX, borderPointsY, borderPointsX)
retObj = gridObj.__numpy__[0]
retObj = gridObj.getNDArray()
return retObj

View file

@ -67,8 +67,9 @@
# 05/12/2015 #17144 bhunder Added RTMA model
# 05/29/2015 17496 ryu Changed parm definitions for Wave1-10 and Period1-10.
#
# 05/29/2015 #17144 bhunder Added weather Params for URMA25 and OCONUS RTMA
# 05/29/2015 #17144 bhunder Added weather Params for URMA25 and OCONUS RTMA
# 09/02/2015 #4819 rferrel Added HWRF.
# 10/07/2015 #4958 dgilling Added support for NationalBlend D2D data.
####################################################################################################
#----------------------------------------------------------------------------
@ -1364,6 +1365,7 @@ elif SID in CONUS_EAST_SITES:
('FFG-TAR', 'FFGTAR'),
('FFG-TIR', 'FFGTIR'),
('FFG-TUA', 'FFGTUA'),
'NationalBlend',
'PGBlended',
'PGBlended-Night',
('NCOM-USEAST', 'NCOMUSEAST'),
@ -1448,6 +1450,7 @@ else: #######DCS3501 WEST_CONUS
('FFG-TAR', 'FFGTAR'),
('FFG-TIR', 'FFGTIR'),
('FFG-TUA', 'FFGTUA'),
'NationalBlend',
'PGBlended',
'PGBlended-Night',
('NCOM-SOCAL', 'NCOMSOCAL'),

View file

@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<gridParamInfo xmlns:ns2="group">
<valtimeMINUSreftime>
<fcst>0</fcst>
<fcst>10800</fcst>
<fcst>21600</fcst>
<fcst>32400</fcst>
<fcst>43200</fcst>
<fcst>54000</fcst>
<fcst>64800</fcst>
<fcst>75600</fcst>
<fcst>86400</fcst>
<fcst>97200</fcst>
<fcst>108000</fcst>
<fcst>118800</fcst>
<fcst>129600</fcst>
<fcst>140400</fcst>
<fcst>151200</fcst>
<fcst>162000</fcst>
<fcst>172800</fcst>
<fcst>183600</fcst>
<fcst>194400</fcst>
<fcst>205200</fcst>
<fcst>216000</fcst>
<fcst>226800</fcst>
<fcst>237600</fcst>
<fcst>248400</fcst>
<fcst>259200</fcst>
<fcst>270000</fcst>
<fcst>280800</fcst>
<fcst>291600</fcst>
<fcst>302400</fcst>
<fcst>313200</fcst>
<fcst>324000</fcst>
<fcst>334800</fcst>
<fcst>345600</fcst>
<fcst>356400</fcst>
<fcst>367200</fcst>
<fcst>378000</fcst>
<fcst>388800</fcst>
<fcst>399600</fcst>
<fcst>410400</fcst>
<fcst>421200</fcst>
<fcst>432000</fcst>
<fcst>442800</fcst>
<fcst>453600</fcst>
<fcst>464400</fcst>
<fcst>475200</fcst>
<fcst>486000</fcst>
<fcst>496800</fcst>
<fcst>507600</fcst>
<fcst>518400</fcst>
<fcst>529200</fcst>
<fcst>540000</fcst>
<fcst>550800</fcst>
<fcst>561600</fcst>
<fcst>572400</fcst>
<fcst>583200</fcst>
<fcst>594000</fcst>
<fcst>604800</fcst>
<fcst>615600</fcst>
<fcst>626400</fcst>
<fcst>637200</fcst>
<fcst>648000</fcst>
<fcst>658800</fcst>
<fcst>669600</fcst>
<fcst>680400</fcst>
<fcst>691200</fcst>
</valtimeMINUSreftime>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>t</short_name>
<long_name>temperature</long_name>
<units>K</units>
<udunits>degree_Kelvin</udunits>
<uiname>T</uiname>
<valid_range>180.0</valid_range>
<valid_range>330.0</valid_range>
<fillValue>-999999.0</fillValue>
<n3D>1</n3D>
<levelsDesc>2 FHAG</levelsDesc>
<levels>
<level>FHAG2</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>dpt</short_name>
<long_name>Dewpoint Temperature</long_name>
<units>K</units>
<udunits>degree_Kelvin</udunits>
<uiname>Td</uiname>
<valid_range>180.0</valid_range>
<valid_range>330.0</valid_range>
<fillValue>-999999.0</fillValue>
<n3D>1</n3D>
<levelsDesc>FHAG 2</levelsDesc>
<levels>
<level>FHAG2</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>mnt12hr</short_name>
<long_name>Minimum Temperature</long_name>
<units>K</units>
<udunits>degree_Kelvin</udunits>
<uiname>minT</uiname>
<valid_range>180.0</valid_range>
<valid_range>330.0</valid_range>
<fillValue>-999999.0</fillValue>
<n3D>1</n3D>
<levelsDesc>FHAG 2</levelsDesc>
<levels>
<level>FHAG2</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>mxt12hr</short_name>
<long_name>Maximum Temperature</long_name>
<units>K</units>
<udunits>degree_Kelvin</udunits>
<uiname>maxT</uiname>
<valid_range>180.0</valid_range>
<valid_range>330.0</valid_range>
<fillValue>-999999.0</fillValue>
<n3D>1</n3D>
<levelsDesc>FHAG 2</levelsDesc>
<levels>
<level>FHAG2</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>pop</short_name>
<long_name>Probability of 12hr precip</long_name>
<units>%</units>
<udunits>percent</udunits>
<uiname>12hrPcpProb</uiname>
<valid_range>0.0</valid_range>
<valid_range>100.0</valid_range>
<fillValue>-999999.0</fillValue>
<n3D>0</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>tcc</short_name>
<long_name>Total Cloud Cover</long_name>
<units>%</units>
<udunits>percent</udunits>
<uiname>totalCldCvr</uiname>
<valid_range>0.0</valid_range>
<valid_range>100.0</valid_range>
<fillValue>-999999.0</fillValue>
<n3D>0</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>ws</short_name>
<long_name>Wind Speed</long_name>
<units>m/s</units>
<udunits>meter/sec</udunits>
<uiname>windSpeed</uiname>
<valid_range>-150.0</valid_range>
<valid_range>150.0</valid_range>
<fillValue>-999999.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>wd</short_name>
<long_name>Wind Direction</long_name>
<units>degreeTrue</units>
<udunits>degree_True</udunits>
<uiname>windDir</uiname>
<valid_range>0.0</valid_range>
<valid_range>360.0</valid_range>
<fillValue>-999999.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>rh</short_name>
<long_name>Relative Humidity</long_name>
<units>%</units>
<udunits>percent</udunits>
<uiname>rh</uiname>
<valid_range>0.0</valid_range>
<valid_range>100.0</valid_range>
<fillValue>-999999.0</fillValue>
<n3D>1</n3D>
<levelsDesc>FHAG 2</levelsDesc>
<levels>
<level>FHAG2</level>
</levels>
</gridParameterInfo>
<gridParameterInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="parameterInfo">
<short_name>aptmp</short_name>
<long_name>Apparent Temperature</long_name>
<units>K</units>
<udunits>degree_Kelvin</udunits>
<uiname>aptmp</uiname>
<valid_range>180.0</valid_range>
<valid_range>330.0</valid_range>
<fillValue>-999999.0</fillValue>
<n3D>1</n3D>
<levelsDesc>2 FHAG</levelsDesc>
<levels>
<level>FHAG2</level>
</levels>
</gridParameterInfo>
</gridParamInfo>

View file

@ -21,8 +21,10 @@ package com.raytheon.uf.common.monitor.config;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
@ -49,7 +51,7 @@ import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
/**
* Monitor configuration manager.
* Fog, SAFESEAS and SNOW Monitor configuration manager.
*
* <pre>
*
@ -68,6 +70,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* May 15 2014 3086 skorolev Renamed from MonitorConfigurationManager. Replaces three separate area configuration managers with one.
* Sep 04 2014 3220 skorolev Added fileUpdated method.
* Feb 24 2015 3220 dhladky Made sure config file is read in on change.
* Sep 17 2015 3873 skorolev Corrected getInstance, addArea, addAdjArea and added getAdjAreaConfigXml.
*
* </pre>
*
@ -108,9 +111,6 @@ public class FSSObsMonitorConfigurationManager implements
/** Name of plugin */
private static String pluginName = null;
/** Monitor name */
private static String monitorName = null;
/** Name of area configuration file */
private String configFileName = null;
@ -128,28 +128,29 @@ public class FSSObsMonitorConfigurationManager implements
ss, fog, snow
};
/** Default value for Timewindow in hours */
private static final double DEFAULT_TIME = 2;
/** Localization Area Configuration File. */
private LocalizationFile lacf = null;
/** Configuration XML is updated and saved */
protected boolean isPopulated;
/** Singleton instance of this class */
private static FSSObsMonitorConfigurationManager instance = null;
/** Map for current configuration managers. */
private final static Map<MonName, FSSObsMonitorConfigurationManager> instanceMap = new HashMap<>();
/**
* Private Constructor
*
* @param monitorName
*/
public FSSObsMonitorConfigurationManager(String monitorName) {
setMonitorName(monitorName);
setPopulated(false);
private FSSObsMonitorConfigurationManager(MonName monitorName) {
// Avoid confusion in file path
if (monitorName == MonName.ss.name()) {
if (monitorName == MonName.ss) {
pluginName = "safeseas";
} else {
pluginName = monitorName;
pluginName = monitorName.name();
}
/** Path to Monitoring Area Configuration XML. */
setConfigFileName(pluginName + File.separatorChar + "monitoringArea"
@ -162,19 +163,21 @@ public class FSSObsMonitorConfigurationManager implements
configXml = new MonAreaConfigXML();
adjAreaConfigXml = new MonAreaConfigXML();
readConfigXml();
setPopulated(false);
}
/**
* Get an instance of Configuration manager for FSSObs monitors.
* Returns instance of current monitor.
*
* @param monitor
* Name of monitor
* @return Instance of manager
* @return
*/
public static synchronized FSSObsMonitorConfigurationManager getInstance(
String monitor) {
MonName monitor) {
FSSObsMonitorConfigurationManager instance = instanceMap.get(monitor);
if (instance == null) {
instance = new FSSObsMonitorConfigurationManager(monitor);
instanceMap.put(monitor, instance);
}
return instance;
}
@ -188,6 +191,7 @@ public class FSSObsMonitorConfigurationManager implements
public void readConfigXml() {
boolean monitorAreaFileExists = true;
boolean adjacentAreaFileExists = true;
// Read area configuration XML file.
try {
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationContext lc = pm.getContext(
@ -198,7 +202,6 @@ public class FSSObsMonitorConfigurationManager implements
MonAreaConfigXML configXmltmp = jaxb
.unmarshalFromXmlFile(monitorAreaFilePath.toString());
configXml = configXmltmp;
setPopulated(true);
} catch (Exception e) {
statusHandler
.handle(Priority.WARN,
@ -208,7 +211,7 @@ public class FSSObsMonitorConfigurationManager implements
+ "");
monitorAreaFileExists = false;
}
// Read adjacent area configuration XML file.
try {
IPathManager pm = PathManagerFactory.getPathManager();
String adjacentAreaFilePath = pm.getFile(
@ -218,7 +221,6 @@ public class FSSObsMonitorConfigurationManager implements
MonAreaConfigXML configXmltmp = jaxb
.unmarshalFromXmlFile(adjacentAreaFilePath.toString());
adjAreaConfigXml = configXmltmp;
} catch (Exception e) {
statusHandler
.handle(Priority.WARN,
@ -276,9 +278,7 @@ public class FSSObsMonitorConfigurationManager implements
configXml.addAreaId(zoneXml);
}
}
// Default value for Timewindow.
int defaultVal = 2;
configXml.setTimeWindow(defaultVal);
configXml.setTimeWindow(DEFAULT_TIME);
saveConfigXml();
}
// Check for an adjacent area config file, if one does not exist,
@ -491,8 +491,10 @@ public class FSSObsMonitorConfigurationManager implements
for (AreaIdXML area : areaList) {
if (area.getAreaId().equals(areaId)) {
List<StationIdXML> stationList = area.getStationIds();
for (StationIdXML station : stationList) {
results.add(station.getName() + "#" + station.getType());
if (!stationList.isEmpty()) {
for (StationIdXML station : stationList) {
results.add(station.getName() + "#" + station.getType());
}
}
}
}
@ -512,8 +514,10 @@ public class FSSObsMonitorConfigurationManager implements
for (AreaIdXML area : areaList) {
if (area.getAreaId().equals(areaId)) {
List<StationIdXML> stationList = area.getStationIds();
for (StationIdXML station : stationList) {
results.add(station.getName() + "#" + station.getType());
if (!stationList.isEmpty()) {
for (StationIdXML station : stationList) {
results.add(station.getName() + "#" + station.getType());
}
}
}
}
@ -533,8 +537,10 @@ public class FSSObsMonitorConfigurationManager implements
for (AreaIdXML area : areaList) {
if (area.getAreaId().equals(areaId)) {
List<StationIdXML> stationList = area.getStationIds();
for (StationIdXML station : stationList) {
results.add(station.getName());
if (!stationList.isEmpty()) {
for (StationIdXML station : stationList) {
results.add(station.getName());
}
}
}
}
@ -553,9 +559,11 @@ public class FSSObsMonitorConfigurationManager implements
List<AreaIdXML> areaList = configXml.getAreaIds();
for (AreaIdXML area : areaList) {
List<StationIdXML> stationList = area.getStationIds();
for (StationIdXML station : stationList) {
if (station.getName().equals(stationId)) {
results.add(area.getAreaId());
if (!stationList.isEmpty()) {
for (StationIdXML station : stationList) {
if (station.getName().equals(stationId)) {
results.add(area.getAreaId());
}
}
}
}
@ -572,9 +580,11 @@ public class FSSObsMonitorConfigurationManager implements
List<String> stations = new ArrayList<String>();
for (AreaIdXML area : areaXml) {
List<StationIdXML> stationList = area.getStationIds();
for (StationIdXML station : stationList) {
stations.add(station.getName() + "#" + station.getType() + "#"
+ area.getAreaId());
if (!stationList.isEmpty()) {
for (StationIdXML station : stationList) {
stations.add(station.getName() + "#" + station.getType()
+ "#" + area.getAreaId());
}
}
}
return stations;
@ -590,8 +600,10 @@ public class FSSObsMonitorConfigurationManager implements
Set<String> stations = new HashSet<String>();
for (AreaIdXML area : areaXml) {
List<StationIdXML> stationList = area.getStationIds();
for (StationIdXML station : stationList) {
stations.add(station.getName());
if (!stationList.isEmpty()) {
for (StationIdXML station : stationList) {
stations.add(station.getName());
}
}
}
return stations;
@ -639,10 +651,12 @@ public class FSSObsMonitorConfigurationManager implements
for (AreaIdXML areaXml : areaList) {
if (areaXml.getAreaId().equals(area)) {
List<StationIdXML> stationList = areaXml.getStationIds();
for (int i = 0; i < stationList.size(); i++) {
if (stationList.get(i).getName().equals(station)) {
stationList.remove(i);
areaXml.getStationIds();
if (!stationList.isEmpty()) {
for (int i = 0; i < stationList.size(); i++) {
if (stationList.get(i).getName().equals(station)) {
stationList.remove(i);
areaXml.getStationIds();
}
}
}
}
@ -659,11 +673,13 @@ public class FSSObsMonitorConfigurationManager implements
List<AreaIdXML> areaList = configXml.getAreaIds();
for (AreaIdXML areaXml : areaList) {
List<StationIdXML> stationList = areaXml.getStationIds();
for (int i = 0; i < stationList.size(); i++) {
StationIdXML stationXml = stationList.get(i);
if (stationXml.getName().equals(station)) {
stationList.remove(i);
i--;
if (!stationList.isEmpty()) {
for (int i = 0; i < stationList.size(); i++) {
StationIdXML stationXml = stationList.get(i);
if (stationXml.getName().equals(station)) {
stationList.remove(i);
i--;
}
}
}
}
@ -841,9 +857,11 @@ public class FSSObsMonitorConfigurationManager implements
for (AreaIdXML area : areaList) {
if (area.getAreaId().equals(theZone)) {
List<StationIdXML> stationList = area.getStationIds();
for (StationIdXML station : stationList) {
if (station.getName().equals(theStation)) {
return station.getType();
if (!stationList.isEmpty()) {
for (StationIdXML station : stationList) {
if (station.getName().equals(theStation)) {
return station.getType();
}
}
}
}
@ -937,24 +955,6 @@ public class FSSObsMonitorConfigurationManager implements
}
}
/**
* Gets Monitor Name.
*
* @return monitor name
*/
public String getMonitorName() {
return monitorName;
}
/**
* Sets Monitor Name.
*
* @param monitorName
*/
public void setMonitorName(String monitorName) {
FSSObsMonitorConfigurationManager.monitorName = monitorName;
}
/**
* Flag is true if config file updated and saved.
*
@ -1011,4 +1011,8 @@ public class FSSObsMonitorConfigurationManager implements
adjAreaConfigXml.addAreaId(area);
}
}
public List<MonitorConfigListener> getListeners() {
return listeners;
}
}

View file

@ -19,7 +19,6 @@
**/
package com.raytheon.uf.common.monitor.data;
/**
* Constants for Observations within the Decision Assistance Tool Suite that
* hark back to the SAFESEAS.H C++ header file.
@ -33,6 +32,7 @@ package com.raytheon.uf.common.monitor.data;
* Jan 26, 2010 4268 skorolev Corrected DisplayVarName according to
* VarName for SWELL
* Nov 06, 2013 2493 bsteffen Remove unused constants.
* Sep 18, 2015 3873 skorolev Added constants for Maritime data
*
* </pre>
*
@ -46,6 +46,12 @@ public final class ObConst {
private ObConst() {
}
/**
* The maximum number of most recent hours within which observation reports
* are to be archived.
*/
public static final int MAX_FRAMES = 64;
// Time Window in units of hours
public static final int THREAT_INTERVAL_HOURS = 2;
@ -76,6 +82,24 @@ public final class ObConst {
public static final String SKC_SKY_STRING = "SKC";
public static final String SYNOPTIC_SHIP = "1003";
public static final String SYNOPTIC_CMAN = "1004";
public static final String SYNOPTIC_MOORED_BUOY = "1005";
public static final String DRIFTING_BUOY = "1006";
public static final String SYNOPTIC_MAROB = "1007";
public static final String METAR = "METAR";
public static final String SPECI = "SPECI";
public static final String MARITIME = "MARITIME";
public static final String MESONET = "MESONET";
// Chosen Application Key
public enum ChosenAppKey {
SNOW, FOG, SAFESEAS
@ -107,7 +131,7 @@ public final class ObConst {
SYNOPTIC_MAROB,
MARINE,
MARITIME,
METAR,

View file

@ -28,6 +28,7 @@
# 06/11/13 #2083 randerso Fixed getISCSites to look in configured
# 02/20/2014 #2824 randerso Added log message when no localVTECPartners file is found
# Apr 25, 2015 4952 njensen Updated for new JEP API
# 09/30/2015 18141 ryu Added PHFO to VTEC_TPC_SITE
#
#VTEC_Partners.py - configuration file to control filtering and merging
@ -40,7 +41,7 @@ VTEC_TABLE_REQUEST_SITES = []
# Name of site identifier for SPC and TCV bulletins. 4-characters.
VTEC_SPC_SITE = ['KWNS']
VTEC_TPC_SITE = ['KNHC']
VTEC_TPC_SITE = ['KNHC', 'PHFO']
# The following list is a set of office identifiers which is used
# in the ingestAT/MergeVTEC software to filter out records from offices

View file

@ -67,6 +67,7 @@ import com.raytheon.uf.edex.menus.AbstractMenuUtil;
* Configuration Manager has not read a
* FFMPRunConfig.xml file.
* Sep 04, 2014 3220 skorolev Updated menu creation for Fog, Safeseas and Snow monitors.
* Sep 18, 2015 3873 skorolev Corrected Fog, Safeseas and Snow monitor's names.
*
* </pre>
*
@ -483,26 +484,26 @@ public class DatMenuUtil extends AbstractMenuUtil {
*/
private void createSafeseasMenu() {
FSSObsMonitorConfigurationManager ssConfig = FSSObsMonitorConfigurationManager
.getInstance(MonName.ss.name());
Set<String> ssStns = ssConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : ssStns) {
if (stations.length() > 0) {
stations.append(",");
}
stations.append(s);
.getInstance(MonName.ss);
Set<String> ssStns = ssConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : ssStns) {
if (stations.length() > 0) {
stations.append(",");
}
String ssStations = stations.toString();
CommonMenuContributionFile safeMenuContributionFile = new CommonMenuContributionFile();
safeMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
safeMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
safeMenuContributionFile.contribution[0] = processOtherContribution(
ssStations, "menus/safeseas/baseSafeSeas.xml",
"menu:obs?before=EndOfMaritime", "SAFESEAS",
safeMenuContributionFile.contribution[0]);
toXml(safeMenuContributionFile, "menus" + File.separator
+ "safeseas" + File.separator + "index.xml");
ssConfig = null;
stations.append(s);
}
String ssStations = stations.toString();
CommonMenuContributionFile safeMenuContributionFile = new CommonMenuContributionFile();
safeMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
safeMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
safeMenuContributionFile.contribution[0] = processOtherContribution(
ssStations, "menus/safeseas/baseSafeSeas.xml",
"menu:obs?before=EndOfMaritime", "SAFESEAS",
safeMenuContributionFile.contribution[0]);
toXml(safeMenuContributionFile, "menus" + File.separator + "safeseas"
+ File.separator + "index.xml");
ssConfig = null;
}
/**
@ -510,26 +511,26 @@ public class DatMenuUtil extends AbstractMenuUtil {
*/
private void createFogMenu() {
FSSObsMonitorConfigurationManager fogConfig = FSSObsMonitorConfigurationManager
.getInstance(MonName.fog.name());
Set<String> fogStns = fogConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : fogStns) {
if (stations.length() > 0) {
stations.append(",");
}
stations.append(s);
.getInstance(MonName.fog);
Set<String> fogStns = fogConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : fogStns) {
if (stations.length() > 0) {
stations.append(",");
}
String fogStations = stations.toString();
CommonMenuContributionFile fogMenuContributionFile = new CommonMenuContributionFile();
fogMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
fogMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
fogMenuContributionFile.contribution[0] = processOtherContribution(
fogStations, "menus/fog/baseFog.xml",
"menu:obs?after=FOGPLACEHOLDER", "Fog Monitor",
fogMenuContributionFile.contribution[0]);
toXml(fogMenuContributionFile, "menus" + File.separator + "fog"
+ File.separator + "index.xml");
fogConfig = null;
stations.append(s);
}
String fogStations = stations.toString();
CommonMenuContributionFile fogMenuContributionFile = new CommonMenuContributionFile();
fogMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
fogMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
fogMenuContributionFile.contribution[0] = processOtherContribution(
fogStations, "menus/fog/baseFog.xml",
"menu:obs?after=FOGPLACEHOLDER", "Fog Monitor",
fogMenuContributionFile.contribution[0]);
toXml(fogMenuContributionFile, "menus" + File.separator + "fog"
+ File.separator + "index.xml");
fogConfig = null;
}
/**
@ -537,26 +538,26 @@ public class DatMenuUtil extends AbstractMenuUtil {
*/
private void createSnowMenu() {
FSSObsMonitorConfigurationManager snowConfig = FSSObsMonitorConfigurationManager
.getInstance(MonName.snow.name());
Set<String> snowStns = snowConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : snowStns) {
if (stations.length() > 0) {
stations.append(",");
}
stations.append(s);
.getInstance(MonName.snow);
Set<String> snowStns = snowConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : snowStns) {
if (stations.length() > 0) {
stations.append(",");
}
String snowStations = stations.toString();
CommonMenuContributionFile snowMenuContributionFile = new CommonMenuContributionFile();
snowMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
snowMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
snowMenuContributionFile.contribution[0] = processOtherContribution(
snowStations, "menus/snow/baseSnow.xml",
"menu:obs?after=SNOWPLACEHOLDER", "SNOW",
snowMenuContributionFile.contribution[0]);
toXml(snowMenuContributionFile, "menus" + File.separator + "snow"
+ File.separator + "index.xml");
snowConfig = null;
stations.append(s);
}
String snowStations = stations.toString();
CommonMenuContributionFile snowMenuContributionFile = new CommonMenuContributionFile();
snowMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
snowMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
snowMenuContributionFile.contribution[0] = processOtherContribution(
snowStations, "menus/snow/baseSnow.xml",
"menu:obs?after=SNOWPLACEHOLDER", "SNOW",
snowMenuContributionFile.contribution[0]);
toXml(snowMenuContributionFile, "menus" + File.separator + "snow"
+ File.separator + "index.xml");
snowConfig = null;
}
/**

View file

@ -8,7 +8,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: com.raytheon.uf.edex.cpgsrv;bundle-version="1.12.1153",
com.raytheon.edex.common;bundle-version="1.12.1153",
com.raytheon.uf.common.dataplugin.fssobs;bundle-version="1.0.0",
com.raytheon.uf.edex.decodertools
com.raytheon.uf.edex.decodertools,
com.raytheon.uf.common.monitor
Export-Package: com.raytheon.uf.edex.plugin.fssobs,
com.raytheon.uf.edex.plugin.fssobs.common
Import-Package: com.raytheon.uf.common.monitor.config,
@ -17,8 +18,11 @@ Import-Package: com.raytheon.uf.common.monitor.config,
com.raytheon.uf.common.pointdata,
com.raytheon.uf.common.pointdata.spatial,
com.raytheon.uf.common.status,
com.raytheon.uf.common.wxmath,
com.raytheon.uf.edex.dat.utils,
com.raytheon.uf.edex.menus,
com.raytheon.uf.edex.plugin.fssobs,
com.raytheon.uf.edex.pointdata,
javax.measure.converter,
javax.measure.unit,
org.apache.commons.logging

View file

@ -20,14 +20,21 @@
package com.raytheon.uf.edex.plugin.fssobs;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.raytheon.edex.site.SiteUtil;
import com.raytheon.edex.urifilter.URIFilter;
import com.raytheon.edex.urifilter.URIGenerateMessage;
import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
import com.raytheon.uf.common.geospatial.SpatialException;
import com.raytheon.uf.common.monitor.MonitorAreaUtils;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.monitor.events.MonitorConfigEvent;
import com.raytheon.uf.common.monitor.events.MonitorConfigListener;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -37,6 +44,7 @@ import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.edex.cpgsrv.CompositeProductGenerator;
import com.raytheon.uf.edex.dat.utils.DatMenuUtil;
import com.raytheon.uf.edex.plugin.fssobs.common.FSSObsConfig;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Generates a FSSObs Record.
@ -51,6 +59,7 @@ import com.raytheon.uf.edex.plugin.fssobs.common.FSSObsConfig;
* May 23, 2014 3086 skorolev Cleaned code.
* Aug 18, 2014 3530 bclement removed constructDataURI() call
* Sep 04, 2014 3220 skorolev Replaced 3 URI filters with one.
* Sep 18, 2015 3873 skorolev Added moving platforms testing.
*
* </pre>
*
@ -69,10 +78,14 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
/** Product */
private static final String productType = "fssobs";
/** Sets of all stations to filter for */
private HashSet<String> allStations = null;
/** Stations to filter */
private Set<String> allStations = new HashSet<String>();
private FSSObsMonitorConfigurationManager currManager = null;
public FSSObsMonitorConfigurationManager fogmcm = null;
public FSSObsMonitorConfigurationManager ssmcm = null;
public FSSObsMonitorConfigurationManager snowmcm = null;
/**
* Public construction
@ -92,29 +105,84 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
public void generateProduct(URIGenerateMessage genMessage) {
FSSObsConfig fss_config = null;
boolean isStationary = true;
try {
fss_config = new FSSObsConfig(genMessage, this);
this.setPluginDao(new FSSObsDAO(productType));
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
}
FSSObsRecord[] fssRecs = new FSSObsRecord[genMessage.getUris().length];
int i = 0;
List<FSSObsRecord> fssRecs = new ArrayList<FSSObsRecord>();
for (String uri : genMessage.getUris()) {
// Test if moving platforms are within configuration distance
if (uri.contains(ObConst.SYNOPTIC_SHIP)
|| uri.contains(ObConst.DRIFTING_BUOY)
|| uri.contains(ObConst.SYNOPTIC_MAROB)) {
isStationary = false;
try {
if (!isNearZone(uri)) {
continue;
}
} catch (SpatialException e) {
statusHandler.handle(Priority.PROBLEM,
e.getLocalizedMessage(), e);
}
}
FSSObsRecord fssObsRec = new FSSObsRecord();
fssObsRec.setIsStationary(isStationary);
fssObsRec = fss_config.getTableRow(uri);
FSSObsDataTransform.buildView(fssObsRec);
fssRecs[i] = fssObsRec;
i++;
fssRecs.add(fssObsRec);
}
if (fssRecs.length > 0) {
this.setPluginDataObjects(fssRecs);
if (!fssRecs.isEmpty()) {
this.setPluginDataObjects((PluginDataObject[]) fssRecs
.toArray(new PluginDataObject[fssRecs.size()]));
statusHandler.handle(Priority.INFO, "===> Successfully generated "
+ fssRecs.length + " records.");
+ fssRecs.size() + " records.");
}
}
/**
* Test distance between moving platform and zone centroud.
*
* @param uri
* @return
* @throws SpatialException
*/
private boolean isNearZone(String uri) throws SpatialException {
boolean retVal = false;
Set<String> marineZone = new HashSet<String>();
for (String z : getSSConfig().getAreaList()) {
if (z.charAt(2) == 'Z') {
marineZone.add(z);
}
}
for (String z : getFogConfig().getAreaList()) {
if (z.charAt(2) == 'Z') {
marineZone.add(z);
}
}
double ssShipDist = getSSConfig().getShipDistance();
double fogShipDist = getFogConfig().getShipDistance();
// take the biggest distance
double configDist = ssShipDist > fogShipDist ? ssShipDist : fogShipDist;
if (configDist != 0.0) {
String[] items = uri.split("/");
double latShip = Double.parseDouble(items[6]);
double lonShip = Double.parseDouble(items[7]);
for (String zone : marineZone) {
Coordinate coor = MonitorAreaUtils.getZoneCenter(zone);
double shipTozone = distance(latShip, lonShip, coor.y, coor.x);
if (shipTozone < configDist) {
retVal = true;
}
}
}
return retVal;
}
/*
* (non-Javadoc)
*
@ -125,7 +193,6 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
protected void createFilters() {
filters = new URIFilter[1];
filters[0] = new FSSObsURIFilter(genName, allStations);
allStations = null;
}
/*
@ -138,14 +205,9 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
protected void configureFilters() {
statusHandler.handle(Priority.INFO, getGeneratorName()
+ " process Filter Config...");
allStations = new HashSet<String>();
for (MonName mname : MonName.values()) {
currManager = new FSSObsMonitorConfigurationManager(mname.name());
currManager.addListener(this);
allStations.addAll(currManager.getStations());
currManager = null;
}
allStations.addAll(getFogConfig().getStations());
allStations.addAll(getSSConfig().getStations());
allStations.addAll(getSnowConfig().getStations());
}
/**
@ -187,4 +249,79 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
dmu.createMenus();
}
}
/**
* Distance between two coordinates.
*
* @param lat1
* @param lon1
* @param lat2
* @param lon2
* @return distance in km
*/
public static double distance(double lat1, double lon1, double lat2,
double lon2) {
// Earth's radius of 6378.137 kilometers
float EarthRadius = 6378.137f;
double dLat = toRad(lat2 - lat1);
double dLon = toRad(lon2 - lon1);
lat1 = toRad(lat1);
lat2 = toRad(lat2);
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.sin(dLon / 2)
* Math.sin(dLon / 2) * Math.cos(lat1) * Math.cos(lat2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
return EarthRadius * c;
}
/**
* From grad to radian.
*
* @param value
* @return
*/
private static double toRad(double value) {
return value * Math.PI / 180;
}
/**
* Gets Fog Monitor Configuration Manager.
*
* @return fogmcm
*/
public FSSObsMonitorConfigurationManager getFogConfig() {
if (fogmcm == null) {
fogmcm = FSSObsMonitorConfigurationManager.getInstance(MonName.fog);
fogmcm.addListener(this);
}
return fogmcm;
}
/**
* Gets Safeseas Monitor Configuration Manager.
*
* @return ssmcm
*/
public FSSObsMonitorConfigurationManager getSSConfig() {
if (ssmcm == null) {
ssmcm = FSSObsMonitorConfigurationManager.getInstance(MonName.ss);
ssmcm.addListener(this);
}
return ssmcm;
}
/**
* Gets Snow Monitor Configuration Manager.
*
* @return snowmcm
*/
public FSSObsMonitorConfigurationManager getSnowConfig() {
if (snowmcm == null) {
snowmcm = FSSObsMonitorConfigurationManager
.getInstance(MonName.snow);
}
return snowmcm;
}
}

View file

@ -3,12 +3,15 @@ package com.raytheon.uf.edex.plugin.fssobs;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.TimeZone;
import java.util.regex.Pattern;
import com.raytheon.edex.urifilter.URIFilter;
import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.vividsolutions.jts.geom.Coordinate;
/**
@ -23,6 +26,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Dec 5, 2012 #1351 skorolev Cleaned code
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
* Sep 04, 2014 3220 skorolev Removed CWA from filter.
* Sep 17, 2015 3873 skorolev Added pattern for moving platforms.
*
* </pre>
*
@ -30,6 +34,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* @version 1.0
*/
public class FSSObsURIFilter extends URIFilter {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(URIFilter.class);
/** Station ID **/
private String stn;
@ -41,28 +47,26 @@ public class FSSObsURIFilter extends URIFilter {
private HashMap<String, Pattern> patternKeys = null;
/** METAR Pattern **/
private Pattern MetarPattern = null;
private Pattern metarPattern = null;
/** Maritime Pattern **/
private Pattern MaritimePattern = null;
private Pattern maritimePattern = null;
/** Mesowest Pattern **/
private Pattern MesowestPattern = null;
private Pattern mesowestPattern = null;
/** Pattern for moving platforms **/
private Pattern movingPattern = null;
/** Current data type #METAR, #Maritime or #Mesonet **/
private String dataType;
/** All filtered stations */
private HashSet<String> stations = null;
private Set<String> stations = null;
/** Date format **/
private static String datePattern = "yyyy-MM-dd_HH:mm:ss.S";
/** Station type **/
private enum StnType {
METAR, MARITIME, MESONET
};
/**
* Constructor
*
@ -72,7 +76,7 @@ public class FSSObsURIFilter extends URIFilter {
* @param stations
* for FSSObs filter
*/
public FSSObsURIFilter(String name, HashSet<String> stations) {
public FSSObsURIFilter(String name, Set<String> stations) {
super(name);
logger.info("FSSObsFilter " + name + " Filter construction...");
setDataTypes(new String[] { "obs", "sfcobs", "ldadmesonet" });
@ -96,19 +100,30 @@ public class FSSObsURIFilter extends URIFilter {
String[] tokens = pat.split(st);
setStn(tokens[0]);
setDataType(tokens[1]);
if (getDataType().equals(StnType.METAR.name())) {
switch (getDataType()) {
case ObConst.METAR:
setMetarPattern();
getMatchURIs().put(getMetarPattern(), 0l);
}
if (getDataType().equals(StnType.MARITIME.name())) {
break;
case ObConst.MARITIME:
setMaritimePattern();
getMatchURIs().put(getMaritimePattern(), 0l);
}
if (getDataType().equals(StnType.MESONET.name())) {
break;
case ObConst.MESONET:
setMesowestPattern();
getMatchURIs().put(getMesowestPattern(), 0l);
break;
default:
statusHandler.error("Get unknown data type " + getDataType());
break;
}
}
String[] repTyps = { ObConst.SYNOPTIC_SHIP, ObConst.DRIFTING_BUOY,
ObConst.SYNOPTIC_MAROB };
for (String rt : repTyps) {
setMovingPattern(rt);
getMatchURIs().put(getMovingPattern(), 0l);
}
}
/**
@ -194,7 +209,6 @@ public class FSSObsURIFilter extends URIFilter {
return key;
}
}
return null;
}
@ -265,7 +279,7 @@ public class FSSObsURIFilter extends URIFilter {
* @return MetarPattern
*/
public Pattern getMetarPattern() {
return MetarPattern;
return metarPattern;
}
/**
@ -273,7 +287,7 @@ public class FSSObsURIFilter extends URIFilter {
*/
public void setMetarPattern() {
// "/obs/2010-11-01_14:15:00.0/METAR<SPECI???>/null/K0A9/36.371/-82.173"
MetarPattern = Pattern.compile("/obs/" + wildCard + uriSeperator
metarPattern = Pattern.compile("/obs/" + wildCard + uriSeperator
+ wildCard + uriSeperator + "null" + uriSeperator + getStn()
+ uriSeperator);
}
@ -284,15 +298,15 @@ public class FSSObsURIFilter extends URIFilter {
* @return MaritimePattern
*/
public Pattern getMaritimePattern() {
return MaritimePattern;
return maritimePattern;
}
/**
* Sets Maritime Pattern
*/
public void setMaritimePattern() {
// /sfcobs/2010-10-28_10:36:00.0/1004/null/BEPB6/32.373/-64.703
MaritimePattern = Pattern.compile("/sfcobs/" + wildCard + uriSeperator
// /sfcobs/2010-10-28_10:36:00.0/1004[5]/null/BEPB6/32.373/-64.703
maritimePattern = Pattern.compile("/sfcobs/" + wildCard + uriSeperator
+ wildCard + uriSeperator + "null" + uriSeperator + getStn()
+ uriSeperator);
}
@ -303,7 +317,7 @@ public class FSSObsURIFilter extends URIFilter {
* @return the mesowestPattern
*/
public Pattern getMesowestPattern() {
return MesowestPattern;
return mesowestPattern;
}
/**
@ -313,12 +327,34 @@ public class FSSObsURIFilter extends URIFilter {
* the mesowestPattern to set
*/
public void setMesowestPattern() {
// There is no dataURI for ldadmesonet data
// /ldadmesonet/2011-06-29_22:10:00.0/mesonet/NWSRAWS/RINN4/41.1181/-74.2403
MesowestPattern = Pattern.compile("/ldadmesonet/" + wildCard
mesowestPattern = Pattern.compile("/ldadmesonet/" + wildCard
+ uriSeperator + wildCard + uriSeperator + wildCard
+ uriSeperator + getStn());
}
/**
* Gets pattern for moving platforms and MAROBs
*
* @return
*/
public Pattern getMovingPattern() {
return movingPattern;
}
/**
* Sets pattern for ships "1003", drifting buoys "1006" and MAROBs "1007".
*
* @param reportType
*/
public void setMovingPattern(String reportType) {
// /sfcobs/2010-10-28_10:36:00.0/1003<6,7>/null/BEPB6/32.373/-64.703
this.movingPattern = Pattern.compile("/sfcobs/" + wildCard
+ uriSeperator + reportType + uriSeperator + wildCard
+ uriSeperator);
}
/**
* Gets station name
*

View file

@ -19,24 +19,31 @@
**/
package com.raytheon.uf.edex.plugin.fssobs;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import javax.measure.converter.UnitConverter;
import javax.measure.unit.NonSI;
import javax.measure.unit.SI;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.geospatial.ISpatialQuery;
import com.raytheon.uf.common.geospatial.SpatialQueryFactory;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.pointdata.PointDataContainer;
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.wxmath.CalcRH;
import com.raytheon.uf.edex.database.dao.CoreDao;
import com.raytheon.uf.edex.database.dao.DaoConfig;
import com.raytheon.uf.edex.pointdata.PointDataQuery;
/**
* Get METAR and Maritime data records
* Utilities for FSSObs data records.
*
* <pre>
*
@ -52,6 +59,7 @@ import com.raytheon.uf.edex.pointdata.PointDataQuery;
* Jan 06, 2014 2653 skorolev Corrected decoding of snincrHourly and snincrTotal.
* Apr 28, 2014 3086 skorolev Updated getStations method.
* Sep 04, 2014 3220 skorolev Removed getStations method.
* Sep 18, 2015 3873 skorolev Removed identical constant definitions.
*
* </pre>
*
@ -63,40 +71,70 @@ public class FSSObsUtils {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(FSSObsUtils.class);
/** Centigrade -> Kelvin */
public static final float TMCK = 273.15f;
/** FAHRENHEIT -> CELSIUS */
private static final UnitConverter fToC = NonSI.FAHRENHEIT
.getConverterTo(SI.CELSIUS);
/**
* Value of missed data.
*/
public static final float MISSING = -9999.0f;
/** CELSIUS --> KELVIN */
private static final UnitConverter cToK = SI.CELSIUS
.getConverterTo(SI.KELVIN);
/**
* The constant representing the sky condition for sky clear
*/
private static final int SKC_SKY_CONDITION = 9999999;
/** Knots --> kilometers per hour */
private static final UnitConverter knotToKph = NonSI.KNOT
.getConverterTo(NonSI.KILOMETERS_PER_HOUR);
/**
* The constant representing the sky condition for clear sky
*/
private static final int CLR_SKY_CONDITION = 8888888;
private static final float defaultCeiling = 1e20f;
/** Plug-in name **/
private enum Plgn {
obs, sfcobs, ldadmesonet
};
// ----------- Constants required for Frostbite time calculation.---------:
// Temperature must be lower than -4.8C (23F) to avoid a calculation error
private static final float frostbiteTempMax = -4.8f;
private static final float f1 = -24.5f;
private static final float f2 = 0.667f;
private static final float f3 = 2111f;
private static final float f4 = -1.668f;
// ----------- Constants required for Wind Chill -------------:
private static float wctMax = 16.0f;
private static float defaultWct = 1e37f;
private static float windSpdMin = 6.4f;
private static float windSpdMax = 128.75f;
private static float wc1 = 0.16f;
private static float wc2 = 13.12f;
private static float wc3 = 0.6215f;
private static float wc4 = 11.37f;
private static float wc5 = 0.3965f;
/** plug-in for METAR data */
private static final String OBS = "obs";
/** plug-in for MARITIME data */
private static final String SFCOBS = "sfcobs";
/** plug-in for MESONET data */
private static final String LDADMESONET = "ldadmesonet";
/** Selected column in database **/
private static String slct = "dataURI";
private static final String SLCT = "dataURI";
/** Equal sign **/
private static String equ = "=";
private static final String EQU = "=";
/** Database **/
private static String db = "metadata";
/** SQL expression **/
private static String sqlexp = "select name from common_obs_spatial where ( catalogtype=1 or catalogtype=33 or catalogtype = 32 or catalogtype = 1000) and stationid = '";
private static final String METADATA = "metadata";
/**
* Constructor
@ -118,9 +156,9 @@ public class FSSObsUtils {
PointDataQuery request = null;
PointDataContainer result = null;
try {
request = new PointDataQuery(Plgn.obs.toString());
request = new PointDataQuery(OBS);
request.requestAllLevels();
request.addParameter(slct, uri, equ);
request.addParameter(SLCT, uri, EQU);
request.setParameters(FSSObsDataTransform.OBS_PARAMS_LIST);
result = request.execute();
if (result != null) {
@ -133,21 +171,34 @@ public class FSSObsUtils {
}
/**
* Gets station name from database.
* Gets descriptive station name from database. Returns Null if not found.
*
* @param stnId
* @return station name
*/
public static String getStationName(String stnId) {
CoreDao dao = null;
dao = new CoreDao(DaoConfig.forDatabase(METADATA));
String retVal = null;
ISpatialQuery sq = null;
String sql = sqlexp + stnId + "'";
/**
* SQL expression METAR CAT_TYPE_ICAO = 1; Known ship identifications -
* Mobile no lat/lon CAT_TYPE_SHIP_MOB = 30 Drifting buoy locations
* CAT_TYPE_BUOY_MOB = 31; Moored (Fixed) buoy locations
* CAT_TYPE_BUOY_FXD = 32; Coastal Marine (CMAN) locations CAT_TYPE_CMAN
* = 33; CAT_TYPE_MESONET = 1000; MESONET_NWSFAA = 1001?;
*/
String sql = "select name from common_obs_spatial where catalogtype in (1, 30, 31, 32, 33, 1000) and stationid = :stationid";
try {
sq = SpatialQueryFactory.create();
Object[] results = sq.dbRequest(sql, db);
retVal = (String) results[0];
Map<String, Object> paramMap = new HashMap<>(1, 1);
paramMap.put("stationid", stnId);
Object[] results = dao.executeSQLQuery(sql, paramMap);
if (results.length > 0) {
retVal = (String) results[0];
}
} catch (Exception e) {
statusHandler.handle(Priority.ERROR, e.getMessage());
statusHandler.handle(Priority.ERROR,
"Could not get station name for station id: " + stnId, e);
}
return retVal;
}
@ -165,8 +216,8 @@ public class FSSObsUtils {
PointDataQuery request = null;
PointDataContainer result = null;
try {
request = new PointDataQuery(Plgn.sfcobs.toString());
request.addParameter(slct, uri, equ);
request = new PointDataQuery(SFCOBS);
request.addParameter(SLCT, uri, EQU);
request.setParameters(FSSObsDataTransform.SFCOBS_PARAMS_LIST);
result = request.execute();
if (result != null) {
@ -195,9 +246,8 @@ public class FSSObsUtils {
try {
Map<String, RequestConstraint> rcMap = RequestConstraint
.toConstraintMapping(DataURIUtil.createDataURIMap(uri));
// Not actually in db
rcMap.remove("pluginName");
request = new PointDataQuery(Plgn.ldadmesonet.toString());
request = new PointDataQuery(LDADMESONET);
for (Entry<String, RequestConstraint> entry : rcMap.entrySet()) {
RequestConstraint rc = entry.getValue();
String value = rc.getConstraintValue();
@ -209,7 +259,6 @@ public class FSSObsUtils {
if (result != null) {
recFromMesowest = FSSObsDataTransform
.fromLdadmesowestRecord(result);
}
} catch (Exception e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
@ -228,18 +277,18 @@ public class FSSObsUtils {
* @return -- time in minutes
*/
public static float calcFrostbiteTime(float windspeedKPH, float temperatureC) {
float fbMinutes = MISSING;
float fbMinutes = ObConst.MISSING;
// Temperature must be lower than -4.8C (23F) to avoid a calculation
// error (a negative number to -1.668 power is NAN)
if (temperatureC < -4.8)
fbMinutes = ((-24.5f * ((0.667f * windspeedKPH) + 4.8f)) + 2111f)
* (float) Math.pow((-4.8 - temperatureC), -1.668);
if (temperatureC < frostbiteTempMax)
fbMinutes = ((f1 * ((f2 * windspeedKPH) + frostbiteTempMax)) + f3)
* (float) Math.pow((frostbiteTempMax - temperatureC), f4);
else
return MISSING;
return ObConst.MISSING;
// Check for frost bite boundaries
if (!(fbMinutes <= 30 && windspeedKPH > 25.0 && windspeedKPH <= 80.5))
fbMinutes = MISSING;
fbMinutes = ObConst.MISSING;
return fbMinutes;
}
@ -255,19 +304,18 @@ public class FSSObsUtils {
public static float calcWindChill(float temp, float windSpd) {
float spd;
/* arbitrarily do the calculation only for temps at or below 60F */
if (temp > 16.)
return 1e37f;
if (temp > wctMax)
return defaultWct;
/* no chilling if speed < 4 mph = 6.44km/h */
if (windSpd < 6.4)
if (windSpd < windSpdMin)
return temp;
/* peg speed at 80 mph (= 128.75 km/h) */
if (windSpd > 128.75)
if (windSpd > windSpdMax)
spd = 128.75f;
else
spd = windSpd;
spd = (float) Math.pow(spd, 0.16);
float windChillTemp = 13.12f + 0.6215f * temp - 11.37f * spd + 0.3965f
* temp * spd;
spd = (float) Math.pow(spd, wc1);
float windChillTemp = wc2 + wc3 * temp - wc4 * spd + wc5 * temp * spd;
return windChillTemp;
}
@ -275,7 +323,8 @@ public class FSSObsUtils {
* This method calculates a floating point number representing the ceiling.
* By definition, the ceiling is the lowest overcast or broken cloud layer,
* so the method looks for the lowest layer that matches a BKN or OVC
* condition, and returns that layer.
* condition, and returns that
* layer(http://www.srh.noaa.gov/srh/dad/sfc/chapter5.pdf).
*
* @param skyCov
* -- the set of sky coverage data
@ -283,29 +332,31 @@ public class FSSObsUtils {
*/
public static float findMetarCeilingFromLayers(String[] skyCov,
Number[] levels) {
float ceiling = 1e20f;
// Find a ceiling in a METAR report.
try {
for (int i = 0; i < skyCov.length; i++) {
String sc = skyCov[i];
// SCT ???
if (sc.equals("CLR")) {
ceiling = CLR_SKY_CONDITION;
break;
} else if (sc.equals("SKC")) {
ceiling = SKC_SKY_CONDITION;
break;
} else if ((sc.equals("BKN")) || (sc.equals("OVC"))) {
if (levels[i] != null) {
ceiling = levels[i].floatValue() / 100f;
break;
}
float ceiling = defaultCeiling;
for (int i = 0; i < skyCov.length; i++) {
String sc = skyCov[i];
// SCT = scattered ???
switch (sc) {
case "CLR":
ceiling = ObConst.CLR_SKY_CONDITION;
break;
case "SKC":
ceiling = ObConst.SKC_SKY_CONDITION;
break;
case "BKN":
case "OVC":
if (levels[i] != null) {
ceiling = levels[i].floatValue() / 100f;
}
break;
case "":
break;
default:
statusHandler.error("Get unknown sky cover " + sc);
break;
}
} catch (RuntimeException e) {
// ignore cloud cover that is null
}
return ceiling >= 1e20f ? MISSING : ceiling;
return ceiling >= defaultCeiling ? ObConst.MISSING : ceiling;
}
/**
@ -313,26 +364,18 @@ public class FSSObsUtils {
* Fahrenheit.
*
* @param dewpoint
* in F
* in Farenheit
* @param temperature
* in F
* in Farenheit
* @return -- calculated Relative Humidity in %
*/
public static Float getRH(float dewpoint, float temperature) {
float retVal = MISSING;
// From http://www.hpc.ncep.noaa.gov/html/dewrh.shtml
// to Celsius
if (dewpoint != MISSING && temperature != MISSING) {
float temp = (100f / (212f - 32f)) * (temperature - 32f);
float dwpt = (100f / (212f - 32f)) * (dewpoint - 32f);
// saturation vapor pressure
float c = (float) (6.11 * Math.pow(10,
((7.5 * temp / (237.7 + temp)))));
// actual vapor pressure
float d = (float) (6.11 * Math.pow(10,
((7.5 * dwpt / (237.7 + dwpt)))));
// relative humidity
retVal = (d / c) * 100;
float retVal = ObConst.MISSING;
if (dewpoint != ObConst.MISSING && temperature != ObConst.MISSING) {
// convert to Celsius:
float temp = (float) fToC.convert(temperature);
float dwpt = (float) fToC.convert(dewpoint);
retVal = CalcRH.calcrh(temp, dwpt);
}
return retVal;
}
@ -351,7 +394,7 @@ public class FSSObsUtils {
// is set at 40F and wind speed between 14 and 43 knts) :
float[] retVal = new float[5];
for (int i = 0; i < 5; i++) {
retVal[i] = MISSING;
retVal[i] = ObConst.MISSING;
}
float temp = tableRow.getTemperature();
float windspd = tableRow.getWindSpeed();
@ -381,36 +424,13 @@ public class FSSObsUtils {
}
}
sc.close();
if ((temp != MISSING) && (temp < 4.4f)
// 277.6 K = 40 F = 4.44444 C
&& (windspd != MISSING)
&& (windspd <= 43.0f && windspd >= 14.0f)) {
float speedKPH = windspd * 1.6f;
if (temp != ObConst.MISSING && windspd != ObConst.MISSING) {
float speedKPH = (float) knotToKph.convert(windspd);
// in Kelvin
retVal[3] = calcWindChill(temp, speedKPH) + TMCK;
retVal[3] = (float) cToK.convert(calcWindChill(
(float) fToC.convert(temp), speedKPH));
// in minutes
retVal[4] = calcFrostbiteTime(speedKPH, temp);
}
return retVal;
}
/**
* Routine to calculate dewpoint depression from temperature and relative
* humidity.
*
* @param TK
* - temperature in K
* @param RH
* - relative humidity in %
* @return dewpoint depression in C
*/
public static float getDpDepression(float TK, float RH) {
float retVal = MISSING;
if (RH != MISSING && TK != MISSING) {
float rhqc = Math.min(100.0f, Math.max(1.0f, RH));
float b = (float) (0.0091379024f * TK + 6106.396f / TK - Math
.log(rhqc / 100.0f));
retVal = (float) (TK - (b - Math.sqrt((b * b - 223.1986)) / 0.0182758048f));
retVal[4] = calcFrostbiteTime(speedKPH, (float) fToC.convert(temp));
}
return retVal;
}

View file

@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory;
import com.raytheon.edex.urifilter.URIGenerateMessage;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
@ -44,6 +45,7 @@ import com.raytheon.uf.edex.plugin.fssobs.FSSObsUtils;
* Nov 19, 2010 skorolev Initial creation
* Aug 30, 2013 2298 rjpeter Make getPluginName abstract
* Sep 04, 2014 3220 skorolev Removed cwa and monitorUse from data set.
* Sep 18, 2015 3873 skorolev Removed identical constant definitions.
*
* </pre>
*
@ -106,19 +108,19 @@ public class FSSObsConfig {
e);
}
}
if (tableRow.getRelativeHumidity() == FSSObsUtils.MISSING) {
if (tableRow.getRelativeHumidity() == ObConst.MISSING) {
Float RH = FSSObsUtils.getRH(tableRow.getDewpoint(),
tableRow.getTemperature());
tableRow.setRelativeHumidity(RH);
}
float[] snowData = FSSObsUtils.getSnowData(tableRow);
if ((tableRow.getTemperature() != FSSObsUtils.MISSING)
&& (tableRow.getDewpoint() != FSSObsUtils.MISSING)) {
if ((tableRow.getTemperature() != ObConst.MISSING)
&& (tableRow.getDewpoint() != ObConst.MISSING)) {
// TODO to check if this is correct. calcdpd() in Meteolib
tableRow.setDewpointDepr(tableRow.getTemperature()
- tableRow.getDewpoint());
} else {
tableRow.setDewpointDepr(FSSObsUtils.MISSING);
tableRow.setDewpointDepr(ObConst.MISSING);
}
tableRow.setSnincrHourly(snowData[0]);
tableRow.setSnincrTotal(snowData[1]);

View file

@ -43,6 +43,8 @@
#20150820 DR 17915 mporricelli Add pattern for GFS229 (1 deg GFS)
#20150827 4687 skorolev Add pattern for ECMWF station-based MOS text bulletins
#20150930 4930 rferrel Corrected patterns for intlsigmets.
#20151008 4958 dgilling Add pattern for NationalBlend
#***************************************************************
# AWIPS 1 PATTERN GRAPHIC ^[PQ].* /redbook/Raw
# PGNA00 KWNS 010001 !redbook 1_1/NMCGPHMCD/MCDSUM/PXSF001CN/20110201 0001
@ -849,6 +851,10 @@ ANY ^(NWUS64) KWNS (..)(..)(..)
EXP (.*wcl_decrypted.*)
FILE -overwrite -log -close -edex \1
# DR 4958: NationalBlend model
NGRID ^(L[ABCDEFGHRTW]AZ9[0-9]) (KWEA) (..)(..)(..)[^!]*!(grib|grib2)/[^/]*/([^/]*)/#([^/]*)/([0-9]{8})([0-9]{4})(F[0-9]{3})/([^/]*)
FILE -overwrite -log -close -edex /data_store/\6/(\3:yyyy)(\3:mm)\3/\4/\7/GRID\8/\(10)Z_\(11)_\(12)-\1_\2_\3\4\5_(seq).\6.%Y%m%d%H
# === Encrypted ECMWF station-based MOS text bulletins
# FOUS39 KWNO 050000 /pMETWC1
# FEAK48 KWNO 041200 /pMEXAFC