Omaha #3220 - Corrected area configuration managers for Fog, SAFESEAS and SNOW monitors.

Former-commit-id: 5fb653e5c7f7ffff1daf53487147597a569d7d11
This commit is contained in:
Slav Korolev 2014-10-16 14:00:31 -04:00
parent 887b47cda1
commit 9c369a9c5c
24 changed files with 807 additions and 753 deletions

View file

@ -89,6 +89,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Sep 23, 2014 3356 njensen Remove unnecessary import
* Oct 16, 2014 3220 skorolev Corrected fogConfig assignment.
*
*
* </pre>
@ -160,7 +161,7 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
*/
private FogMonitor() {
pluginPatterns.add(fogPattern);
fogConfig = new FSSObsMonitorConfigurationManager(MonName.fog.name());
fogConfig = FSSObsMonitorConfigurationManager.getFogObsManager();
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.FOG);
@ -650,5 +651,4 @@ public class FogMonitor extends ObsMonitor implements IFogResourceListener {
}
MonitoringArea.setPlatformMap(zones);
}
}

View file

@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.fog.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -42,6 +41,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.FogMonitor;
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
* May 20, 2014 3086 skorolev Cleaned code.
* Sep 04, 2014 3220 skorolev Removed "site".
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
*
* </pre>
*
@ -61,8 +61,7 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
super("DefaultFogDisplayThresholds.xml",
"DefaultFogMonitorThresholds.xml", AppName.FOG.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
areaConfigMgr = FSSObsMonitorConfigurationManager.getFogObsManager();
init();
}
@ -75,7 +74,6 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
if (classInstance == null) {
classInstance = new FogThresholdMgr();
}
return classInstance;
}
@ -118,20 +116,4 @@ public class FogThresholdMgr extends AbstractThresholdMgr {
}
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
}
return areaConfigMgr;
}
}

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------
* May 21, 2014 3086 skorolev Cleaned code.
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
*
* </pre>
*
@ -178,22 +179,23 @@ public class FogMonitorMeteoTab extends TabItemComp implements
ThresholdsXML threshXML = ftm.getThresholdsXmlData(duKey);
List<AreaXML> areasArray = threshXML.getAreas();
if (areasArray != null) {
for (AreaXML area : areasArray) {
String areaID = area.getAreaId();
FogMonitorMeteoData fmmd = new FogMonitorMeteoData();
fmmd.setAreaID(areaID);
for (AreaXML area : areasArray) {
String areaID = area.getAreaId();
FogMonitorMeteoData fmmd = new FogMonitorMeteoData();
fmmd.setAreaID(areaID);
/*
* Visibility
*/
String xmlKey = FogMonitor.FOG_MONITOR_METEO_VIS.getXmlKey();
fmmd.setMeteoVisR(ftm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
fmmd.setMeteoVisY(ftm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Visibility
*/
String xmlKey = FogMonitor.FOG_MONITOR_METEO_VIS.getXmlKey();
fmmd.setMeteoVisR(ftm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
fmmd.setMeteoVisY(ftm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
fogDataArray.add(fmmd);
fogDataArray.add(fmmd);
}
}
}

View file

@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
@ -49,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
*
*
* </pre>
@ -150,11 +150,7 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
@Override
protected FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
}
return configMgr;
return FSSObsMonitorConfigurationManager.getFogObsManager();
}
/*

View file

@ -28,7 +28,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
@ -60,6 +59,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs.
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
*
* </pre>
*
@ -79,6 +79,7 @@ public class FogZoneTableDlg extends ZoneTableDlg {
*/
public FogZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
super(parent, obData, CommonConfig.AppName.FOG);
configMgr = FSSObsMonitorConfigurationManager.getFogObsManager();
}
/**
@ -294,19 +295,4 @@ public class FogZoneTableDlg extends ZoneTableDlg {
protected void shellDisposeAction() {
// Not used
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null || configMgr.isPopulated()) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
}
return configMgr;
}
}

View file

@ -37,7 +37,6 @@ 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;
@ -87,6 +86,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Oct 16, 2014 3220 skorolev Corrected ssAreaConfig assignment.
*
* </pre>
*
@ -161,7 +161,7 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
*/
private SafeSeasMonitor() {
pluginPatterns.add(ssPattern);
ssAreaConfig = new FSSObsMonitorConfigurationManager(MonName.ss.name());
ssAreaConfig = FSSObsMonitorConfigurationManager.getSsObsManager();
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SAFESEAS);
@ -685,5 +685,4 @@ public class SafeSeasMonitor extends ObsMonitor implements ISSResourceListener {
}
MonitoringArea.setPlatformMap(zones);
}
}

View file

@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.safeseas.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -42,6 +41,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
* Feb 03, 2014 #2757 skorolev Fixed reInitialize().
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Removed "site".
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
*
* </pre>
*
@ -59,7 +59,7 @@ public class SSThresholdMgr extends AbstractThresholdMgr {
super("DefaultSSDisplayThresholds.xml",
"DefaultSSMonitorThresholds.xml", AppName.SAFESEAS.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
areaConfigMgr = FSSObsMonitorConfigurationManager.getSsObsManager();
init();
}
@ -113,19 +113,4 @@ public class SSThresholdMgr extends AbstractThresholdMgr {
}
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.ss.name());
}
return areaConfigMgr;
}
}

View file

