Omaha #3220 - Replaced MonitoringArea class with individual area configuration managers.

Former-commit-id: 00fd20d76a4ea46e9806bad11b1bc5a2acc42d6e
This commit is contained in:
Slav Korolev 2015-01-09 12:10:37 -05:00
parent 06054344dd
commit b8ab18d3e1
15 changed files with 924 additions and 812 deletions

View file

@ -29,9 +29,6 @@ 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;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@ -40,20 +37,17 @@ import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
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.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.VizApp;
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;
import com.raytheon.uf.viz.monitor.data.AreaContainer;
import com.raytheon.uf.viz.monitor.data.MonitoringArea;
import com.raytheon.uf.viz.monitor.data.ObMultiHrsReports;
import com.raytheon.uf.viz.monitor.data.ObReport;
import com.raytheon.uf.viz.monitor.data.ObsData;
@ -65,7 +59,6 @@ import com.raytheon.uf.viz.monitor.fog.threshold.FogThresholdMgr;
import com.raytheon.uf.viz.monitor.fog.ui.dialogs.FogMonitoringAreaConfigDlg;
import com.raytheon.uf.viz.monitor.fog.ui.dialogs.FogZoneTableDlg;
import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
import com.raytheon.uf.viz.monitor.util.MonitorThresholdConfiguration;
import com.raytheon.viz.alerts.observers.ProductAlertObserver;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.vividsolutions.jts.geom.Geometry;
@ -93,6 +86,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Sep 23, 2014 3356 njensen Remove unnecessary import
* Oct 16, 2014 3220 skorolev Corrected fogConfig assignment.
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with fogConfig.
*
*
* </pre>
@ -165,12 +159,10 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
private FogMonitor() {
pluginPatterns.add(fogPattern);
fogConfig = FSSObsMonitorConfigurationManager.getFogObsManager();
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
obData.setThresholdMgr(FogThresholdMgr.getInstance());
obData.getZoneTableData();
readTableConfig(MonitorThresholdConfiguration.FOG_THRESHOLD_CONFIG);
}
/**
@ -184,7 +176,8 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
// Pre-populate dialog with an observations from DB
monitor.createDataStructures();
monitor.getAdjAreas();
monitor.processProductAtStartup(MonName.fog.name());
List<String> zones = monitor.fogConfig.getAreaList();
monitor.processProductAtStartup(zones);
monitor.fireMonitorEvent(monitor);
}
@ -215,8 +208,8 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
obsData = new ObsData();
algorithmData = new TreeMap<Date, Map<String, FOG_THREAT>>();
for (String zone : MonitoringArea.getPlatformMap().keySet()) {
obsData.addArea(zone, MonitoringArea.getPlatformMap().get(zone));
for (String zone : fogConfig.getAreaList()) {
obsData.addArea(zone, fogConfig.getAreaStations(zone));
}
}
@ -254,38 +247,11 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
@Override
public void processProductMessage(final AlertMessage filtered) {
if (fogPattern.matcher(filtered.dataURI).matches()) {
processURI(filtered.dataURI, filtered);
List<String> zones = fogConfig.getAreaList();
processURI(filtered.dataURI, filtered, zones);
}
}
/**
* Method that reads the table configuration and updates the zone monitor
* threshold map
*
* @param file
* -- 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 {
for (String zone : fogConfig.getAreaList()) {
// add the unique
List<String> stations = fogConfig.getAreaStations(zone);
zones.put(zone, stations);
}
} catch (Exception ve) {
String msg = "FOG Monitor failed to load configuration..."
+ this.getClass().getName();
ErrorDialog.openError(Display.getCurrent().getActiveShell(),
"FOG Monitor failed to load configuration", msg,
new Status(IStatus.ERROR, Activator.PLUGIN_ID, msg, ve));
}
MonitoringArea.setPlatformMap(zones);
}
/*
* (non-Javadoc)
*
@ -319,17 +285,9 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
@Override
public void configUpdate(IMonitorConfigurationEvent me) {
fogConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea();
if (zoneDialog != null && !zoneDialog.isDisposed()) {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
});
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
}
@ -343,21 +301,6 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
monitor = null;
}
/**
* Finds the zone based on the icao passed into it
*
* @param icao
* @return zone
*/
public String findZone(String icao) {
for (String zone : MonitoringArea.getPlatformMap().keySet()) {
if (MonitoringArea.getPlatformMap().get(zone).contains(icao)) {
return zone;
}
}
return null;
}
/**
* Gets the main map
*
@ -377,12 +320,16 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
@Override
protected void process(ObReport result) throws Exception {
obData.addReport(result);
String zone = findZone(result.getPlatformId());
if (zone != null) {
AreaContainer ac = getTableData().getArea(zone);
if (ac != null) {
ac.addReport(result.getObservationTime(), result);
fireMonitorEvent(this);
// Get zones containing station
List<String> zones = fogConfig.getAreaByStationId(result
.getPlatformId());
if (!zones.isEmpty() || zones != null) {
for (String zn : zones) {
AreaContainer ac = getTableData().getArea(zn);
if (ac != null) {
ac.addReport(result.getObservationTime(), result);
fireMonitorEvent(this);
}
}
}
}
@ -455,7 +402,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
algData = algorithmData.get(time);
} else {
// by default is nothing in the ALG column
for (String zone : MonitoringArea.getPlatformMap().keySet()) {
for (String zone : fogConfig.getAreaList()) {
algData.put(zone, FOG_THREAT.GRAY);
}
}
@ -632,9 +579,14 @@ 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);
List<String> zones = fogConfig.getAreaByStationId(report
.getPlatformId());
if (!zones.isEmpty() || zones != null) {
for (String zn : zones) {
getTableData().getArea(zn).addReport(
report.getObservationTime(), report);
}
}
}
/**
@ -647,19 +599,11 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
}
/**
* Reads Table Configuration.
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
* Gets Fog Area configuration dialog
*
* @return
*/
private void updateMonitoringArea() {
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and station list
for (String zone : fogConfig.getAreaList()) {
List<String> stations = fogConfig.getAreaStations(zone);
zones.put(zone, stations);
}
MonitoringArea.setPlatformMap(zones);
public MonitoringAreaConfigDlg getAreaDialog() {
return areaDialog;
}
}

