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.TreeMap;
import java.util.regex.Pattern; 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.Display;
import org.eclipse.swt.widgets.Shell; 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.geospatial.SpatialException;
import com.raytheon.uf.common.monitor.MonitorAreaUtils; import com.raytheon.uf.common.monitor.MonitorAreaUtils;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager; 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.AdjacentWfoMgr;
import com.raytheon.uf.common.monitor.data.CommonConfig; import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; 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.alerts.AlertMessage;
import com.raytheon.uf.viz.core.notification.NotificationMessage; import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.IMonitor; import com.raytheon.uf.viz.monitor.IMonitor;
import com.raytheon.uf.viz.monitor.Monitor; import com.raytheon.uf.viz.monitor.Monitor;
import com.raytheon.uf.viz.monitor.ObsMonitor; import com.raytheon.uf.viz.monitor.ObsMonitor;
import com.raytheon.uf.viz.monitor.data.AreaContainer; 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.ObMultiHrsReports;
import com.raytheon.uf.viz.monitor.data.ObReport; import com.raytheon.uf.viz.monitor.data.ObReport;
import com.raytheon.uf.viz.monitor.data.ObsData; 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.FogMonitoringAreaConfigDlg;
import com.raytheon.uf.viz.monitor.fog.ui.dialogs.FogZoneTableDlg; 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.ui.dialogs.MonitoringAreaConfigDlg;
import com.raytheon.uf.viz.monitor.util.MonitorThresholdConfiguration;
import com.raytheon.viz.alerts.observers.ProductAlertObserver; import com.raytheon.viz.alerts.observers.ProductAlertObserver;
import com.raytheon.viz.ui.dialogs.ICloseCallback; import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.Geometry;
@ -93,6 +86,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Sep 23, 2014 3356 njensen Remove unnecessary import * Sep 23, 2014 3356 njensen Remove unnecessary import
* Oct 16, 2014 3220 skorolev Corrected fogConfig assignment. * Oct 16, 2014 3220 skorolev Corrected fogConfig assignment.
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread. * Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with fogConfig.
* *
* *
* </pre> * </pre>
@ -165,12 +159,10 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
private FogMonitor() { private FogMonitor() {
pluginPatterns.add(fogPattern); pluginPatterns.add(fogPattern);
fogConfig = FSSObsMonitorConfigurationManager.getFogObsManager(); fogConfig = FSSObsMonitorConfigurationManager.getFogObsManager();
updateMonitoringArea();
initObserver(OBS, this); initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG); obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
obData.setThresholdMgr(FogThresholdMgr.getInstance()); obData.setThresholdMgr(FogThresholdMgr.getInstance());
obData.getZoneTableData(); 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 // Pre-populate dialog with an observations from DB
monitor.createDataStructures(); monitor.createDataStructures();
monitor.getAdjAreas(); monitor.getAdjAreas();
monitor.processProductAtStartup(MonName.fog.name()); List<String> zones = monitor.fogConfig.getAreaList();
monitor.processProductAtStartup(zones);
monitor.fireMonitorEvent(monitor); monitor.fireMonitorEvent(monitor);
} }
@ -215,8 +208,8 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
obsData = new ObsData(); obsData = new ObsData();
algorithmData = new TreeMap<Date, Map<String, FOG_THREAT>>(); algorithmData = new TreeMap<Date, Map<String, FOG_THREAT>>();
for (String zone : MonitoringArea.getPlatformMap().keySet()) { for (String zone : fogConfig.getAreaList()) {
obsData.addArea(zone, MonitoringArea.getPlatformMap().get(zone)); obsData.addArea(zone, fogConfig.getAreaStations(zone));
} }
} }
@ -254,38 +247,11 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
@Override @Override
public void processProductMessage(final AlertMessage filtered) { public void processProductMessage(final AlertMessage filtered) {
if (fogPattern.matcher(filtered.dataURI).matches()) { 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) * (non-Javadoc)
* *
@ -319,17 +285,9 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
@Override @Override
public void configUpdate(IMonitorConfigurationEvent me) { public void configUpdate(IMonitorConfigurationEvent me) {
fogConfig = (FSSObsMonitorConfigurationManager) me.getSource(); fogConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea();
if (zoneDialog != null && !zoneDialog.isDisposed()) { if (zoneDialog != null && !zoneDialog.isDisposed()) {
VizApp.runAsync(new Runnable() { zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
@Override
public void run() {
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
});
} }
} }
@ -343,21 +301,6 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
monitor = null; 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 * Gets the main map
* *
@ -377,12 +320,16 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
@Override @Override
protected void process(ObReport result) throws Exception { protected void process(ObReport result) throws Exception {
obData.addReport(result); obData.addReport(result);
String zone = findZone(result.getPlatformId()); // Get zones containing station
if (zone != null) { List<String> zones = fogConfig.getAreaByStationId(result
AreaContainer ac = getTableData().getArea(zone); .getPlatformId());
if (ac != null) { if (!zones.isEmpty() || zones != null) {
ac.addReport(result.getObservationTime(), result); for (String zn : zones) {
fireMonitorEvent(this); 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); algData = algorithmData.get(time);
} else { } else {
// by default is nothing in the ALG column // 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); algData.put(zone, FOG_THREAT.GRAY);
} }
} }
@ -632,9 +579,14 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
@Override @Override
protected void processAtStartup(ObReport report) { protected void processAtStartup(ObReport report) {
obData.addReport(report); obData.addReport(report);
String zone = findZone(report.getPlatformId()); List<String> zones = fogConfig.getAreaByStationId(report
getTableData().getArea(zone).addReport(report.getObservationTime(), .getPlatformId());
report); 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. * Gets Fog Area configuration dialog
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
* *
* @return
*/ */
private void updateMonitoringArea() { public MonitoringAreaConfigDlg getAreaDialog() {
Map<String, List<String>> zones = new HashMap<String, List<String>>(); return areaDialog;
// create zones and station list
for (String zone : fogConfig.getAreaList()) {
List<String> stations = fogConfig.getAreaStations(zone);
zones.put(zone, stations);
}
MonitoringArea.setPlatformMap(zones);
} }
} }

View file

@ -25,8 +25,8 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI; 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.uf.viz.monitor.fog.ui.dialogs.FogMonitoringAreaConfigDlg;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
/** /**
* The Fog Monitor Action * The Fog Monitor Action
@ -42,6 +42,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* May 08, 2014 3086 skorolev Added CloseCallback to dialog. * May 08, 2014 3086 skorolev Added CloseCallback to dialog.
* Sep 16, 2014 2757 skorolev Added test of dialog on dispose. * Sep 16, 2014 2757 skorolev Added test of dialog on dispose.
* Sep 19, 2014 3220 skorolev Added check on dispose. * Sep 19, 2014 3220 skorolev Added check on dispose.
* Jan 08, 2015 3220 skorolev Used area type for launchDialog.
* *
* </pre> * </pre>
* *
@ -65,19 +66,13 @@ public class FogAreaConfigAction extends AbstractHandler {
*/ */
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { 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() Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getShell(); .getShell();
areaDialog = new FogMonitoringAreaConfigDlg(shell, fog.launchDialog("area", shell);
"Fog Monitor Area Configuration");
areaDialog.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
areaDialog = null;
}
});
} }
areaDialog.open();
return null; 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.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; 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.alerts.AlertMessage;
import com.raytheon.uf.viz.core.notification.NotificationMessage; import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.IMonitor; import com.raytheon.uf.viz.monitor.IMonitor;
import com.raytheon.uf.viz.monitor.Monitor; import com.raytheon.uf.viz.monitor.Monitor;
import com.raytheon.uf.viz.monitor.ObsMonitor; import com.raytheon.uf.viz.monitor.ObsMonitor;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.CellType; 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.ObMultiHrsReports;
import com.raytheon.uf.viz.monitor.data.ObReport; import com.raytheon.uf.viz.monitor.data.ObReport;
import com.raytheon.uf.viz.monitor.data.TableCellData; 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.threshold.SSThresholdMgr;
import com.raytheon.uf.viz.monitor.safeseas.ui.dialogs.SSMonitoringAreaConfigDlg; 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.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.alerts.observers.ProductAlertObserver;
import com.raytheon.viz.ui.dialogs.ICloseCallback; import com.raytheon.viz.ui.dialogs.ICloseCallback;
import com.vividsolutions.jts.geom.Geometry; 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. * Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Oct 16, 2014 3220 skorolev Corrected ssAreaConfig assignment. * Oct 16, 2014 3220 skorolev Corrected ssAreaConfig assignment.
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread. * Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with ssAreaConfig.
* *
* </pre> * </pre>
* *
@ -164,13 +161,10 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
private SafeSeasMonitor() { private SafeSeasMonitor() {
pluginPatterns.add(ssPattern); pluginPatterns.add(ssPattern);
ssAreaConfig = FSSObsMonitorConfigurationManager.getSsObsManager(); ssAreaConfig = FSSObsMonitorConfigurationManager.getSsObsManager();
updateMonitoringArea();
initObserver(OBS, this); initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS); obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS);
obData.setThresholdMgr(SSThresholdMgr.getInstance()); obData.setThresholdMgr(SSThresholdMgr.getInstance());
obData.getZoneTableData(); 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 // Pre-populate dialog with an observation (METAR) for KOMA
monitor.createDataStructures(); monitor.createDataStructures();
monitor.getAdjAreas(); monitor.getAdjAreas();
monitor.processProductAtStartup("ss"); List<String> zones = monitor.ssAreaConfig.getAreaList();
monitor.processProductAtStartup(zones);
monitor.fireMonitorEvent(monitor); monitor.fireMonitorEvent(monitor);
} }
return monitor; return monitor;
@ -228,7 +223,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
} else if (type.equals("area")) { } else if (type.equals("area")) {
if (areaDialog == null) { if (areaDialog == null) {
areaDialog = new SSMonitoringAreaConfigDlg(shell, areaDialog = new SSMonitoringAreaConfigDlg(shell,
"Safe Seas Monitor Area Configuration"); "SAFESEAS Monitor Area Configuration");
areaDialog.setCloseCallback(new ICloseCallback() { areaDialog.setCloseCallback(new ICloseCallback() {
@Override @Override
@ -276,7 +271,8 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
@Override @Override
public void processProductMessage(final AlertMessage filtered) { public void processProductMessage(final AlertMessage filtered) {
if (ssPattern.matcher(filtered.dataURI).matches()) { 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); 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) * (non-Javadoc)
* *
@ -357,18 +328,8 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
@Override @Override
public void configUpdate(IMonitorConfigurationEvent me) { public void configUpdate(IMonitorConfigurationEvent me) {
ssAreaConfig = (FSSObsMonitorConfigurationManager) me.getSource(); ssAreaConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea(); zoneDialog.refreshZoneTableData(obData);
if (zoneDialog != null && !zoneDialog.isDisposed()) { fireMonitorEvent(zoneDialog.getClass().getName());
VizApp.runAsync(new Runnable() {
@Override
public void run() {
zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
}
});
}
} }
/** /**
@ -553,7 +514,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
algData = algorithmData.get(time); algData = algorithmData.get(time);
} else { } else {
// by default is nothing in the Fog column // 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); algData.put(zone, FOG_THREAT.GRAY);
} }
} }
@ -594,15 +555,6 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
return type; return type;
} }
/**
* Gets zone dialog
*
* @return zoneDialog
*/
public ZoneTableDlg getDialog() {
return zoneDialog;
}
/** /**
* Gets adjacent areas * Gets adjacent areas
*/ */
@ -679,19 +631,11 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
} }
/** /**
* Reads Table Configuration. * Gets SAFESEAS Area configuration dialog
*
* Method that reads the table configuration and updates the zone monitor
* threshold map
* *
* @return
*/ */
public void updateMonitoringArea() { public SSMonitoringAreaConfigDlg getAreaDialog() {
Map<String, List<String>> zones = new HashMap<String, List<String>>(); return areaDialog;
// create zones and station list
for (String zone : ssAreaConfig.getAreaList()) {
List<String> stations = ssAreaConfig.getAreaStations(zone);
zones.put(zone, stations);
}
MonitoringArea.setPlatformMap(zones);
} }
} }

View file

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

View file

@ -22,9 +22,7 @@ package com.raytheon.uf.viz.monitor.snow;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.eclipse.swt.widgets.Shell; 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.monitor.data.CommonConfig;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; 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.alerts.AlertMessage;
import com.raytheon.uf.viz.core.notification.NotificationMessage; import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.monitor.IMonitor; import com.raytheon.uf.viz.monitor.IMonitor;
import com.raytheon.uf.viz.monitor.Monitor; import com.raytheon.uf.viz.monitor.Monitor;
import com.raytheon.uf.viz.monitor.ObsMonitor; 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.ObMultiHrsReports;
import com.raytheon.uf.viz.monitor.data.ObReport; import com.raytheon.uf.viz.monitor.data.ObReport;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent; 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. * Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Oct 16, 2014 3220 skorolev Corrected snowConfig assignment. * Oct 16, 2014 3220 skorolev Corrected snowConfig assignment.
* Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread. * Dec 11, 2014 3220 skorolev Moved refreshing of table in the UI thread.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with snowAreaConfig.
* *
* </pre> * </pre>
* *
@ -99,7 +96,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
private SnowMonitoringAreaConfigDlg areaDialog = null; private SnowMonitoringAreaConfigDlg areaDialog = null;
/** SNOW configuration manager **/ /** SNOW configuration manager **/
private FSSObsMonitorConfigurationManager snowConfig = null; private FSSObsMonitorConfigurationManager snowAreaConfig = null;
/** /**
* This object contains all observation data necessary for the table dialogs * This object contains all observation data necessary for the table dialogs
@ -130,8 +127,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
*/ */
private SnowMonitor() { private SnowMonitor() {
pluginPatterns.add(snowPattern); pluginPatterns.add(snowPattern);
snowConfig = FSSObsMonitorConfigurationManager.getSnowObsManager(); snowAreaConfig = FSSObsMonitorConfigurationManager.getSnowObsManager();
updateMonitoringArea();
initObserver(OBS, this); initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW); obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW);
obData.setThresholdMgr(SnowThresholdMgr.getInstance()); obData.setThresholdMgr(SnowThresholdMgr.getInstance());
@ -146,7 +142,8 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
public static synchronized SnowMonitor getInstance() { public static synchronized SnowMonitor getInstance() {
if (monitor == null) { if (monitor == null) {
monitor = new SnowMonitor(); monitor = new SnowMonitor();
monitor.processProductAtStartup("snow"); List<String> zones = monitor.snowAreaConfig.getAreaList();
monitor.processProductAtStartup(zones);
monitor.fireMonitorEvent(monitor); monitor.fireMonitorEvent(monitor);
} }
return monitor; return monitor;
@ -239,7 +236,8 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
@Override @Override
public void processProductMessage(final AlertMessage filtered) { public void processProductMessage(final AlertMessage filtered) {
if (snowPattern.matcher(filtered.dataURI).matches()) { 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) * (non-Javadoc)
* *
@ -305,18 +286,10 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
*/ */
@Override @Override
public void configUpdate(IMonitorConfigurationEvent me) { public void configUpdate(IMonitorConfigurationEvent me) {
snowConfig = (FSSObsMonitorConfigurationManager) me.getSource(); snowAreaConfig = (FSSObsMonitorConfigurationManager) me.getSource();
updateMonitoringArea();
if (zoneDialog != null && !zoneDialog.isDisposed()) { if (zoneDialog != null && !zoneDialog.isDisposed()) {
VizApp.runAsync(new Runnable() { zoneDialog.refreshZoneTableData(obData);
fireMonitorEvent(zoneDialog.getClass().getName());
@Override
public void run() {
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 * @return zoneDialog
*/ */
@ -435,6 +408,15 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
return zoneDialog; return zoneDialog;
} }
/**
* Gets SNOW Area configuration dialog
*
* @return
*/
public SnowMonitoringAreaConfigDlg getAreaDialog() {
return areaDialog;
}
/** /**
* Sets the zoneDialog * Sets the zoneDialog
* *

View file

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

View file

@ -22,11 +22,10 @@ package com.raytheon.uf.viz.monitor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.eclipse.swt.widgets.Display;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil; import com.raytheon.uf.common.dataplugin.annotations.DataURIUtil;
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord; 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.localization.LocalizationManager;
import com.raytheon.uf.viz.core.notification.NotificationMessage; import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.datacube.DataCubeContainer; 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.data.ObReport;
import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent; import com.raytheon.uf.viz.monitor.events.IMonitorConfigurationEvent;
import com.raytheon.uf.viz.monitor.events.IMonitorThresholdEvent; 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 * Feb 04, 2014 2757 skorolev Added filter for removed stations
* May 08, 2014 3086 skorolev Added current site definition. * May 08, 2014 3086 skorolev Added current site definition.
* Sep 04, 2014 3220 skorolev Removed cwa and monitorUsefrom vals. * Sep 04, 2014 3220 skorolev Removed cwa and monitorUsefrom vals.
* Jan 08, 2015 3220 skorolev Added zones parameter to processURI.
* *
* </pre> * </pre>
* *
@ -187,45 +186,29 @@ public abstract class ObsMonitor extends Monitor {
* *
* @param dataURI * @param dataURI
* @param filtered * @param filtered
* @param zones
*/ */
public void processURI(String dataURI, AlertMessage filtered) { public void processURI(String dataURI, AlertMessage filtered,
final List<String> zones) {
try { try {
Map<String, RequestConstraint> constraints = RequestConstraint Map<String, RequestConstraint> constraints = RequestConstraint
.toConstraintMapping(DataURIUtil.createDataURIMap(dataURI)); .toConstraintMapping(DataURIUtil.createDataURIMap(dataURI));
FSSObsRecord[] pdos = requestFSSObs(constraints, null); FSSObsRecord[] pdos = requestFSSObs(constraints, null);
if (pdos.length > 0 && pdos[0].getTimeObs() != null) { if (pdos.length > 0 && pdos[0].getTimeObs() != null) {
final FSSObsRecord objectToSend = pdos[0]; final FSSObsRecord objectToSend = pdos[0];
try { if (!zones.isEmpty()) {
Display.getDefault().asyncExec(new Runnable() { ObReport result = GenerateFSSObReport
public void run() { .generateObReport(objectToSend);
try { statusHandler.handle(Priority.INFO, "New FSSrecord ===> "
// Filter removed stations + objectToSend.getDataURI());
ArrayList<String> zones = MonitoringArea try {
.getZoneIds(objectToSend process(result);
.getPlatformId()); } catch (Exception e) {
if (!zones.isEmpty()) { statusHandler
ObReport result = GenerateFSSObReport .handle(Priority.PROBLEM,
.generateObReport(objectToSend); "An error has occured processing the incoming messages.",
statusHandler e);
.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);
} }
} }
} catch (final Exception e) { } catch (final Exception e) {
@ -237,10 +220,10 @@ public abstract class ObsMonitor extends Monitor {
/** /**
* Process products at startup * 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 * 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); FSSObsRecord[] obsRecords = requestFSSObs(vals, selectedTimes);
for (FSSObsRecord objectToSend : obsRecords) { for (FSSObsRecord objectToSend : obsRecords) {
// Filter removed stations // Filter removed stations
ArrayList<String> zones = MonitoringArea
.getZoneIds(objectToSend.getPlatformId());
if (!zones.isEmpty()) { if (!zones.isEmpty()) {
ObReport result = GenerateFSSObReport ObReport result = GenerateFSSObReport
.generateObReport(objectToSend); .generateObReport(objectToSend);
@ -286,7 +267,7 @@ public abstract class ObsMonitor extends Monitor {
} }
} catch (DataCubeException e) { } catch (DataCubeException e) {
statusHandler.handle(Priority.PROBLEM, 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; package com.raytheon.uf.viz.monitor.data;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; 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;
import com.raytheon.uf.common.monitor.data.ObConst.ChosenAppKey; import com.raytheon.uf.common.monitor.data.ObConst.ChosenAppKey;
import com.raytheon.uf.common.monitor.data.ObConst.ThreatLevel; 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. * Feb 17, 2009 1999 grichard Initial creation.
* 3/16/2009 2047 grichard Add threat monitoring routines. * 3/16/2009 2047 grichard Add threat monitoring routines.
* Dec 24, 2009 3424 zhao added getDualValuedThresholdMap and getSingleValuedThresholdMap * Dec 24, 2009 3424 zhao added getDualValuedThresholdMap and getSingleValuedThresholdMap
* Jan 12, 2015 3220 skorolev Replaced MonitoringArea with areaConfig.
* *
* </pre> * </pre>
* *
@ -62,56 +65,6 @@ public final class MonitorAreaThresholds {
// Map containing the display thresholds // Map containing the display thresholds
private static Map<String, DisplayThresholdsSet> zoneDisplayThresholds = new HashMap<String, DisplayThresholdsSet>(); 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 * This method receives an observation report and a variable name, and
* returns the threat level of that single variable. * returns the threat level of that single variable.
@ -127,12 +80,13 @@ public final class MonitorAreaThresholds {
ThreatLevel threatLevel = ThreatLevel.GRAY; ThreatLevel threatLevel = ThreatLevel.GRAY;
ThreatLevel temp = ThreatLevel.GRAY; ThreatLevel temp = ThreatLevel.GRAY;
String station = report.getPlatformId();
try { try {
if (report.isStationary()) { if (report.isStationary()) {
if (chosenAppKey == ChosenAppKey.SAFESEAS) { if (chosenAppKey == ChosenAppKey.SAFESEAS) {
if (MonitoringArea.listZonesToPlatform( List<String> ssZones = FSSObsMonitorConfigurationManager
report.getPlatformId()).isEmpty()) { .getSsObsManager().getAreaByStationId(station);
if (ssZones.isEmpty()) {
// use the default zone if there are no zones // use the default zone if there are no zones
for (VarName v : VarName.values()) { for (VarName v : VarName.values()) {
if (v == VarName.TEMPERATURE if (v == VarName.TEMPERATURE
@ -150,8 +104,7 @@ public final class MonitorAreaThresholds {
} }
} }
} else { } else {
for (String z : MonitoringArea for (String z : ssZones) {
.listZonesToPlatform(report.getPlatformId())) {
for (VarName v : VarName.values()) { for (VarName v : VarName.values()) {
if (v == VarName.TEMPERATURE if (v == VarName.TEMPERATURE
|| v == VarName.WIND_CHILL || v == VarName.WIND_CHILL
@ -169,8 +122,9 @@ public final class MonitorAreaThresholds {
} }
} }
} else if (chosenAppKey == ChosenAppKey.SNOW) { } else if (chosenAppKey == ChosenAppKey.SNOW) {
if (MonitoringArea.listZonesToPlatform( List<String> snowZones = FSSObsMonitorConfigurationManager
report.getPlatformId()).isEmpty()) { .getSnowObsManager().getAreaByStationId(station);
if (snowZones.isEmpty()) {
// use the default zone if there are no zones // use the default zone if there are no zones
for (VarName v : VarName.values()) { for (VarName v : VarName.values()) {
if (v == VarName.PRIM_SWELL_HT) { if (v == VarName.PRIM_SWELL_HT) {
@ -185,8 +139,7 @@ public final class MonitorAreaThresholds {
} }
} else { } else {
for (String z : MonitoringArea for (String z : snowZones) {
.listZonesToPlatform(report.getPlatformId())) {
for (VarName v : VarName.values()) { for (VarName v : VarName.values()) {
if (v == VarName.PRIM_SWELL_HT) { if (v == VarName.PRIM_SWELL_HT) {
break; break;
@ -199,9 +152,10 @@ public final class MonitorAreaThresholds {
} }
} }
} }
} else { } else {// chosenAppKey = FOG
if (MonitoringArea.listZonesToPlatform( List<String> fogZones = FSSObsMonitorConfigurationManager
report.getPlatformId()).isEmpty()) { .getFogObsManager().getAreaByStationId(station);
if (fogZones.isEmpty()) {
// use the default zone if there are no zones // use the default zone if there are no zones
temp = getZoneThreatLevel(ObConst.DEFAULT_STATION_NAME, temp = getZoneThreatLevel(ObConst.DEFAULT_STATION_NAME,
VarName.PRES_WX, report.getPresentWx()); VarName.PRES_WX, report.getPresentWx());
@ -209,20 +163,21 @@ public final class MonitorAreaThresholds {
threatLevel = temp; threatLevel = temp;
} }
temp = getZoneThreatLevel(ObConst.DEFAULT_STATION_NAME, temp = getZoneThreatLevel(ObConst.DEFAULT_STATION_NAME,
VarName.VISIBILITY, getReportVarValue(report, VarName.VISIBILITY,
VarName.VISIBILITY)); getReportVarValue(report, VarName.VISIBILITY));
if (temp.ordinal() < threatLevel.ordinal()) { if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp; threatLevel = temp;
} }
} else { } else {
for (String z : MonitoringArea for (String z : fogZones) {
.listZonesToPlatform(report.getPlatformId())) {
temp = getZoneThreatLevel(z, VarName.PRES_WX, temp = getZoneThreatLevel(z, VarName.PRES_WX,
report.getPresentWx()); report.getPresentWx());
if (temp.ordinal() < threatLevel.ordinal()) { if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp; threatLevel = temp;
} }
temp = getZoneThreatLevel(z, VarName.VISIBILITY, temp = getZoneThreatLevel(
z,
VarName.VISIBILITY,
getReportVarValue(report, getReportVarValue(report,
VarName.VISIBILITY)); VarName.VISIBILITY));
if (temp.ordinal() < threatLevel.ordinal()) { if (temp.ordinal() < threatLevel.ordinal()) {
@ -231,6 +186,7 @@ public final class MonitorAreaThresholds {
} }
} }
} }
// report is not Stationary
} else { } else {
if (chosenAppKey == ChosenAppKey.SAFESEAS) { if (chosenAppKey == ChosenAppKey.SAFESEAS) {
String zoneId = report.getZoneId(); String zoneId = report.getZoneId();
@ -243,8 +199,8 @@ public final class MonitorAreaThresholds {
} else if (v == VarName.STATIONARY) { } else if (v == VarName.STATIONARY) {
break; break;
} }
temp = getZoneThreatLevel(zoneId, v, getReportVarValue( temp = getZoneThreatLevel(zoneId, v,
report, v)); getReportVarValue(report, v));
if (temp.ordinal() < threatLevel.ordinal()) { if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp; threatLevel = temp;
} }
@ -257,13 +213,13 @@ public final class MonitorAreaThresholds {
if (v == VarName.PRIM_SWELL_HT) { if (v == VarName.PRIM_SWELL_HT) {
break; break;
} }
temp = getZoneThreatLevel(zoneId, v, getReportVarValue( temp = getZoneThreatLevel(zoneId, v,
report, v)); getReportVarValue(report, v));
if (temp.ordinal() < threatLevel.ordinal()) { if (temp.ordinal() < threatLevel.ordinal()) {
threatLevel = temp; threatLevel = temp;
} }
} }
} else { } else {// chosenAppKey = FOG
String zoneId = report.getZoneId(); String zoneId = report.getZoneId();
// TEMPORARILY USE DEFAULT ZONE ID, NAMELY, DEFAULT STATION. // TEMPORARILY USE DEFAULT ZONE ID, NAMELY, DEFAULT STATION.
zoneId = ObConst.DEFAULT_STATION_NAME; zoneId = ObConst.DEFAULT_STATION_NAME;
@ -608,29 +564,41 @@ public final class MonitorAreaThresholds {
/** /**
* [Dec 24, 2009, zhao] * [Dec 24, 2009, zhao]
* @param zone the zone ID *
* @param varName enumerated-type variable name * @param zone
* @return single-valued threshold map, or null if the variable * the zone ID
* name is invalid or if the map contains no mapping for the key * @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) { public static Map<ObConst.ThreatLevel, Float> getSingleValuedThresholdMap(
if (varName == VarName.WIND_DIR || varName == VarName.PRIM_SWELL_DIR || varName == VarName.SEC_SWELL_DIR ) { String zone, ObConst.VarName varName) {
return null; if (varName == VarName.WIND_DIR || varName == VarName.PRIM_SWELL_DIR
} || varName == VarName.SEC_SWELL_DIR) {
return zoneMonitorThresholds.get(zone).getSingleValuedThresholdMap(varName); return null;
}
return zoneMonitorThresholds.get(zone).getSingleValuedThresholdMap(
varName);
} }
/** /**
* [Dec 24, 2009, zhao] * [Dec 24, 2009, zhao]
* @param zone the zone ID *
* @param varName enumerated-type variable name * @param zone
* @return duel-valued threshold map, or null if the variable * the zone ID
* name is invalid or if the map contains no mapping for the key * @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) { public static Map<ObConst.ThreatLevel, Float[]> getDualValuedThresholdMap(
if (varName != VarName.WIND_DIR || varName != VarName.PRIM_SWELL_DIR || varName != VarName.SEC_SWELL_DIR ) { String zone, ObConst.VarName varName) {
return null; if (varName != VarName.WIND_DIR || varName != VarName.PRIM_SWELL_DIR
} || varName != VarName.SEC_SWELL_DIR) {
return zoneMonitorThresholds.get(zone).getDualValuedThresholdMap(varName); 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.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import com.raytheon.uf.common.monitor.data.CommonConfig; import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName; import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
@ -40,13 +39,14 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
* <pre> * <pre>
* *
* SOFTWARE HISTORY * SOFTWARE HISTORY
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Dec. 1, 2009 3424 zhao Initial creation. * Dec. 1, 2009 3424 zhao Initial creation.
* Oct.29, 2012 1297 skorolev Changed HashMap to Map * Oct.29, 2012 1297 skorolev Changed HashMap to Map
* Oct.31 2012 1297 skorolev Cleaned code. * Oct.31, 2012 1297 skorolev Cleaned code.
* Sep 04 2014 3220 skorolev Added updateZones method. * Sep 04, 2014 3220 skorolev Added updateZones method.
* Dec 18 2014 3841 skorolev Corrected updateZones method. * Dec 18, 2014 3841 skorolev Corrected updateZones method.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with areaConfig.
* *
* </pre> * </pre>
* *
@ -73,6 +73,9 @@ public class ObHourReports {
*/ */
private Map<String, ObZoneHourReports> hourReports; private Map<String, ObZoneHourReports> hourReports;
/**
* current threshold manager
*/
private AbstractThresholdMgr thresholdMgr; private AbstractThresholdMgr thresholdMgr;
/** /**
@ -86,9 +89,8 @@ public class ObHourReports {
this.appName = appName; this.appName = appName;
this.thresholdMgr = thresholdMgr; this.thresholdMgr = thresholdMgr;
hourReports = new HashMap<String, ObZoneHourReports>(); hourReports = new HashMap<String, ObZoneHourReports>();
Map<String, List<String>> zoneStationMap = MonitoringArea List<String> zones = thresholdMgr.getAreaConfigMgr().getAreaList();
.getPlatformMap(); for (String zone : zones) {
for (String zone : zoneStationMap.keySet()) {
hourReports.put(zone, new ObZoneHourReports(nominalTime, zone, hourReports.put(zone, new ObZoneHourReports(nominalTime, zone,
appName, thresholdMgr)); appName, thresholdMgr));
} }
@ -101,7 +103,8 @@ public class ObHourReports {
*/ */
public void addReport(ObReport report) { public void addReport(ObReport report) {
String station = report.getPlatformId(); String station = report.getPlatformId();
List<String> zones = MonitoringArea.getZoneIds(station); List<String> zones = thresholdMgr.getAreaConfigMgr()
.getAreaByStationId(station);
if (zones.size() == 0) { if (zones.size() == 0) {
statusHandler statusHandler
.error("Error: station: " .error("Error: station: "
@ -123,6 +126,8 @@ public class ObHourReports {
} }
/** /**
* Gets HourReports
*
* @return hourReports * @return hourReports
*/ */
public Map<String, ObZoneHourReports> getHourReports() { public Map<String, ObZoneHourReports> getHourReports() {
@ -186,8 +191,8 @@ public class ObHourReports {
} }
/** /**
* Returns the ObZoneHourReports object of a caller-specified zone. If such * Gets ObZoneHourReports Returns the ObZoneHourReports object of a
* object not available, returns null. * caller-specified zone. If such object not available, returns null.
* *
* @param zone * @param zone
* @return hour reports * @return hour reports
@ -200,6 +205,8 @@ public class ObHourReports {
} }
/** /**
* Gets NominalTime
*
* @return nominalTime * @return nominalTime
*/ */
public Date getNominalTime() { public Date getNominalTime() {
@ -207,6 +214,8 @@ public class ObHourReports {
} }
/** /**
* Gets AppName
*
* @return appName * @return appName
*/ */
public CommonConfig.AppName getAppName() { public CommonConfig.AppName getAppName() {
@ -217,10 +226,10 @@ public class ObHourReports {
* Updates zones in the Hour Reports * Updates zones in the Hour Reports
*/ */
public void updateZones() { public void updateZones() {
Map<String, List<String>> zoneStationMap = MonitoringArea
.getPlatformMap();
// Updated list of zones // Updated list of zones
Set<String> updtZones = zoneStationMap.keySet(); List<String> updtZones = thresholdMgr.getAreaConfigMgr().getAreaList();
// remove zones
hourReports.keySet().retainAll(updtZones);
// add zones // add zones
for (String zone : updtZones) { for (String zone : updtZones) {
if (!hourReports.keySet().contains(zone)) { if (!hourReports.keySet().contains(zone)) {
@ -228,12 +237,14 @@ public class ObHourReports {
appName, thresholdMgr)); appName, thresholdMgr));
} }
} }
// remove zones
hourReports.keySet().retainAll(updtZones);
// add and(or) remove stations // add and(or) remove stations
for (String zone : updtZones) { for (String zone : updtZones) {
// Updated list of stations in this zone // 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 // add stations
for (String stn : updtStns) { for (String stn : updtStns) {
if (!hourReports.get(zone).getZoneHourReports() if (!hourReports.get(zone).getZoneHourReports()
@ -246,9 +257,8 @@ public class ObHourReports {
stn, appName, thresholdMgr)); stn, appName, thresholdMgr));
} }
} }
// remove stations // update hourReports for current zone
hourReports.get(zone).getZoneHourReports().keySet() hourReports.get(zone).getZoneHourReports();
.retainAll(updtStns);
} }
} }
} }

View file

@ -24,11 +24,13 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.TreeMap; 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;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName; 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;
@ -53,6 +55,7 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
* Oct.31, 2012 1297 skorolev Clean code. * Oct.31, 2012 1297 skorolev Clean code.
* Jan. 29, 2013 15654 zhao add Wind Chill calculation for SNOW * Jan. 29, 2013 15654 zhao add Wind Chill calculation for SNOW
* Sep 04, 2014 3220 skorolev Updated getStationTableData method. * Sep 04, 2014 3220 skorolev Updated getStationTableData method.
* Jan 08, 2015 3220 skorolev Replaced MonitoringArea with cfgMgr.
* *
* </pre> * </pre>
* *
@ -151,9 +154,11 @@ public class ObMultiHrsReports {
/** /**
* DR15654: set Wind Chill for SNOW * DR15654: set Wind Chill for SNOW
*/ */
if ( appName == AppName.SNOW ) { if (appName == AppName.SNOW) {
if ( report.getTemperature() != ObConst.MISSING && report.getWindSpeed() != ObConst.MISSING ) { if (report.getTemperature() != ObConst.MISSING
report.setWindChill(calcWindChill( report.getTemperature(), report.getWindSpeed() )); && report.getWindSpeed() != ObConst.MISSING) {
report.setWindChill(calcWindChill(report.getTemperature(),
report.getWindSpeed()));
} }
} }
@ -173,28 +178,28 @@ public class ObMultiHrsReports {
} }
} }
/** /**
* DR 15654: * DR 15654: Wind Chill calculation formula based on
* Wind Chill calculation formula based on * http://www.nws.noaa.gov/om/windchill/ as of Jan. 29, 2013
* http://www.nws.noaa.gov/om/windchill/ *
* as of Jan. 29, 2013 * @param temp
* * in degree F
* @param temperature in degree F * @param windSpd
* @param windSpeed in knots * in knots
* @return wind chill in degree F * @return wind chill in degree F
*/ */
private float calcWindChill(float temp, float windSpd) { private float calcWindChill(float temp, float windSpd) {
if ( temp > 50.0 || windSpd < 3.0 ) { if (temp > 50.0 || windSpd < 3.0) {
return ObConst.MISSING; return ObConst.MISSING;
} }
/** /**
* 1 knots = 1.15078 mph * 1 knots = 1.15078 mph
*/ */
float spd = (float) Math.pow(1.15078*windSpd, 0.16); float spd = (float) Math.pow(1.15078 * windSpd, 0.16);
return 35.74f + 0.6215f*temp - 35.75f*spd + 0.4275f*temp*spd; 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 * Returns a zone TableData object of the latest nominal time. If no data
* available (the map is empty), returns an empty zone TableData object * available (the map is empty), returns an empty zone TableData object
* (table cells filled with "N/A"). * (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 * Returns the station TableData object for the latest nominal time. If no
* data available, an empty/default station TableData object is returned * data available, an empty/default station TableData object is returned
*
* @param zone
* @return
*/ */
public TableData getStationTableData(String zone) { public TableData getStationTableData(String zone) {
if (multiHrsReports.isEmpty()) { if (multiHrsReports.isEmpty()) {
@ -264,9 +272,13 @@ public class ObMultiHrsReports {
* Returns a station TableData object for a caller-specified nominal-time * Returns a station TableData object for a caller-specified nominal-time
* and zone ID. If no data available, an empty/default station TableData * and zone ID. If no data available, an empty/default station TableData
* object is returned. * object is returned.
*
* @param nominalTime
* @param zone
* @return
*/ */
public TableData getStationTableData(Date nominalTime, String zone) { public TableData getStationTableData(Date nominalTime, String zone) {
if(zone.equals("")){ if (zone.equals("")) {
return this.getEmptyZoneTableData(); return this.getEmptyZoneTableData();
} }
if (nominalTime == null) { if (nominalTime == null) {
@ -296,6 +308,7 @@ public class ObMultiHrsReports {
* @param zone * @param zone
* @param Station * @param Station
* @param varName * @param varName
* @param productName
* @return ObTrendDataSet object, or null if no data available * @return ObTrendDataSet object, or null if no data available
*/ */
public ObTrendDataSet getTrendDataSet(String zone, String station, public ObTrendDataSet getTrendDataSet(String zone, String station,
@ -373,12 +386,15 @@ public class ObMultiHrsReports {
} }
/** /**
* Gets Histogram Table Data
* *
* @param zone
* : current zone
* @param station * @param station
* station ID * : station ID
* @param obsType * @param obsType
* ObsHistType * : ObsHistType
* @return TableData object for obs history table * @return
*/ */
public TableData getHistTableData(String zone, String station, public TableData getHistTableData(String zone, String station,
ObsHistType obsType) { 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() { public SortedMap<Date, ObHourReports> getMultiHrsReports() {
return multiHrsReports; return multiHrsReports;
} }
/** /**
* Returns a SortedMap object (key is nominal time, value is zone TableData * Gets MultiHrsTableData Returns a SortedMap object (key is nominal time,
* object) * value is zone TableData object)
* *
* @return * @return
*/ */
@ -500,8 +516,8 @@ public class ObMultiHrsReports {
} }
/** /**
* Returns the latest nominal time if the map is not empty; otherwise, * Gets the Latest NominalTime Returns the latest nominal time if the map is
* returns the nominal time of the present date-time * not empty; otherwise, returns the nominal time of the present date-time
* *
* @return * @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() { public Set<Date> getNominalTimes() {
return multiHrsReports.keySet(); return multiHrsReports.keySet();
} }
/** /**
* Returns the ObHourReports object of the latest nominal time. If no data * Gets ObHourReports Returns the ObHourReports object of the latest nominal
* available, returns an empty ObHourReports object. * time. If no data available, returns an empty ObHourReports object.
* *
* @return * @return
*/ */
@ -540,8 +556,9 @@ public class ObMultiHrsReports {
} }
/** /**
* Returns an ObHourReports object of a caller-specified nominal time. If no * Gets ObHourReports Returns an ObHourReports object of a caller-specified
* data available, returns an empty ObHourReports object. * nominal time. If no data available, returns an empty ObHourReports
* object.
* *
* @param nominalTime * @param nominalTime
* @return * @return
@ -574,6 +591,7 @@ public class ObMultiHrsReports {
} }
/** /**
* Gets Threshold Manager
* *
* @return the threshold manager * @return the threshold manager
*/ */
@ -591,6 +609,7 @@ public class ObMultiHrsReports {
} }
/** /**
* Gets map of types for ALG cell
* *
* @return fogAlgCellType * @return fogAlgCellType
*/ */
@ -603,7 +622,13 @@ public class ObMultiHrsReports {
*/ */
private void initFogAlgCellType() { private void initFogAlgCellType() {
fogAlgCellType = new HashMap<String, CellType>(); 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(); Iterator<String> itr = zones.iterator();
while (itr.hasNext()) { while (itr.hasNext()) {
fogAlgCellType.put(itr.next(), CellType.NotAvailable); 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 * Feb 28, 2013 14410 zhao Modified getCellTypeForBlizWarn
* May 23, 2014 3086 skorolev Corrected ObsHistType. Cleaned code. * 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. * 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> * </pre>
* *
@ -113,10 +114,10 @@ public final class TableUtil {
isZone = true; isZone = true;
} }
String hoverText = null; String hoverText = "";
if (isZone) { if (isZone) {
AreaIdXML zoneXML = FSSObsMonitorConfigurationManager AreaIdXML zoneXML = FSSObsMonitorConfigurationManager
.getSsObsManager().getAreaXml(zone); .getFogObsManager().getAreaXml(zone);
if (zoneXML != null) { if (zoneXML != null) {
hoverText = getZoneHoverText(zoneXML); hoverText = getZoneHoverText(zoneXML);
} }
@ -344,7 +345,7 @@ public final class TableUtil {
isZone = true; isZone = true;
} }
String hoverText = null; String hoverText = "";
if (isZone) { if (isZone) {
AreaIdXML zoneXML = FSSObsMonitorConfigurationManager AreaIdXML zoneXML = FSSObsMonitorConfigurationManager
.getSsObsManager().getAreaXml(zone); .getSsObsManager().getAreaXml(zone);
@ -649,10 +650,10 @@ public final class TableUtil {
isZone = true; isZone = true;
} }
String hoverText = null; String hoverText = "";
if (isZone) { if (isZone) {
AreaIdXML zoneXML = FSSObsMonitorConfigurationManager AreaIdXML zoneXML = FSSObsMonitorConfigurationManager
.getSsObsManager().getAreaXml(zone); .getSnowObsManager().getAreaXml(zone);
if (zoneXML != null) { if (zoneXML != null) {
hoverText = getZoneHoverText(zoneXML); hoverText = getZoneHoverText(zoneXML);
} }

View file

@ -57,6 +57,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* Feb 16, 2011 #7346 zhao added getDirectionalThresholdValueCellType(...) * Feb 16, 2011 #7346 zhao added getDirectionalThresholdValueCellType(...)
* Apr 28, 2014 3086 skorolev Updated getAreaConfigMgr method. * Apr 28, 2014 3086 skorolev Updated getAreaConfigMgr method.
* Oct 17, 2014 3220 skorolev Replaced System.out.print with debug statusHandler. * Oct 17, 2014 3220 skorolev Replaced System.out.print with debug statusHandler.
* Jan 08, 2015 3220 skorolev Added getAreaConfigMgr.
* *
* </pre> * </pre>
* *
@ -71,7 +72,7 @@ public abstract class AbstractThresholdMgr {
/** /**
* Monitor Area Configuration Manager. * Monitor Area Configuration Manager.
*/ */
protected FSSObsMonitorConfigurationManager areaConfigMgr; public FSSObsMonitorConfigurationManager areaConfigMgr;
/** /**
* Default file name for the FOG display thresholds. * 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 * @param stationId
* The station to get the area * The station to get the zones
* @return List of areas * @return List of zones
*/ */
public List<String> getAreaByStationId(String stationId) { public List<String> getAreaByStationId(String stationId) {
List<String> results = new ArrayList<String>(); List<String> results = new ArrayList<String>();

View file

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