@ -41,305 +41,309 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* SAFESEAS Monitor Meteo Table.
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 17, 2014 2757 skorolev Removed unnecessary printouts.
*
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
*
* </pre>
*
*
* @author skorolev
* @version 1.0
* @version 1.0
*/
public class SSMonitorMeteoTab extends TabItemComp implements IUpdateMonitorMeteo
{
public class SSMonitorMeteoTab extends TabItemComp implements
IUpdateMonitorMeteo {
private SSMonitorMeteoEditDlg monitorMeteoEditDlg;
private ArrayList<String> areaIDArray;
private ArrayList<SSMonitorMeteoData> ssDataArray;
public SSMonitorMeteoTab(TabFolder parent, DataUsageKey duKey)
{
public SSMonitorMeteoTab(TabFolder parent, DataUsageKey duKey) {
super(parent, duKey);
}
@Override
protected void createListHeader(Composite parentComp)
{
@Override
protected void createListHeader(Composite parentComp) {
Composite lblComp = new Composite(parentComp, SWT.NONE);
GridLayout gl = new GridLayout(5, false);
gl.horizontalSpacing = 0;
gl.horizontalSpacing = 0;
gl.marginHeight = 0;
gl.marginWidth = 0;
lblComp.setLayout(gl);
/*
* Create filler label.
*/
GridData gd = new GridData(75, SWT.DEFAULT);
Label fillerLbl = new Label(lblComp, SWT.CENTER);
fillerLbl.setLayoutData(gd);
/*
* Meteo
*/
Composite meteoComp = createGroupComposite(lblComp, 5, null);
createLabelComp(meteoComp, "Wind", "Speed(kt)", false);
createLabelComp(meteoComp, "Peak", "Wind(kt)", false);
Composite meteoComp = createGroupComposite(lblComp, 5, null);
createLabelComp(meteoComp, "Wind", "Speed(kt)", false);
createLabelComp(meteoComp, "Peak", "Wind(kt)", false);
createLabelComp(meteoComp, "Gust", "Speed(kt)", false);
createLabelComp(meteoComp, "Wave", "Height(ft)", false);
createLabelComp(meteoComp, "Vis(mi)", "", true);
}
}
@Override
protected void populateList()
{
if (ssDataArray == null)
{
protected void populateList() {
if (ssDataArray == null) {
createDataArray();
}
boolean update = false;
if (dataList.getItemCount() > 0)
{
if (dataList.getItemCount() > 0) {
update = true;
}
RangesUtil rangeUtil = RangesUtil.getInstance();
areaIDArray = new ArrayList<String>();
String tmpVisStr;
String currentAreaID;
double visVal = 0.0;
StringBuilder sb = null;
StringBuilder sb = null;
SSMonitorMeteoData ssmmd = null;
for (int i = 0; i < ssDataArray.size(); i++)
{
for (int i = 0; i < ssDataArray.size(); i++) {
sb = new StringBuilder();
ssmmd = ssDataArray.get(i);
currentAreaID = ssmmd.getAreaID();
areaIDArray.add(currentAreaID);
sb.append(String.format(areaIdFmt, currentAreaID));
/*
* Wind Speed
*/
appendIntData(sb, ssmmd.getWindSpeedR(), ssmmd.getWindSpeedY());
/*
* Peak Wind
*/
appendIntData(sb, ssmmd.getPeakWindR(), ssmmd.getPeakWindY());
/*
* Gust Wind
*/
appendIntData(sb, ssmmd.getGustSpeedR(), ssmmd.getGustSpeedY());
/*
* Wave Height
*/
appendIntData(sb, ssmmd.getWaveHgtR(), ssmmd.getWaveHgtY());
/*
* Visibility
*/
visVal = ssmmd.getVisR();
tmpVisStr = rangeUtil.getVisString((int)visVal);
*/
visVal = ssmmd.getVisR();
tmpVisStr = rangeUtil.getVisString((int) visVal);
sb.append(String.format(dataFmt, tmpVisStr));
visVal = ssmmd.getVisY();
tmpVisStr = rangeUtil.getVisString((int)visVal);
sb.append(String.format(dataFmt, tmpVisStr));
visVal = ssmmd.getVisY();
tmpVisStr = rangeUtil.getVisString((int) visVal);
sb.append(String.format(dataFmt, tmpVisStr));
/*
* Append a space and add the data line to the list.
*/
sb.append(" ");
if (update == true)
{
if (update == true) {
dataList.setItem(i, sb.toString());
}
else
{
} else {
dataList.add(sb.toString());
}
}
}
packListControls();
}
private void createDataArray()
{
ssDataArray = new ArrayList<SSMonitorMeteoData>();
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
ArrayList<AreaXML> areasArray = threshXML.getAreas();
for (AreaXML area : areasArray)
{
areaID = area.getAreaId();
SSMonitorMeteoData ssmmd = new SSMonitorMeteoData();
ssmmd.setAreaID(areaID);
/*
* Wind Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
ssmmd.setWindSpeedR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setWindSpeedY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Peak Wind
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
ssmmd.setPeakWindR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setPeakWindY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Gust Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
ssmmd.setGustSpeedR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setGustSpeedY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Wave Height
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
ssmmd.setWaveHgtR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setWaveHgtY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Visibility
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
ssmmd.setVisR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
ssmmd.setVisY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Add data to array.
*/
ssDataArray.add(ssmmd);
}
}
private SSMonitorMeteoData getDataAtFirstSelection()
{
int index = dataList.getSelectionIndex();
return ssDataArray.get(index);
}
private void updateDataArray(SSMonitorMeteoData ssmmd)
{
int[] dataListIndexes = dataList.getSelectionIndices();
int currentIndex = 0;
for (int i = 0; i < dataListIndexes.length; i++)
{
currentIndex = dataListIndexes[i];
ssDataArray.get(currentIndex).updateData(ssmmd);
}
}
@Override
public void commitDataToXML()
{
private void createDataArray() {
ssDataArray = new ArrayList<SSMonitorMeteoData>();
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
for (SSMonitorMeteoData ssmmd : ssDataArray)
{
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
ArrayList<AreaXML> areasArray = threshXML.getAreas();
if (areasArray != null) {
for (AreaXML area : areasArray) {
areaID = area.getAreaId();
SSMonitorMeteoData ssmmd = new SSMonitorMeteoData();
ssmmd.setAreaID(areaID);
/*
* Wind Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
ssmmd.setWindSpeedR(sstm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
ssmmd.setWindSpeedY(sstm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Peak Wind
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
ssmmd.setPeakWindR(sstm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
ssmmd.setPeakWindY(sstm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Gust Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
ssmmd.setGustSpeedR(sstm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
ssmmd.setGustSpeedY(sstm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Wave Height
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
ssmmd.setWaveHgtR(sstm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
ssmmd.setWaveHgtY(sstm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/*
* Visibility
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
ssmmd.setVisR(sstm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
ssmmd.setVisY(sstm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/*
* Add data to array.
*/
ssDataArray.add(ssmmd);
}
} else {
}
}
private SSMonitorMeteoData getDataAtFirstSelection() {
int index = dataList.getSelectionIndex();
return ssDataArray.get(index);
}
private void updateDataArray(SSMonitorMeteoData ssmmd) {
int[] dataListIndexes = dataList.getSelectionIndices();
int currentIndex = 0;
for (int i = 0; i < dataListIndexes.length; i++) {
currentIndex = dataListIndexes[i];
ssDataArray.get(currentIndex).updateData(ssmmd);
}
}
@Override
public void commitDataToXML() {
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
for (SSMonitorMeteoData ssmmd : ssDataArray) {
areaID = ssmmd.getAreaID();
/*
* Wind Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WIND_SPEED.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getWindSpeedR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getWindSpeedY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getWindSpeedR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getWindSpeedY());
/*
* Peak Wind
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_PEAK_WIND.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getPeakWindR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getPeakWindY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getPeakWindR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getPeakWindY());
/*
* Gust Speed
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_GUST_SPEED.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getGustSpeedR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getGustSpeedY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getGustSpeedR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getGustSpeedY());
/*
* Wave Height
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_WAVE_HT.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getWaveHgtR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getWaveHgtY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getWaveHgtR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getWaveHgtY());
/*
* Visibility
*/
xmlKey = SafeSeasMonitor.SS_MON_METEO_VIS.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, ssmmd.getVisR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, ssmmd.getVisY());
}
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
ssmmd.getVisR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
ssmmd.getVisY());
}
}
@Override
public void reloadData()
{
public void reloadData() {
dataList.removeAll();
ssDataArray.clear();
ssDataArray = null;
populateList();
populateList();
}
@Override
protected void editDataAction()
{
protected void editDataAction() {
SSMonitorMeteoData ssmmd = getDataAtFirstSelection();
if (monitorMeteoEditDlg == null)
{
monitorMeteoEditDlg = new SSMonitorMeteoEditDlg(getParent().getShell(), ssmmd, this);
if (monitorMeteoEditDlg == null) {
monitorMeteoEditDlg = new SSMonitorMeteoEditDlg(getParent()
.getShell(), ssmmd, this);
monitorMeteoEditDlg.open();
monitorMeteoEditDlg = null;
}
}
@Override
public void updateThresholdData(SSMonitorMeteoData ssmmd)
{
public void updateThresholdData(SSMonitorMeteoData ssmmd) {
updateDataArray(ssmmd);
populateList();
populateList();
}
}

View file

@ -36,312 +36,404 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
import com.raytheon.uf.viz.monitor.xml.AreaXML;
import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
public class SSMonitorSwellTab extends TabItemComp implements IUpdateDisplayMonitorSwell
{
/**
* SAFESEAS Monitor Swell Table.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
*
* </pre>
*
* @author
* @version 1.0
*/
public class SSMonitorSwellTab extends TabItemComp implements
IUpdateDisplayMonitorSwell {
private SSDispMonSwellEditDlg monitorSwellEditDlg;
private ArrayList<String> areaIDArray;
private ArrayList<SSDispMonSwellData> ssDataArray;
public SSMonitorSwellTab(TabFolder parent, DataUsageKey duKey)
{
public SSMonitorSwellTab(TabFolder parent, DataUsageKey duKey) {
super(parent, duKey, true);
}
@Override
protected void createListHeader(Composite parentComp)
{
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#createListHeader(org
* .eclipse.swt.widgets.Composite)
*/
@Override
protected void createListHeader(Composite parentComp) {
Composite lblComp = new Composite(parentComp, SWT.NONE);
GridLayout gl = new GridLayout(5, false);
gl.horizontalSpacing = 0;
gl.horizontalSpacing = 0;
gl.marginHeight = 0;
gl.marginWidth = 0;
lblComp.setLayout(gl);
/*
* Create filler label.
*/
GridData gd = new GridData(75, SWT.DEFAULT);
Label fillerLbl = new Label(lblComp, SWT.CENTER);
fillerLbl.setLayoutData(gd);
/*
* Primary Swell
*/
Composite priSwellComp = createGroupComposite(lblComp, 4, "Primary Swell");
Composite priSwellComp = createGroupComposite(lblComp, 4,
"Primary Swell");
createLabelComp(priSwellComp, "Height(ft)", "", false);
createLabelComp(priSwellComp, "Periods(s)", "", false);
createLabelComp(priSwellComp, "Dir(deg)", "(from)", false);
createLabelComp(priSwellComp, "Dir(deg)", "(to)", false);
createLabelComp(priSwellComp, "Dir(deg)", "(to)", false);
/*
* Secondary Swell
*/
Composite secSwellComp = createGroupComposite(lblComp, 4, "Secondary Swell");
Composite secSwellComp = createGroupComposite(lblComp, 4,
"Secondary Swell");
createLabelComp(secSwellComp, "Height(ft)", "", false);
createLabelComp(secSwellComp, "Periods(s)", "", false);
createLabelComp(secSwellComp, "Dir(deg)", "(from)", false);
createLabelComp(secSwellComp, "Dir(deg)", "(to)", false);
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#populateList()
*/
@Override
protected void populateList()
{
if (ssDataArray == null)
{
protected void populateList() {
if (ssDataArray == null) {
createDataArray();
}
boolean update = false;
if (dataList.getItemCount() > 0)
{
if (dataList.getItemCount() > 0) {
update = true;
}
areaIDArray = new ArrayList<String>();
String currentAreaID;
StringBuilder sb = null;
StringBuilder sb = null;
SSDispMonSwellData sssd = null;
for (int i = 0; i < ssDataArray.size(); i++)
{
for (int i = 0; i < ssDataArray.size(); i++) {
sb = new StringBuilder();
sssd = ssDataArray.get(i);
currentAreaID = sssd.getAreaID();
areaIDArray.add(currentAreaID);
sb.append(String.format(areaIdFmt, currentAreaID));
sb.append(String.format(areaIdFmt, currentAreaID));
/*
* Primary Swell
*/
appendIntData(sb, sssd.getPriSwellHeightR(), sssd.getPriSwellHeightY());
double higherThreshold = Math.max(sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
double lowerThreshold = Math.min(sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
if ( rankSwellPeriodHigh ) {
sssd.setRankSwellPeriodHigh(true);
sssd.setPriSwellPeriodR(higherThreshold);
sssd.setPriSwellPeriodY(lowerThreshold);
appendIntData(sb, sssd.getPriSwellHeightR(),
sssd.getPriSwellHeightY());
double higherThreshold = Math.max(sssd.getPriSwellPeriodR(),
sssd.getPriSwellPeriodY());
double lowerThreshold = Math.min(sssd.getPriSwellPeriodR(),
sssd.getPriSwellPeriodY());
if (rankSwellPeriodHigh) {
sssd.setRankSwellPeriodHigh(true);
sssd.setPriSwellPeriodR(higherThreshold);
sssd.setPriSwellPeriodY(lowerThreshold);
} else {
sssd.setRankSwellPeriodHigh(false);
sssd.setPriSwellPeriodR(lowerThreshold);
sssd.setPriSwellPeriodY(higherThreshold);
sssd.setRankSwellPeriodHigh(false);
sssd.setPriSwellPeriodR(lowerThreshold);
sssd.setPriSwellPeriodY(higherThreshold);
}
appendIntData(sb, sssd.getPriSwellPeriodR(), sssd.getPriSwellPeriodY());
appendIntData(sb, sssd.getPriSwellDirFromR(), sssd.getPriSwellDirFromY());
appendIntData(sb, sssd.getPriSwellDirToR(), sssd.getPriSwellDirToY());
appendIntData(sb, sssd.getPriSwellPeriodR(),
sssd.getPriSwellPeriodY());
appendIntData(sb, sssd.getPriSwellDirFromR(),
sssd.getPriSwellDirFromY());
appendIntData(sb, sssd.getPriSwellDirToR(),
sssd.getPriSwellDirToY());
/*
* Secondary Swell
*/
appendIntData(sb, sssd.getSecSwellHeightR(), sssd.getSecSwellHeightY());
higherThreshold = Math.max(sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
lowerThreshold = Math.min(sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
if ( rankSwellPeriodHigh ) {
//sssd.setRankSwellPeriodHigh(true);
sssd.setSecSwellPeriodR(higherThreshold);
sssd.setSecSwellPeriodY(lowerThreshold);
appendIntData(sb, sssd.getSecSwellHeightR(),
sssd.getSecSwellHeightY());
higherThreshold = Math.max(sssd.getSecSwellPeriodR(),
sssd.getSecSwellPeriodY());
lowerThreshold = Math.min(sssd.getSecSwellPeriodR(),
sssd.getSecSwellPeriodY());
if (rankSwellPeriodHigh) {
// sssd.setRankSwellPeriodHigh(true);
sssd.setSecSwellPeriodR(higherThreshold);
sssd.setSecSwellPeriodY(lowerThreshold);
} else {
//sssd.setRankSwellPeriodHigh(false);
sssd.setSecSwellPeriodR(lowerThreshold);
sssd.setSecSwellPeriodY(higherThreshold);
// sssd.setRankSwellPeriodHigh(false);
sssd.setSecSwellPeriodR(lowerThreshold);
sssd.setSecSwellPeriodY(higherThreshold);
}
appendIntData(sb, sssd.getSecSwellPeriodR(), sssd.getSecSwellPeriodY());
appendIntData(sb, sssd.getSecSwellDirFromR(), sssd.getSecSwellDirFromY());
appendIntData(sb, sssd.getSecSwellDirToR(), sssd.getSecSwellDirToY());
appendIntData(sb, sssd.getSecSwellPeriodR(),
sssd.getSecSwellPeriodY());
appendIntData(sb, sssd.getSecSwellDirFromR(),
sssd.getSecSwellDirFromY());
appendIntData(sb, sssd.getSecSwellDirToR(),
sssd.getSecSwellDirToY());
/*
* Append a space and add the data line to the list.
*/
sb.append(" ");
if (update == true)
{
if (update == true) {
dataList.setItem(i, sb.toString());
}
else
{
} else {
dataList.add(sb.toString());
}
}
}
packListControls();
}
private void createDataArray()
{
ssDataArray = new ArrayList<SSDispMonSwellData>();
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
ArrayList<AreaXML> areasArray = threshXML.getAreas();
for (AreaXML area : areasArray)
{
areaID = area.getAreaId();
SSDispMonSwellData sssd = new SSDispMonSwellData();
sssd.setAreaID(areaID);
/*
* Primary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
sssd.setPriSwellHeightR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setPriSwellHeightY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
sssd.setPriSwellPeriodR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setPriSwellPeriodY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
sssd.setPriSwellDirFromR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setPriSwellDirFromY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
sssd.setPriSwellDirToR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setPriSwellDirToY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Secondary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
sssd.setSecSwellHeightR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setSecSwellHeightY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
sssd.setSecSwellPeriodR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setSecSwellPeriodY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
sssd.setSecSwellDirFromR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setSecSwellDirFromY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
sssd.setSecSwellDirToR(sstm.getThresholdValue(duKey, threshKeyR, areaID, xmlKey));
sssd.setSecSwellDirToY(sstm.getThresholdValue(duKey, threshKeyY, areaID, xmlKey));
/*
* Add data to array.
*/
ssDataArray.add(sssd);
}
}
private SSDispMonSwellData getDataAtFirstSelection()
{
int index = dataList.getSelectionIndex();
return ssDataArray.get(index);
}
private void updateDataArray(SSDispMonSwellData sssd)
{
int[] dataListIndexes = dataList.getSelectionIndices();
int currentIndex = 0;
for (int i = 0; i < dataListIndexes.length; i++)
{
currentIndex = dataListIndexes[i];
ssDataArray.get(currentIndex).updateData(sssd);
}
}
@Override
public void commitDataToXML()
{
/**
* Create Data Array.
*/
private void createDataArray() {
ssDataArray = new ArrayList<SSDispMonSwellData>();
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
for (SSDispMonSwellData sssd : ssDataArray)
{
ThresholdsXML threshXML = sstm.getThresholdsXmlData(duKey);
ArrayList<AreaXML> areasArray = threshXML.getAreas();
if (areasArray != null) {
for (AreaXML area : areasArray) {
areaID = area.getAreaId();
SSDispMonSwellData sssd = new SSDispMonSwellData();
sssd.setAreaID(areaID);
/*
* Primary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
sssd.setPriSwellHeightR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setPriSwellHeightY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
sssd.setPriSwellPeriodR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setPriSwellPeriodY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
sssd.setPriSwellDirFromR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setPriSwellDirFromY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
sssd.setPriSwellDirToR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setPriSwellDirToY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
/*
* Secondary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
sssd.setSecSwellHeightR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setSecSwellHeightY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
sssd.setSecSwellPeriodR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setSecSwellPeriodY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
sssd.setSecSwellDirFromR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setSecSwellDirFromY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
sssd.setSecSwellDirToR(sstm.getThresholdValue(duKey,
threshKeyR, areaID, xmlKey));
sssd.setSecSwellDirToY(sstm.getThresholdValue(duKey,
threshKeyY, areaID, xmlKey));
/*
* Add data to array.
*/
ssDataArray.add(sssd);
}
}
}
/**
* Gets Data at first selection.
*
* @return
*/
private SSDispMonSwellData getDataAtFirstSelection() {
int index = dataList.getSelectionIndex();
return ssDataArray.get(index);
}
/**
* Update Data Array.
*
* @param sssd
*/
private void updateDataArray(SSDispMonSwellData sssd) {
int[] dataListIndexes = dataList.getSelectionIndices();
int currentIndex = 0;
for (int i = 0; i < dataListIndexes.length; i++) {
currentIndex = dataListIndexes[i];
ssDataArray.get(currentIndex).updateData(sssd);
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#commitDataToXML()
*/
@Override
public void commitDataToXML() {
SSThresholdMgr sstm = SSThresholdMgr.getInstance();
String xmlKey;
String areaID;
for (SSDispMonSwellData sssd : ssDataArray) {
areaID = sssd.getAreaID();
/*
* Primary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_HT.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellHeightR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellHeightY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getPriSwellHeightR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getPriSwellHeightY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_PD.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellPeriodR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellPeriodY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getPriSwellPeriodR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getPriSwellPeriodY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_FROM.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellDirFromR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellDirFromY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getPriSwellDirFromR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getPriSwellDirFromY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_PRIM_DIR_TO.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getPriSwellDirToR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getPriSwellDirToY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getPriSwellDirToR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getPriSwellDirToY());
/*
* Secondary Swell
*/
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_HT.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellHeightR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellHeightY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getSecSwellHeightR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getSecSwellHeightY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_PD.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellPeriodR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellPeriodY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getSecSwellPeriodR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getSecSwellPeriodY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_FROM.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellDirFromR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellDirFromY());
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getSecSwellDirFromR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getSecSwellDirFromY());
xmlKey = SafeSeasMonitor.SS_MON_SWELL_SEC_DIR_TO.getXmlKey();
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey, sssd.getSecSwellDirToR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey, sssd.getSecSwellDirToY());
}
sstm.setThresholdValue(duKey, threshKeyR, areaID, xmlKey,
sssd.getSecSwellDirToR());
sstm.setThresholdValue(duKey, threshKeyY, areaID, xmlKey,
sssd.getSecSwellDirToY());
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#reloadData()
*/
@Override
public void reloadData()
{
public void reloadData() {
dataList.removeAll();
ssDataArray.clear();
ssDataArray = null;
populateList();
populateList();
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.TabItemComp#editDataAction()
*/
@Override
protected void editDataAction()
{
protected void editDataAction() {
SSDispMonSwellData sssd = getDataAtFirstSelection();
if (monitorSwellEditDlg == null)
{
monitorSwellEditDlg = new SSDispMonSwellEditDlg(getParent().getShell(), sssd, this, false);
if (monitorSwellEditDlg == null) {
monitorSwellEditDlg = new SSDispMonSwellEditDlg(getParent()
.getShell(), sssd, this, false);
monitorSwellEditDlg.open();
monitorSwellEditDlg = null;
}
}
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.monitor.safeseas.ui.dialogs.IUpdateDisplayMonitorSwell
* #updateThresholdData(com.raytheon.uf.viz.monitor.safeseas.threshold.
* SSDispMonSwellData)
*/
@Override
public void updateThresholdData(SSDispMonSwellData sssd)
{
public void updateThresholdData(SSDispMonSwellData sssd) {
updateDataArray(sssd);
populateList();
populateList();
}
}

View file

@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
@ -49,6 +48,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 28, 2014 3086 skorolev Updated getConfigManager.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
*
*
* </pre>
@ -142,10 +142,7 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
@Override
public FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
}
return configMgr;
return FSSObsMonitorConfigurationManager.getSsObsManager();
}
/*

View file

@ -29,7 +29,6 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.dataplugin.fog.FogRecord.FOG_THREAT;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
@ -57,7 +56,8 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants;
* Nov 10, 2012 1297 skorolev Added initiateProdArray
* Dec 7, 2012 #1351 skorolev Changes for non-blocking dialogs.
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
*
* </pre>
*
@ -80,6 +80,7 @@ public class SSZoneTableDlg extends ZoneTableDlg {
*/
public SSZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
super(parent, obData, CommonConfig.AppName.SAFESEAS);
configMgr = FSSObsMonitorConfigurationManager.getSsObsManager();
}
/**
@ -319,18 +320,4 @@ public class SSZoneTableDlg extends ZoneTableDlg {
}
}
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null || configMgr.isPopulated()) {
configMgr = new FSSObsMonitorConfigurationManager(MonName.ss.name());
}
return configMgr;
}
}

View file

@ -31,7 +31,6 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.dataplugin.annotations.DataURI;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -74,6 +73,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Feb 15, 2013 1638 mschenke Changed code to reference DataURI.SEPARATOR instead of URIFilter
* Apr 28, 2014 3086 skorolev Removed local getMonitorAreaConfig method.
* Sep 04, 2014 3220 skorolev Updated configUpdate method and added updateMonitoringArea.
* Oct 16, 2014 3220 skorolev Corrected snowConfig assignment.
*
* </pre>
*
@ -128,7 +128,7 @@ public class SnowMonitor extends ObsMonitor implements ISnowResourceListener {
*/
private SnowMonitor() {
pluginPatterns.add(snowPattern);
snowConfig = new FSSObsMonitorConfigurationManager(MonName.snow.name());
snowConfig = FSSObsMonitorConfigurationManager.getSnowObsManager();
updateMonitoringArea();
initObserver(OBS, this);
obData = new ObMultiHrsReports(CommonConfig.AppName.SNOW);

View file

@ -22,7 +22,6 @@ package com.raytheon.uf.viz.monitor.snow.threshold;
import java.util.ArrayList;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
@ -42,6 +41,7 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowMonitor;
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
* May 21, 2014 3086 skorolev Cleaned code.
* Sep 04, 2014 3220 skorolev Removed "site".
* Oct 16, 2014 3220 skorolev Corrected areaConfigMgr assignment.
*
* </pre>
*
@ -58,9 +58,7 @@ public class SnowThresholdMgr extends AbstractThresholdMgr {
super("DefaultSnowDisplayThresholds.xml",
"DefaultSnowMonitorThresholds.xml", AppName.SNOW.name()
.toLowerCase());
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
areaConfigMgr = FSSObsMonitorConfigurationManager.getSnowObsManager();
init();
}
@ -114,19 +112,4 @@ public class SnowThresholdMgr extends AbstractThresholdMgr {
}
return threshKeys;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr#
* getMonitorAreaConfigInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (areaConfigMgr == null) {
areaConfigMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
}
return areaConfigMgr;
}
}

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 21, 2014 3086 skorolev Cleaned code.
* Oct 16, 2014 3220 skorolev Added condition to avoid NPE.
*
* </pre>
*
@ -213,84 +214,86 @@ public class SnowDisplayMeteoTab extends TabItemComp implements
List<AreaXML> areasArray = threshXML.getAreas();
for (AreaXML area : areasArray) {
areaID = area.getAreaId();
SnowDisplayMeteoData sdmd = new SnowDisplayMeteoData();
if (areasArray != null) {
for (AreaXML area : areasArray) {
areaID = area.getAreaId();
SnowDisplayMeteoData sdmd = new SnowDisplayMeteoData();
sdmd.setAreaID(areaID);
sdmd.setAreaID(areaID);
/* Tempature */
xmlKey = SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey();
sdmd.setTempR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setTempY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Tempature */
xmlKey = SnowDisplay.SNOW_DISP_METEO_TEMP.getXmlKey();
sdmd.setTempR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setTempY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Dew point */
xmlKey = SnowDisplay.SNOW_DISP_METEO_DEWPT.getXmlKey();
sdmd.setDewpointR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setDewpointY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Dew point */
xmlKey = SnowDisplay.SNOW_DISP_METEO_DEWPT.getXmlKey();
sdmd.setDewpointR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setDewpointY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Visibility */
xmlKey = SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey();
sdmd.setVisR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setVisY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Visibility */
xmlKey = SnowDisplay.SNOW_DISP_METEO_VIS.getXmlKey();
sdmd.setVisR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setVisY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* SLP */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SLP.getXmlKey();
sdmd.setSlpR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setSlpY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* SLP */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SLP.getXmlKey();
sdmd.setSlpR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setSlpY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Hourly Precipitation */
xmlKey = SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP.getXmlKey();
sdmd.setHrPrecipR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setHrPrecipY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Hourly Precipitation */
xmlKey = SnowDisplay.SNOW_DISP_METEO_HOURLY_PRECIP.getXmlKey();
sdmd.setHrPrecipR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setHrPrecipY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Wind Chill */
xmlKey = SnowDisplay.SNOW_DISP_METEO_WIND_CHILL.getXmlKey();
sdmd.setWindChillR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setWindChillY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Wind Chill */
xmlKey = SnowDisplay.SNOW_DISP_METEO_WIND_CHILL.getXmlKey();
sdmd.setWindChillR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setWindChillY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Frost Bite */
xmlKey = SnowDisplay.SNOW_DISP_METEO_FROSTBITE.getXmlKey();
sdmd.setFrostBiteR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setFrostBiteY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Frost Bite */
xmlKey = SnowDisplay.SNOW_DISP_METEO_FROSTBITE.getXmlKey();
sdmd.setFrostBiteR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setFrostBiteY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Snow Depth */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH.getXmlKey();
sdmd.setSnowDepthR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setSnowDepthY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* Snow Depth */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNOW_DEPTH.getXmlKey();
sdmd.setSnowDepthR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setSnowDepthY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* SNINCR Hourly */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_HOURLY.getXmlKey();
sdmd.setSnincrHrlyR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setSnincrHrlyY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* SNINCR Hourly */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_HOURLY.getXmlKey();
sdmd.setSnincrHrlyR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setSnincrHrlyY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* SNINCR Total */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_TOTAL.getXmlKey();
sdmd.setSnincrTotR(stm.getThresholdValue(duKey, threshKeyR, areaID,
xmlKey));
sdmd.setSnincrTotY(stm.getThresholdValue(duKey, threshKeyY, areaID,
xmlKey));
/* SNINCR Total */
xmlKey = SnowDisplay.SNOW_DISP_METEO_SNINCR_TOTAL.getXmlKey();
sdmd.setSnincrTotR(stm.getThresholdValue(duKey, threshKeyR,
areaID, xmlKey));
sdmd.setSnincrTotY(stm.getThresholdValue(duKey, threshKeyY,
areaID, xmlKey));
/* Add data to array. */
snowDataArray.add(sdmd);
/* Add data to array. */
snowDataArray.add(sdmd);
}
}
}

View file

@ -24,7 +24,6 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.CommonConfig.AppName;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
@ -49,6 +48,8 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* Apr 28, 2014 3086 skorolev Updated snowConfigManager.
* Sep 04, 2014 3220 skorolev Added fireConfigUpdateEvent method. Updated handler.
* Sep 19, 2014 2757 skorolev Updated handlers for dialog buttons.
* Oct 16, 2014 3220 skorolev Corrected getInstance() method.
*
* </pre>
*
* @author mpduff
@ -134,11 +135,7 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
*/
@Override
protected FSSObsMonitorConfigurationManager getInstance() {
if (configMgr == null) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
}
return configMgr;
return FSSObsMonitorConfigurationManager.getSnowObsManager();
}
/*

View file

@ -26,7 +26,6 @@ import java.util.List;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.data.CommonConfig;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.monitor.data.ObConst.DisplayVarName;
@ -55,6 +54,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg;
* Dec 7, 2012 1351 skorolev Changes for non-blocking dialogs
* Apr 28, 2014 3086 skorolev Updated getConfigMgr method.
* Sep 04, 2014 3220 skorolev Removed "site". Added check on dispose.
* Oct 16, 2014 3220 skorolev Corrected configMgr assignment.
*
* </pre>
*
@ -75,6 +75,7 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
*/
public SnowZoneTableDlg(Shell parent, ObMultiHrsReports obData) {
super(parent, obData, CommonConfig.AppName.SNOW);
configMgr = FSSObsMonitorConfigurationManager.getSnowObsManager();
}
/**
@ -256,18 +257,4 @@ public class SnowZoneTableDlg extends ZoneTableDlg {
protected void shellDisposeAction() {
// Not used
}
/*
* (non-Javadoc)
*
* @see com.raytheon.uf.viz.monitor.ui.dialogs.ZoneTableDlg#getInstance()
*/
@Override
protected FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance() {
if (configMgr == null || configMgr.isPopulated()) {
configMgr = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
}
return configMgr;
}
}

View file

@ -33,6 +33,9 @@ import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.data.ObConst;
import com.raytheon.uf.common.monitor.data.ObConst.DataUsageKey;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.monitor.config.CommonTableConfig.CellType;
import com.raytheon.uf.viz.monitor.filename.DefaultFilenameMgr;
@ -53,6 +56,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* Mar 22, 2010 #4282 zhao obtain zone IDs from monitoring-area-config-manager
* Feb 16, 2011 #7346 zhao added getDirectionalThresholdValueCellType(...)
* Apr 28, 2014 3086 skorolev Updated getAreaConfigMgr method.
* Oct 17, 2014 3220 skorolev Replaced System.out.print with debug statusHandler.
*
* </pre>
*
@ -61,6 +65,9 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
*/
public abstract class AbstractThresholdMgr {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(AbstractThresholdMgr.class);
/**
* Monitor Area Configuration Manager.
*/
@ -134,7 +141,6 @@ public abstract class AbstractThresholdMgr {
this.defMonitorThreshName = defMonitorThreshName;
this.appName = appName;
this.site = LocalizationManager.getInstance().getCurrentSite();
this.areaConfigMgr = getMonitorAreaConfigInstance();
}
/**
@ -201,7 +207,7 @@ public abstract class AbstractThresholdMgr {
LocalizationFile locFile = pm.getLocalizationFile(context,
pathAndFileName);
System.out.println("--- validate path = "
statusHandler.handle(Priority.DEBUG, "--- validate path = "
+ locFile.getFile().getAbsolutePath());
return locFile.getFile().exists();
@ -526,7 +532,8 @@ public abstract class AbstractThresholdMgr {
ArrayList<String> threshKeys = getThresholdKeys(DataUsageKey.DISPLAY);
System.out.println("---- " + currFullDisplayXmlFileName);
statusHandler.handle(Priority.DEBUG, "---- "
+ currFullDisplayXmlFileName);
displayThreshMgr.createConfigFromDefaults(
currFullDisplayXmlFileName, areaIDs, threshKeys);
@ -764,14 +771,17 @@ public abstract class AbstractThresholdMgr {
ArrayList<AreaXML> areasArray = displayXML.getAreas();
for (AreaXML area : areasArray) {
System.out.println("--- " + area.getAreaId());
statusHandler.handle(Priority.DEBUG, "--- " + area.getAreaId());
ArrayList<AreaThresholdXML> atXmlArray = area.getAreaThresholds();
for (AreaThresholdXML atXml : atXmlArray) {
System.out.println("****** " + atXml.getKey());
System.out.println(" R " + atXml.getRed());
System.out.println(" Y " + atXml.getYellow());
statusHandler.handle(Priority.DEBUG,
"****** " + atXml.getKey());
statusHandler.handle(Priority.DEBUG,
" R " + atXml.getRed());
statusHandler.handle(Priority.DEBUG,
" Y " + atXml.getYellow());
}
}
}
@ -784,23 +794,18 @@ public abstract class AbstractThresholdMgr {
ArrayList<AreaXML> areasArray = threshXmlCopy.getAreas();
for (AreaXML area : areasArray) {
System.out.println("--- " + area.getAreaId());
statusHandler.handle(Priority.DEBUG, "--- " + area.getAreaId());
ArrayList<AreaThresholdXML> atXmlArray = area.getAreaThresholds();
for (AreaThresholdXML atXml : atXmlArray) {
System.out.println("****** " + atXml.getKey());
System.out.println(" R " + atXml.getRed());
System.out.println(" Y " + atXml.getYellow());
statusHandler.handle(Priority.DEBUG,
"****** " + atXml.getKey());
statusHandler.handle(Priority.DEBUG,
" R " + atXml.getRed());
statusHandler.handle(Priority.DEBUG,
" Y " + atXml.getYellow());
}
}
}
/**
* Gets Monitor Area Configuration manager.
*
* @return manager
*/
protected abstract FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance();
}

View file

@ -50,6 +50,7 @@ import com.raytheon.uf.viz.monitor.xml.ThresholdsXML;
* ------------ ---------- ----------- --------------------------
* Dec 15, 2009 #3963 lvenable Initial creation
* Dec 4, 2012 #1351 skorolev Cleaned code
* Oct 16, 2014 #3220 skorolev Added error message when Default threshold configuration file is corrupted or empty.
*
* </pre>
*
@ -145,7 +146,11 @@ public class ThresholdMgr {
ThresholdsXML.class);
createXmlFromDefaults(cfgXmlDefaults, areaIDs, keys);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR, e.getMessage());
statusHandler
.handle(Priority.ERROR,
"Default threshold configuration file "
+ fullDefaultPathName
+ " is corrupted.\nDelete the files in the folder on the server side and restart CAVE.");
return false;
}
return true;

View file

@ -89,6 +89,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* May 13, 2014 3133 njensen Updated getting ObsHistType from configMgr
* May 15, 2014 3086 skorolev Replaced MonitorConfigurationManager with FSSObsMonitorConfigurationManager.
* Sep 15, 2014 3220 skorolev Added refreshZoneTableData method.
* Oct 17, 2014 3220 skorolev Added condition into launchTrendPlot to avoid NPE.
*
* </pre>
*
@ -736,10 +737,14 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
}
// Set dialog index
String dialogID = appName.name() + station;
String strHistType = getMonitorAreaConfigInstance().getStationType(
selectedZone, station);
ObsHistType histType = ObsHistType.valueOf(strHistType);
ObsHistType histType = null;
if (configMgr != null) {
String strHistType = configMgr
.getStationType(selectedZone, station);
histType = ObsHistType.valueOf(strHistType);
}
if (histType == null)
return;
/**
* For Snow monitor, no history table is displayed for a Maritime
* station
@ -953,13 +958,6 @@ public abstract class ZoneTableDlg extends CaveSWTDialog implements
return varName;
}
/**
* Gets Configuration manager.
*
* @return manager
*/
protected abstract FSSObsMonitorConfigurationManager getMonitorAreaConfigInstance();
/**
* Refreshes Zone Table.
*

View file

@ -127,15 +127,21 @@ public class FSSObsMonitorConfigurationManager implements
ss, fog, snow
};
/** Instance of SAFESEAS monitor configuration manager. */
private static FSSObsMonitorConfigurationManager ssInstance = new FSSObsMonitorConfigurationManager(
MonName.ss.name());
/** Instance of Fog monitor configuration manager. */
private static FSSObsMonitorConfigurationManager fogInstance = new FSSObsMonitorConfigurationManager(
MonName.fog.name());
/** Instance of SNOW monitor configuration manager. */
private static FSSObsMonitorConfigurationManager snowInstance = new FSSObsMonitorConfigurationManager(
MonName.snow.name());
/** Localization Area Configuration File. */
private LocalizationFile lacf = null;
/** Configuration XML is updated and saved */
protected boolean isPopulated;
/** Singleton instance of this class */
private static FSSObsMonitorConfigurationManager instance = null;
/**
* Private Constructor
*
@ -143,7 +149,6 @@ public class FSSObsMonitorConfigurationManager implements
*/
public FSSObsMonitorConfigurationManager(String monitorName) {
setMonitorName(monitorName);
setPopulated(false);
// Avoid confusion in file path
if (monitorName == MonName.ss.name()) {
pluginName = "safeseas";
@ -163,21 +168,6 @@ public class FSSObsMonitorConfigurationManager implements
readConfigXml();
}
/**
* Get an instance of Configuration manager for FSSObs monitors.
*
* @param monitor
* Name of monitor
* @return Instance of manager
*/
public static synchronized FSSObsMonitorConfigurationManager getInstance(
String monitor) {
if (instance == null) {
instance = new FSSObsMonitorConfigurationManager(monitor);
}
return instance;
}
/**
* Reads the XML configuration data for the current XML file name. filename:
* monitor area config file name adjAreaFileName: adjacent areas config file
@ -193,11 +183,11 @@ public class FSSObsMonitorConfigurationManager implements
LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
this.currentSite = lc.getContextName();
lacf = pm.getLocalizationFile(lc, configFileName);
lacf.addFileUpdatedObserver(this);
String monitorAreaFilePath = lacf.getFile().getAbsolutePath();
MonAreaConfigXML configXmltmp = jaxb
.unmarshalFromXmlFile(monitorAreaFilePath.toString());
configXml = configXmltmp;
setPopulated(true);
} catch (Exception e) {
statusHandler
.handle(Priority.WARN,
@ -327,7 +317,6 @@ public class FSSObsMonitorConfigurationManager implements
newXmlFile.save();
lacf = newXmlFile;
lacf.addFileUpdatedObserver(this);
setPopulated(true);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR, e.getMessage());
}
@ -953,24 +942,6 @@ public class FSSObsMonitorConfigurationManager implements
FSSObsMonitorConfigurationManager.monitorName = monitorName;
}
/**
* Flag is true if config file updated and saved.
*
* @return
*/
public boolean isPopulated() {
return isPopulated;
}
/**
* Sets flag indicating that config file has been updated and saved.
*
* @param isPopulated
*/
public void setPopulated(boolean isPopulated) {
this.isPopulated = isPopulated;
}
/**
* Remove Adjacent Area.
*
@ -1009,4 +980,34 @@ public class FSSObsMonitorConfigurationManager implements
adjAreaConfigXml.addAreaId(area);
}
}
/**
* Get Fog monitor area configuration manager.
*
* @return
*/
public static FSSObsMonitorConfigurationManager getFogObsManager() {
fogInstance.readConfigXml();
return fogInstance;
}
/**
* Get SAFESEAS monitor area configuration manager.
*
* @return
*/
public static FSSObsMonitorConfigurationManager getSsObsManager() {
ssInstance.readConfigXml();
return ssInstance;
}
/**
* Get SNOW monitor area configuration manager.
*
* @return
*/
public static FSSObsMonitorConfigurationManager getSnowObsManager() {
snowInstance.readConfigXml();
return snowInstance;
}
}

View file

@ -43,7 +43,6 @@ import com.raytheon.uf.common.monitor.config.FFMPRunConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager;
import com.raytheon.uf.common.monitor.config.FFMPSourceConfigurationManager.DATA_TYPE;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.config.SCANRunSiteConfigurationManager;
import com.raytheon.uf.common.monitor.xml.FFMPRunXML;
import com.raytheon.uf.common.monitor.xml.ProductRunXML;
@ -479,30 +478,29 @@ public class DatMenuUtil extends AbstractMenuUtil {
}
/**
* Creates Safeseas Menu.
* Creates SAFESEAS Menu.
*/
private void createSafeseasMenu() {
FSSObsMonitorConfigurationManager ssConfig = FSSObsMonitorConfigurationManager
.getInstance(MonName.ss.name());
Set<String> ssStns = ssConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : ssStns) {
if (stations.length() > 0) {
stations.append(",");
}
stations.append(s);
.getSsObsManager();
Set<String> ssStns = ssConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : ssStns) {
if (stations.length() > 0) {
stations.append(",");
}
String ssStations = stations.toString();
CommonMenuContributionFile safeMenuContributionFile = new CommonMenuContributionFile();
safeMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
safeMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
safeMenuContributionFile.contribution[0] = processOtherContribution(
ssStations, "menus/safeseas/baseSafeSeas.xml",
"menu:obs?before=EndOfMaritime", "SAFESEAS",
safeMenuContributionFile.contribution[0]);
toXml(safeMenuContributionFile, "menus" + File.separator
+ "safeseas" + File.separator + "index.xml");
ssConfig = null;
stations.append(s);
}
String ssStations = stations.toString();
CommonMenuContributionFile safeMenuContributionFile = new CommonMenuContributionFile();
safeMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
safeMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
safeMenuContributionFile.contribution[0] = processOtherContribution(
ssStations, "menus/safeseas/baseSafeSeas.xml",
"menu:obs?before=EndOfMaritime", "SAFESEAS",
safeMenuContributionFile.contribution[0]);
toXml(safeMenuContributionFile, "menus" + File.separator + "safeseas"
+ File.separator + "index.xml");
}
/**
@ -510,53 +508,51 @@ public class DatMenuUtil extends AbstractMenuUtil {
*/
private void createFogMenu() {
FSSObsMonitorConfigurationManager fogConfig = FSSObsMonitorConfigurationManager
.getInstance(MonName.fog.name());
Set<String> fogStns = fogConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : fogStns) {
if (stations.length() > 0) {
stations.append(",");
}
stations.append(s);
.getFogObsManager();
Set<String> fogStns = fogConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : fogStns) {
if (stations.length() > 0) {
stations.append(",");
}
String fogStations = stations.toString();
CommonMenuContributionFile fogMenuContributionFile = new CommonMenuContributionFile();
fogMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
fogMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
fogMenuContributionFile.contribution[0] = processOtherContribution(
fogStations, "menus/fog/baseFog.xml",
"menu:obs?after=FOGPLACEHOLDER", "Fog Monitor",
fogMenuContributionFile.contribution[0]);
toXml(fogMenuContributionFile, "menus" + File.separator + "fog"
+ File.separator + "index.xml");
fogConfig = null;
stations.append(s);
}
String fogStations = stations.toString();
CommonMenuContributionFile fogMenuContributionFile = new CommonMenuContributionFile();
fogMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
fogMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
fogMenuContributionFile.contribution[0] = processOtherContribution(
fogStations, "menus/fog/baseFog.xml",
"menu:obs?after=FOGPLACEHOLDER", "Fog Monitor",
fogMenuContributionFile.contribution[0]);
toXml(fogMenuContributionFile, "menus" + File.separator + "fog"
+ File.separator + "index.xml");
}
/**
* Creates Snow Menu.
* Creates SNOW Menu.
*/
private void createSnowMenu() {
FSSObsMonitorConfigurationManager snowConfig = FSSObsMonitorConfigurationManager
.getInstance(MonName.snow.name());
Set<String> snowStns = snowConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : snowStns) {
if (stations.length() > 0) {
stations.append(",");
}
stations.append(s);
.getSnowObsManager();
Set<String> snowStns = snowConfig.getStationIDs();
StringBuilder stations = new StringBuilder();
for (String s : snowStns) {
if (stations.length() > 0) {
stations.append(",");
}
String snowStations = stations.toString();
CommonMenuContributionFile snowMenuContributionFile = new CommonMenuContributionFile();
snowMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
snowMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
snowMenuContributionFile.contribution[0] = processOtherContribution(
snowStations, "menus/snow/baseSnow.xml",
"menu:obs?after=SNOWPLACEHOLDER", "SNOW",
snowMenuContributionFile.contribution[0]);
toXml(snowMenuContributionFile, "menus" + File.separator + "snow"
+ File.separator + "index.xml");
snowConfig = null;
stations.append(s);
}
String snowStations = stations.toString();
CommonMenuContributionFile snowMenuContributionFile = new CommonMenuContributionFile();
snowMenuContributionFile.contribution = new CommonIncludeMenuItem[1];
snowMenuContributionFile.contribution[0] = new CommonIncludeMenuItem();
snowMenuContributionFile.contribution[0] = processOtherContribution(
snowStations, "menus/snow/baseSnow.xml",
"menu:obs?after=SNOWPLACEHOLDER", "SNOW",
snowMenuContributionFile.contribution[0]);
toXml(snowMenuContributionFile, "menus" + File.separator + "snow"
+ File.separator + "index.xml");
}
/**

View file

@ -21,13 +21,14 @@
package com.raytheon.uf.edex.plugin.fssobs;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.raytheon.edex.site.SiteUtil;
import com.raytheon.edex.urifilter.URIFilter;
import com.raytheon.edex.urifilter.URIGenerateMessage;
import com.raytheon.uf.common.dataplugin.fssobs.FSSObsRecord;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.common.monitor.events.MonitorConfigEvent;
import com.raytheon.uf.common.monitor.events.MonitorConfigListener;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -69,10 +70,17 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
/** Product */
private static final String productType = "fssobs";
/** Sets of all stations to filter for */
private HashSet<String> allStations = null;
/** All stations to be filtered. */
private Set<String> allStations = null;
private FSSObsMonitorConfigurationManager currManager = null;
/** Fog monitor area configuration file */
public FSSObsMonitorConfigurationManager fogAreaConfig = null;
/** SAFESEAS monitor area configuration file */
public FSSObsMonitorConfigurationManager ssAreaConfig = null;
/** SNOW monitor area configuration file */
public FSSObsMonitorConfigurationManager snowAreaConfig = null;
/**
* Public construction
@ -140,12 +148,14 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
+ " process Filter Config...");
allStations = new HashSet<String>();
for (MonName mname : MonName.values()) {
currManager = new FSSObsMonitorConfigurationManager(mname.name());
currManager.addListener(this);
allStations.addAll(currManager.getStations());
currManager = null;
}
List<String> ssStations = getSSAreaConfig().getStations();
allStations.addAll(ssStations);
List<String> fogStations = getFogAreaConfig().getStations();
allStations.addAll(fogStations);
List<String> snowStations = getSnowAreaConfig().getStations();
allStations.addAll(snowStations);
}
/**
@ -187,4 +197,45 @@ public class FSSObsGenerator extends CompositeProductGenerator implements
dmu.createMenus();
}
}
/**
* Gets Fog monitor area configuration file.
*
* @return
*/
public FSSObsMonitorConfigurationManager getFogAreaConfig() {
if (fogAreaConfig == null) {
fogAreaConfig = FSSObsMonitorConfigurationManager
.getFogObsManager();
fogAreaConfig.addListener(this);
}
return fogAreaConfig;
}
/**
* Gets SAFESEAS monitor area configuration file.
*
* @return
*/
public FSSObsMonitorConfigurationManager getSSAreaConfig() {
if (ssAreaConfig == null) {
ssAreaConfig = FSSObsMonitorConfigurationManager.getSsObsManager();
ssAreaConfig.addListener(this);
}
return ssAreaConfig;
}
/**
* Gets SNOW monitor area configuration file.
*
* @return
*/
public FSSObsMonitorConfigurationManager getSnowAreaConfig() {
if (snowAreaConfig == null) {
snowAreaConfig = FSSObsMonitorConfigurationManager
.getSnowObsManager();
snowAreaConfig.addListener(this);
}
return snowAreaConfig;
}
}

View file

@ -3,7 +3,7 @@ package com.raytheon.uf.edex.plugin.fssobs;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.TimeZone;
import java.util.regex.Pattern;
@ -23,6 +23,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Dec 5, 2012 #1351 skorolev Cleaned code
* Feb 15, 2013 1638 mschenke Moved DataURINotificationMessage to uf.common.dataplugin
* Sep 04, 2014 3220 skorolev Removed CWA from filter.
* Oct 17, 2014 3220 skorolev Replaced HashSet with Set.
*
* </pre>
*
@ -53,7 +54,7 @@ public class FSSObsURIFilter extends URIFilter {
private String dataType;
/** All filtered stations */
private HashSet<String> stations = null;
private Set<String> stations = null;
/** Date format **/
private static String datePattern = "yyyy-MM-dd_HH:mm:ss.S";
@ -72,7 +73,7 @@ public class FSSObsURIFilter extends URIFilter {
* @param stations
* for FSSObs filter
*/
public FSSObsURIFilter(String name, HashSet<String> stations) {
public FSSObsURIFilter(String name, Set<String> stations) {
super(name);
logger.info("FSSObsFilter " + name + " Filter construction...");
setDataTypes(new String[] { "obs", "sfcobs", "ldadmesonet" });

View file

@ -29,7 +29,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager;
import com.raytheon.uf.common.monitor.config.FSSObsMonitorConfigurationManager.MonName;
import com.raytheon.uf.edex.ndm.ingest.IDataSetIngester;
import com.raytheon.uf.edex.ndm.ingest.INationalDatasetSubscriber;
import com.raytheon.uf.edex.plugin.loctables.util.CommonObsSpatialBuilder;
@ -56,6 +55,7 @@ import com.raytheon.uf.edex.plugin.loctables.util.store.ObStationStoreStrategy;
* Mar 06, 2014 2876 mpduff New NDM plugin.
* Apr 28, 2014 3086 skorolev Updated setupLocalFiles method
* Sep 04, 2014 3220 skorolev Removed parameter currentSite from FSSObs configuration managers.
* Oct 17, 2014 3220 skorolev Corrected FSSObsMonitorConfigurationManager instances.
*
* </pre>
*
@ -128,12 +128,9 @@ public class LocationTablesIngest implements INationalDatasetSubscriber {
private void setupLocalFiles() {
List<FSSObsMonitorConfigurationManager> monitors = new ArrayList<FSSObsMonitorConfigurationManager>();
monitors.add(FSSObsMonitorConfigurationManager.getInstance(MonName.fog
.name()));
monitors.add(FSSObsMonitorConfigurationManager.getInstance(MonName.ss
.name()));
monitors.add(FSSObsMonitorConfigurationManager.getInstance(MonName.snow
.name()));
monitors.add(FSSObsMonitorConfigurationManager.getSsObsManager());
monitors.add(FSSObsMonitorConfigurationManager.getFogObsManager());
monitors.add(FSSObsMonitorConfigurationManager.getSnowObsManager());
}
/**