View file

@ -25,8 +25,8 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.viz.monitor.fog.FogMonitor;
import com.raytheon.uf.viz.monitor.fog.ui.dialogs.FogMonitoringAreaConfigDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
/**
* The Fog Monitor Action
@ -42,6 +42,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose.
* Jan 08, 2015 3220 skorolev Used area type for launchDialog.
*
* </pre>
*
@ -65,19 +66,13 @@ public class FogAreaConfigAction extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (areaDialog == null || areaDialog.isDisposed()) {
FogMonitor fog = FogMonitor.getInstance();
if (fog.getAreaDialog() == null || fog.getAreaDialog().isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
areaDialog = new FogMonitoringAreaConfigDlg(shell,
"Fog Monitor Area Configuration");
areaDialog.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
areaDialog = null;
}
});
fog.launchDialog("area", shell);
}
areaDialog.open();
return null;
}
}

View file

@ -42,14 +42,12 @@ 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.VizApp;
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;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.CellType;
import com.raytheon.uf.viz.monitor.data.MonitoringArea;
import com.raytheon.uf.viz.monitor.data.ObMultiHrsReports;
import com.raytheon.uf.viz.monitor.data.ObReport;
import com.raytheon.uf.viz.monitor.data.TableCellData;
@ -61,8 +59,6 @@ import com.raytheon.uf.viz.monitor.safeseas.listeners.ISSResourceListener;
import com.raytheon.uf.viz.monitor.safeseas.threshold.SSThresholdMgr;
import com.raytheon.uf.viz.monitor.safeseas.ui.dialogs.SSMonitoringAreaConfigDlg;
import com.raytheon.uf.viz.monitor.safeseas.ui.dialogs.SSZoneTableDlg;
import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
import com.raytheon.uf.viz.monitor.util.MonitorThresholdConfiguration;
import com.raytheon.viz.alerts.observers.ProductAlertObserver;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.vividsolutions.jts.geom.Geometry;
@ -89,6 +85,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Oct 16, 2014 3220 skorolev Corrected ssAreaConfig assignment.
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with ssAreaConfig.
*
* </pre>
*
@ -164,13 +161,10 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
private SafeSeasMonitor() {
pluginPatterns.add(ssPattern);
ssAreaConfig = FSSObsMonitorConfigurationManager.getSsObsManager();
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS);
obData.setThresholdMgr(SSThresholdMgr.getInstance());
obData.getZoneTableData();
readTableConfig(MonitorThresholdConfiguration.SAFESEAS_THRESHOLD_CONFIG);
}
/**
@ -182,7 +176,8 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
// Pre-populate dialog with an observation (METAR) for KOMA
monitor.createDataStructures();
monitor.getAdjAreas();
monitor.processProductAtStartup("ss");
List<String> zones = monitor.ssAreaConfig.getAreaList();
monitor.processProductAtStartup(zones);
monitor.fireMonitorEvent(monitor);
}
return monitor;
@ -228,7 +223,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
} else if (type.equals("area")) {
if (areaDialog == null) {
areaDialog = new SSMonitoringAreaConfigDlg(shell,
"Safe Seas Monitor Area Configuration");
"SAFESEAS Monitor Area Configuration");
areaDialog.setCloseCallback(new ICloseCallback() {
@Override
@ -276,7 +271,8 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
@Override
public void processProductMessage(final AlertMessage filtered) {
if (ssPattern.matcher(filtered.dataURI).matches()) {
processURI(filtered.dataURI, filtered);
final List<String> zones = ssAreaConfig.getAreaList();
processURI(filtered.dataURI, filtered, zones);
}
}
@ -299,31 +295,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
stationTableData.addReplaceDataRow(stationRowData);
}
/**
* Reads Table Configuration.
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
*
* @param file
* -- the xml configuration filename
*/
public void readTableConfig(String file) {
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and station list
try {
for (String zone : ssAreaConfig.getAreaList()) {
List<String> stations = ssAreaConfig.getAreaStations(zone);
zones.put(zone, stations);
}
} catch (Exception e) {
statusHandler.handle(Priority.CRITICAL,
"SafeSeas failed to load configuration..."
+ this.getClass().getName(), e);
}
MonitoringArea.setPlatformMap(zones);
}
/*
* (non-Javadoc)
*
@ -357,18 +328,8 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
@Override
public void configUpdate(IMonitorConfigurationEvent me) {
ssAreaConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea();
if (zoneDialog != null && !zoneDialog.isDisposed()) {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
});
}
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
/**
@ -553,7 +514,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
algData = algorithmData.get(time);
} else {
// by default is nothing in the Fog column
for (String zone : MonitoringArea.getPlatformMap().keySet()) {
for (String zone : ssAreaConfig.getAreaList()) {
algData.put(zone, FOG_THREAT.GRAY);
}
}
@ -594,15 +555,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
return type;
}
/**
* Gets zone dialog
*
* @return zoneDialog
*/
public ZoneTableDlg getDialog() {
return zoneDialog;
}
/**
* Gets adjacent areas
*/
@ -679,19 +631,11 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
}
/**
* Reads Table Configuration.
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
* Gets SAFESEAS Area configuration dialog
*
* @return
*/
public void updateMonitoringArea() {
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and station list
for (String zone : ssAreaConfig.getAreaList()) {
List<String> stations = ssAreaConfig.getAreaStations(zone);
zones.put(zone, stations);
}
MonitoringArea.setPlatformMap(zones);
public SSMonitoringAreaConfigDlg getAreaDialog() {
return areaDialog;
}
}

View file

@ -25,8 +25,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.viz.monitor.safeseas.ui.dialogs.SSMonitoringAreaConfigDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.uf.viz.monitor.safeseas.SafeSeasMonitor;
/**
* The SAFESEAS Action
@ -42,6 +41,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose.
* Jan 08, 2015 3220 skorolev Used area type for launchDialog.
*
* </pre>
*
@ -51,11 +51,6 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
public class SafeseasAreaConfigAction extends AbstractHandler {
/**
* SAFESEAS Monitoring Area Configuration Dialog.
*/
private SSMonitoringAreaConfigDlg configDlg;
/*
* (non-Javadoc)
*
@ -65,19 +60,14 @@ public class SafeseasAreaConfigAction extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (configDlg == null || configDlg.isDisposed()) {
SafeSeasMonitor monitor = SafeSeasMonitor.getInstance();
if (monitor.getAreaDialog() == null
|| monitor.getAreaDialog().isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
configDlg = new SSMonitoringAreaConfigDlg(shell,
"SAFESEAS Monitor Area Configuration");
configDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
configDlg = null;
}
});
monitor.launchDialog("area", shell);
}
configDlg.open();
return null;
}
}

View file

@ -22,9 +22,7 @@ package com.raytheon.uf.viz.monitor.snow;
import java.util.ArrayList;
import java.util.Comparator;
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;
@ -34,13 +32,11 @@ import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
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.VizApp;
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;
import com.raytheon.uf.viz.monitor.data.MonitoringArea;
import com.raytheon.uf.viz.monitor.data.ObMultiHrsReports;
import com.raytheon.uf.viz.monitor.data.ObReport;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
@ -76,6 +72,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Oct 16, 2014 3220 skorolev Corrected snowConfig assignment.
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with snowAreaConfig.
*
* </pre>
*
@ -99,7 +96,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
private SnowMonitoringAreaConfigDlg areaDialog = null;
/** SNOW configuration manager **/
private FSSObsMonitorConfigurationManager snowConfig = null;
private FSSObsMonitorConfigurationManager snowAreaConfig = null;
/**
* This object contains all observation data necessary for the table dialogs
@ -130,8 +127,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
*/
private SnowMonitor() {
pluginPatterns.add(snowPattern);
snowConfig = FSSObsMonitorConfigurationManager.getSnowObsManager();
updateMonitoringArea();
snowAreaConfig = FSSObsMonitorConfigurationManager.getSnowObsManager();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW);
obData.setThresholdMgr(SnowThresholdMgr.getInstance());
@ -146,7 +142,8 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
public static synchronized SnowMonitor getInstance() {
if (monitor == null) {
monitor = new SnowMonitor();
monitor.processProductAtStartup("snow");
List<String> zones = monitor.snowAreaConfig.getAreaList();
monitor.processProductAtStartup(zones);
monitor.fireMonitorEvent(monitor);
}
return monitor;
@ -239,7 +236,8 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
@Override
public void processProductMessage(final AlertMessage filtered) {
if (snowPattern.matcher(filtered.dataURI).matches()) {
processURI(filtered.dataURI, filtered);
List<String> zones = snowAreaConfig.getAreaList();
processURI(filtered.dataURI, filtered, zones);
}
}
@ -256,23 +254,6 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
}
}
/**
* Reads Table Configuration.
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
*
*/
public void updateMonitoringArea() {
Map<String, List<String>> zones = new HashMap<String, List<String>>();
// create zones and station list
for (String zone : snowConfig.getAreaList()) {
List<String> stations = snowConfig.getAreaStations(zone);
zones.put(zone, stations);
}
MonitoringArea.setPlatformMap(zones);
}
/*
* (non-Javadoc)
*
@ -305,18 +286,10 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
*/
@Override
public void configUpdate(IMonitorConfigurationEvent me) {
snowConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea();
snowAreaConfig = (FSSObsMonitorConfigurationManager) me.getSource();
if (zoneDialog != null && !zoneDialog.isDisposed()) {
VizApp.runAsync(new Runnable() {
@Override
public void run() {
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
});
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
}
@ -427,7 +400,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
}
/**
* Gets Zone Dialog.
* Gets SNOW Zone Dialog.
*
* @return zoneDialog
*/
@ -435,6 +408,15 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
return zoneDialog;
}
/**
* Gets SNOW Area configuration dialog
*
* @return
*/
public SnowMonitoringAreaConfigDlg getAreaDialog() {
return areaDialog;
}
/**
* Sets the zoneDialog
*

View file

@ -25,8 +25,7 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import com.raytheon.uf.viz.monitor.snow.ui.dialogs.SnowMonitoringAreaConfigDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.raytheon.uf.viz.monitor.snow.SnowMonitor;
/**
* The Snow Area Action
@ -51,11 +50,6 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
public class SnowAreaConfigAction extends AbstractHandler {
/**
* SNOW Monitoring Area Configuration Dialog.
*/
private SnowMonitoringAreaConfigDlg configDlg;
/*
* (non-Javadoc)
*
@ -65,19 +59,12 @@ public class SnowAreaConfigAction extends AbstractHandler {
*/
@Override
public Object execute(ExecutionEvent arg0) throws ExecutionException {
if (configDlg == null || configDlg.isDisposed()) {
SnowMonitor snow = SnowMonitor.getInstance();
if (snow.getAreaDialog() == null || snow.getAreaDialog().isDisposed()) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell();
configDlg = new SnowMonitoringAreaConfigDlg(shell,
"SNOW Monitor Area Configuration");
configDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
configDlg = null;
}
});
snow.launchDialog("area", shell);
}
configDlg.open();
return null;
}
}

View file

@ -22,11 +22,10 @@ package com.raytheon.uf.viz.monitor;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.DataURIUtil;
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
@ -43,7 +42,6 @@ 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;
@ -62,6 +60,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.
* Jan 08, 2015 3220 skorolev Added zones parameter to processURI.
*
* </pre>
*
@ -187,45 +186,29 @@ public abstract class ObsMonitor extends Monitor {
*
* @param dataURI
* @param filtered
* @param zones
*/
public void processURI(String dataURI, AlertMessage filtered) {
public void processURI(String dataURI, AlertMessage filtered,
final List<String> zones) {
try {
Map<String, RequestConstraint> constraints = RequestConstraint
.toConstraintMapping(DataURIUtil.createDataURIMap(dataURI));
FSSObsRecord[] pdos = requestFSSObs(constraints, null);
if (pdos.length > 0 && pdos[0].getTimeObs() != null) {
final FSSObsRecord objectToSend = pdos[0];
try {
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);
}
} catch (Exception e) {
statusHandler
.handle(Priority.PROBLEM,
"An error has occured processing the incoming messages.",
e);
}
}
});
} catch (Exception e) {
statusHandler
.handle(Priority.PROBLEM,
"An error has occured processing incoming dataURIs.",
e);
if (!zones.isEmpty()) {
ObReport result = GenerateFSSObReport
.generateObReport(objectToSend);
statusHandler.handle(Priority.INFO, "New FSSrecord ===> "
+ objectToSend.getDataURI());
try {
process(result);
} catch (Exception e) {
statusHandler
.handle(Priority.PROBLEM,
"An error has occured processing the incoming messages.",
e);
}
}
}
} catch (final Exception e) {
@ -237,10 +220,10 @@ public abstract class ObsMonitor extends Monitor {
/**
* Process products at startup
*
* @param monitorName
* @param zones
*
*/
public void processProductAtStartup(String monitorName) {
public void processProductAtStartup(List<String> zones) {
/**
* Assume this number for MaxNumObsTimes is larger enough to cover data
@ -275,8 +258,6 @@ 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);
@ -286,7 +267,7 @@ public abstract class ObsMonitor extends Monitor {
}
} catch (DataCubeException e) {
statusHandler.handle(Priority.PROBLEM,
"No data in database at startup. " + monitorName);
"No data in database at startup.");
}
}

View file

@ -20,8 +20,10 @@
package com.raytheon.uf.viz.monitor.data;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.monitor.data.ObConst.ChosenAppKey;
import com.raytheon.uf.common.monitor.data.ObConst.ThreatLevel;
@ -40,6 +42,7 @@ import com.raytheon.uf.common.monitor.data.ObConst.VarName;
* Feb 17, 2009 1999 grichard Initial creation.
* 3/16/2009 2047 grichard Add threat monitoring routines.
* Dec 24, 2009 3424 zhao added getDualValuedThresholdMap and getSingleValuedThresholdMap
* Jan 12, 2015 3220 skorolev Replaced MonitoringArea with areaConfig.
*
* </pre>
*
@ -62,56 +65,6 @@ public final class MonitorAreaThresholds {
// Map containing the display thresholds
private static Map<String, DisplayThresholdsSet> zoneDisplayThresholds = new HashMap<String, DisplayThresholdsSet>();
/**
* This method receives an observation report and a variable name, and
* returns the threat level of that single variable.
*
* @param report
* -- the observation report
* @param varName
* -- the variable name within the report
* @return -- the threat level
*/
public static ObConst.ThreatLevel getThreatLevel(ObReport report,
VarName varName) {
ThreatLevel threatLevel = ThreatLevel.GRAY;
ThreatLevel temp = ThreatLevel.GRAY;
float varValue = ObConst.MISSING;
try {
varValue = getReportVarValue(report, varName);
String zoneId = report.getZoneId();
// TEMPORARILY USE DEFAULT ZONE ID, NAMELY, DEFAULT STATION.
zoneId = ObConst.DEFAULT_STATION_NAME;
if (report.isStationary()) {
if (MonitoringArea.listZonesToPlatform(report.getPlatformId())
.isEmpty()) {
// use the default zone if there are no zones
temp = getZoneThreatLevel(zoneId, varName, varValue);
if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp;
}
} else {
for (String z : MonitoringArea.listZonesToPlatform(report
.getPlatformId())) {
temp = getZoneThreatLevel(z, varName, varValue);
if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp;
}
}
}
} else {
temp = getZoneThreatLevel(zoneId, varName, varValue);
}
} catch (Exception e) {
// return the default threat level
}
return threatLevel;
}
/**
* This method receives an observation report and a variable name, and
* returns the threat level of that single variable.
@ -127,12 +80,13 @@ public final class MonitorAreaThresholds {
ThreatLevel threatLevel = ThreatLevel.GRAY;
ThreatLevel temp = ThreatLevel.GRAY;
String station = report.getPlatformId();
try {
if (report.isStationary()) {
if (chosenAppKey == ChosenAppKey.SAFESEAS) {
if (MonitoringArea.listZonesToPlatform(
report.getPlatformId()).isEmpty()) {
List<String> ssZones = FSSObsMonitorConfigurationManager
.getSsObsManager().getAreaByStationId(station);
if (ssZones.isEmpty()) {
// use the default zone if there are no zones
for (VarName v : VarName.values()) {
if (v == VarName.TEMPERATURE
@ -150,8 +104,7 @@ public final class MonitorAreaThresholds {
}
}
} else {
for (String z : MonitoringArea
.listZonesToPlatform(report.getPlatformId())) {
for (String z : ssZones) {
for (VarName v : VarName.values()) {
if (v == VarName.TEMPERATURE
|| v == VarName.WIND_CHILL
@ -169,8 +122,9 @@ public final class MonitorAreaThresholds {
}
}
} else if (chosenAppKey == ChosenAppKey.SNOW) {
if (MonitoringArea.listZonesToPlatform(
report.getPlatformId()).isEmpty()) {
List<String> snowZones = FSSObsMonitorConfigurationManager
.getSnowObsManager().getAreaByStationId(station);
if (snowZones.isEmpty()) {
// use the default zone if there are no zones
for (VarName v : VarName.values()) {
if (v == VarName.PRIM_SWELL_HT) {
@ -185,8 +139,7 @@ public final class MonitorAreaThresholds {
}
} else {
for (String z : MonitoringArea
.listZonesToPlatform(report.getPlatformId())) {
for (String z : snowZones) {
for (VarName v : VarName.values()) {
if (v == VarName.PRIM_SWELL_HT) {
break;
@ -199,9 +152,10 @@ public final class MonitorAreaThresholds {
}
}
}
} else {
if (MonitoringArea.listZonesToPlatform(
report.getPlatformId()).isEmpty()) {
} else {// chosenAppKey = FOG
List<String> fogZones = FSSObsMonitorConfigurationManager
.getFogObsManager().getAreaByStationId(station);
if (fogZones.isEmpty()) {
// use the default zone if there are no zones
temp = getZoneThreatLevel(ObConst.DEFAULT_STATION_NAME,
VarName.PRES_WX, report.getPresentWx());
@ -209,20 +163,21 @@ public final class MonitorAreaThresholds {
threatLevel = temp;
}
temp = getZoneThreatLevel(ObConst.DEFAULT_STATION_NAME,
VarName.VISIBILITY, getReportVarValue(report,
VarName.VISIBILITY));
VarName.VISIBILITY,
getReportVarValue(report, VarName.VISIBILITY));
if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp;
}
} else {
for (String z : MonitoringArea
.listZonesToPlatform(report.getPlatformId())) {
for (String z : fogZones) {
temp = getZoneThreatLevel(z, VarName.PRES_WX,
report.getPresentWx());
if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp;
}
temp = getZoneThreatLevel(z, VarName.VISIBILITY,
temp = getZoneThreatLevel(
z,
VarName.VISIBILITY,
getReportVarValue(report,
VarName.VISIBILITY));
if (temp.ordinal() < threatLevel.ordinal()) {
@ -231,6 +186,7 @@ public final class MonitorAreaThresholds {
}
}
}
// report is not Stationary
} else {
if (chosenAppKey == ChosenAppKey.SAFESEAS) {
String zoneId = report.getZoneId();
@ -243,8 +199,8 @@ public final class MonitorAreaThresholds {
} else if (v == VarName.STATIONARY) {
break;
}
temp = getZoneThreatLevel(zoneId, v, getReportVarValue(
report, v));
temp = getZoneThreatLevel(zoneId, v,
getReportVarValue(report, v));
if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp;
}
@ -257,13 +213,13 @@ public final class MonitorAreaThresholds {
if (v == VarName.PRIM_SWELL_HT) {
break;
}
temp = getZoneThreatLevel(zoneId, v, getReportVarValue(
report, v));
temp = getZoneThreatLevel(zoneId, v,
getReportVarValue(report, v));
if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp;
}
}
} else {
} else {// chosenAppKey = FOG
String zoneId = report.getZoneId();
// TEMPORARILY USE DEFAULT ZONE ID, NAMELY, DEFAULT STATION.
zoneId = ObConst.DEFAULT_STATION_NAME;
@ -608,29 +564,41 @@ public final class MonitorAreaThresholds {
/**
* [Dec 24, 2009, zhao]
* @param zone the zone ID
* @param varName enumerated-type variable name
* @return single-valued threshold map, or null if the variable
* name is invalid or if the map contains no mapping for the key
*
* @param zone
* the zone ID
* @param varName
* enumerated-type variable name
* @return single-valued threshold map, or null if the variable name is
* invalid or if the map contains no mapping for the key
*/
public static Map<ObConst.ThreatLevel,Float> getSingleValuedThresholdMap(String zone, ObConst.VarName varName) {
if (varName == VarName.WIND_DIR || varName == VarName.PRIM_SWELL_DIR || varName == VarName.SEC_SWELL_DIR ) {
return null;
}
return zoneMonitorThresholds.get(zone).getSingleValuedThresholdMap(varName);
public static Map<ObConst.ThreatLevel, Float> getSingleValuedThresholdMap(
String zone, ObConst.VarName varName) {
if (varName == VarName.WIND_DIR || varName == VarName.PRIM_SWELL_DIR
|| varName == VarName.SEC_SWELL_DIR) {
return null;
}
return zoneMonitorThresholds.get(zone).getSingleValuedThresholdMap(
varName);
}
/**
* [Dec 24, 2009, zhao]
* @param zone the zone ID
* @param varName enumerated-type variable name
* @return duel-valued threshold map, or null if the variable
* name is invalid or if the map contains no mapping for the key
*
* @param zone
* the zone ID
* @param varName
* enumerated-type variable name
* @return duel-valued threshold map, or null if the variable name is
* invalid or if the map contains no mapping for the key
*/
public static Map<ObConst.ThreatLevel,Float[]> getDualValuedThresholdMap(String zone, ObConst.VarName varName) {
if (varName != VarName.WIND_DIR || varName != VarName.PRIM_SWELL_DIR || varName != VarName.SEC_SWELL_DIR ) {
return null;
}
return zoneMonitorThresholds.get(zone).getDualValuedThresholdMap(varName);
public static Map<ObConst.ThreatLevel, Float[]> getDualValuedThresholdMap(
String zone, ObConst.VarName varName) {
if (varName != VarName.WIND_DIR || varName != VarName.PRIM_SWELL_DIR
|| varName != VarName.SEC_SWELL_DIR) {
return null;
}
return zoneMonitorThresholds.get(zone).getDualValuedThresholdMap(
varName);
}
}

View file

@ -23,7 +23,6 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
@ -40,13 +39,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.
* Dec 18 2014 3841 skorolev Corrected updateZones method.
* Oct.31, 2012 1297 skorolev Cleaned code.
* Sep 04, 2014 3220 skorolev Added updateZones method.
* Dec 18, 2014 3841 skorolev Corrected updateZones method.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with areaConfig.
*
* </pre>
*
@ -73,6 +73,9 @@ public class ObHourReports {
*/
private Map<String, ObZoneHourReports> hourReports;
/**
* current threshold manager
*/
private AbstractThresholdMgr thresholdMgr;
/**
@ -86,9 +89,8 @@ public class ObHourReports {
this.appName = appName;
this.thresholdMgr = thresholdMgr;
hourReports = new HashMap<String, ObZoneHourReports>();
Map<String, List<String>> zoneStationMap = MonitoringArea
.getPlatformMap();
for (String zone : zoneStationMap.keySet()) {
List<String> zones = thresholdMgr.getAreaConfigMgr().getAreaList();
for (String zone : zones) {
hourReports.put(zone, new ObZoneHourReports(nominalTime, zone,
appName, thresholdMgr));
}
@ -101,7 +103,8 @@ public class ObHourReports {
*/
public void addReport(ObReport report) {
String station = report.getPlatformId();
List<String> zones = MonitoringArea.getZoneIds(station);
List<String> zones = thresholdMgr.getAreaConfigMgr()
.getAreaByStationId(station);
if (zones.size() == 0) {
statusHandler
.error("Error: station: "
@ -123,6 +126,8 @@ public class ObHourReports {
}
/**
* Gets HourReports
*
* @return hourReports
*/
public Map<String, ObZoneHourReports> getHourReports() {
@ -186,8 +191,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 +205,8 @@ public class ObHourReports {
}
/**
* Gets NominalTime
*
* @return nominalTime
*/
public Date getNominalTime() {
@ -207,6 +214,8 @@ public class ObHourReports {
}
/**
* Gets AppName
*
* @return appName
*/
public CommonConfig.AppName getAppName() {
@ -217,10 +226,10 @@ public class ObHourReports {
* Updates zones in the Hour Reports
*/
public void updateZones() {
Map<String, List<String>> zoneStationMap = MonitoringArea
.getPlatformMap();
// Updated list of zones
Set<String> updtZones = zoneStationMap.keySet();
List<String> updtZones = thresholdMgr.getAreaConfigMgr().getAreaList();
// remove zones
hourReports.keySet().retainAll(updtZones);
// add zones
for (String zone : updtZones) {
if (!hourReports.keySet().contains(zone)) {
@ -228,12 +237,14 @@ public class ObHourReports {
appName, thresholdMgr));
}
}
// remove zones
hourReports.keySet().retainAll(updtZones);
// add and(or) remove stations
for (String zone : updtZones) {
// Updated list of stations in this zone
List<String> updtStns = zoneStationMap.get(zone);
List<String> updtStns = thresholdMgr.getAreaConfigMgr()
.getAreaStations(zone);
// remove stations
hourReports.get(zone).getZoneHourReports().keySet()
.retainAll(updtStns);
// add stations
for (String stn : updtStns) {
if (!hourReports.get(zone).getZoneHourReports()
@ -246,9 +257,8 @@ public class ObHourReports {
stn, appName, thresholdMgr));
}
}
// remove stations
hourReports.get(zone).getZoneHourReports().keySet()
.retainAll(updtStns);
// update hourReports for current zone
hourReports.get(zone).getZoneHourReports();
}
}
}

View file

@ -24,11 +24,13 @@ 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 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;
@ -53,6 +55,7 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
* 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.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with cfgMgr.
*
* </pre>
*
@ -151,9 +154,11 @@ 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()));
}
}
@ -173,28 +178,28 @@ public class ObMultiHrsReports {
}
}
/**
* 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").
@ -252,6 +257,9 @@ public class ObMultiHrsReports {
/**
* 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 +272,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 +308,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,
@ -373,12 +386,15 @@ public class ObMultiHrsReports {
}
/**
* Gets Histogram 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) {
@ -467,17 +483,17 @@ public class ObMultiHrsReports {
}
/**
* Returns a SortedMap object <nominal time, ObHourReports object>
* Gets MultiHrsReports
*
* @return multiHrsReports
* @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)
* Gets MultiHrsTableData Returns a SortedMap object (key is nominal time,
* value is zone TableData object)
*
* @return
*/
@ -500,8 +516,8 @@ public class ObMultiHrsReports {
}
/**
* 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,17 +533,17 @@ 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
*/
@ -540,8 +556,9 @@ public class ObMultiHrsReports {
}
/**
* 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 +591,7 @@ public class ObMultiHrsReports {
}
/**
* Gets Threshold Manager
*
* @return the threshold manager
*/
@ -591,6 +609,7 @@ public class ObMultiHrsReports {
}
/**
* Gets map of types for ALG cell
*
* @return fogAlgCellType
*/
@ -603,7 +622,13 @@ public class ObMultiHrsReports {
*/
private void initFogAlgCellType() {
fogAlgCellType = new HashMap<String, CellType>();
Set<String> zones = MonitoringArea.getPlatformMap().keySet();
FSSObsMonitorConfigurationManager cfgMgr = null;
if (appName.equals(CommonConfig.AppName.FOG)) {
cfgMgr = FSSObsMonitorConfigurationManager.getFogObsManager();
} else if (appName.equals(CommonConfig.AppName.SAFESEAS)) {
cfgMgr = FSSObsMonitorConfigurationManager.getSsObsManager();
}
List<String> zones = cfgMgr.getAreaList();
Iterator<String> itr = zones.iterator();
while (itr.hasNext()) {
fogAlgCellType.put(itr.next(), CellType.NotAvailable);

File diff suppressed because it is too large Load diff

View file

@ -53,6 +53,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
* Feb 28, 2013 14410 zhao Modified getCellTypeForBlizWarn
* May 23, 2014 3086 skorolev Corrected ObsHistType. Cleaned code.
* Nov 21, 2014 3841 skorolev Added coordinates in the hover text for a newly added zones.
* Jan 08, 2015 3220 skorolev Corrected code for Fog and SNOW table data.
*
* </pre>
*
@ -113,10 +114,10 @@ public final class TableUtil {
isZone = true;
}
String hoverText = null;
String hoverText = "";
if (isZone) {
AreaIdXML zoneXML = FSSObsMonitorConfigurationManager
.getSsObsManager().getAreaXml(zone);
.getFogObsManager().getAreaXml(zone);
if (zoneXML != null) {
hoverText = getZoneHoverText(zoneXML);
}
@ -344,7 +345,7 @@ public final class TableUtil {
isZone = true;
}
String hoverText = null;
String hoverText = "";
if (isZone) {
AreaIdXML zoneXML = FSSObsMonitorConfigurationManager
.getSsObsManager().getAreaXml(zone);
@ -649,10 +650,10 @@ public final class TableUtil {
isZone = true;
}
String hoverText = null;
String hoverText = "";
if (isZone) {
AreaIdXML zoneXML = FSSObsMonitorConfigurationManager
.getSsObsManager().getAreaXml(zone);
.getSnowObsManager().getAreaXml(zone);
if (zoneXML != null) {
hoverText = getZoneHoverText(zoneXML);
}

View file

@ -57,6 +57,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* Feb 16, 2011 #7346 zhao added getDirectionalThresholdValueCellType(...)
* Apr 28, 2014 3086 skorolev Updated getAreaConfigMgr method.
* Oct 17, 2014 3220 skorolev Replaced System.out.print with debug statusHandler.
* Jan 08, 2015 3220 skorolev Added getAreaConfigMgr.
*
* </pre>
*
@ -71,7 +72,7 @@ public abstract class AbstractThresholdMgr {
/**
* Monitor Area Configuration Manager.
*/
protected FSSObsMonitorConfigurationManager areaConfigMgr;
public FSSObsMonitorConfigurationManager areaConfigMgr;
/**
* Default file name for the FOG display thresholds.
@ -808,4 +809,13 @@ public abstract class AbstractThresholdMgr {
}
}
}
/**
* Gets current Area configuration manager.
*
* @return
*/
public FSSObsMonitorConfigurationManager getAreaConfigMgr() {
return areaConfigMgr;
}
}

View file

@ -528,11 +528,11 @@ public class FSSObsMonitorConfigurationManager implements
}
/**
* Gets an area of a station.
* Gets the zones where station is monitoring
*
* @param stationId
* The station to get the area
* @return List of areas
* The station to get the zones
* @return List of zones
*/
public List<String> getAreaByStationId(String stationId) {
List<String> results = new ArrayList<String>();

View file

@ -132,7 +132,6 @@ public class FogConfig {
// our new coverage boundaries including adjacent areas
Geometry monitorAreaGeo = AdjacentWfoMgr.getAdjacentAreas(getCwa());
// (SK) Geometry monitorAreaGeo =
// FogDbUtils.getMonitoringAreaGeometry(filter.getCwaGeometry(),getCwa());
setCenter(monitorAreaGeo.getCentroid().getCoordinate());
Coordinate[] coords = monitorAreaGeo.getEnvelope().getCoordinates();
this.upperLeftCorner = coords[1];