Issue #2757. Fixed issues in Area Configuration Dialogs.
Change-Id: Ic3d3d5c41df6c8d80aac8e434e4c42a5ef9d1ecf Former-commit-id:b0ce18a8bf
[formerly7b3702c186
] [formerly6013121a99
] [formerly6013121a99
[formerlyea573d2c30
]] [formerlya768f540f0
[formerly6013121a99
[formerlyea573d2c30
] [formerlya768f540f0
[formerly 81826338bda946aff4ac8a7b9ea83c2eb72397d5]]]] Former-commit-id:a768f540f0
Former-commit-id: 6483fb5be1915744c3badb428f9abfd2df744293 [formerly a981a42007f76a4e25e017ce265ad6fb22a436d4] [formerlyd2d4672a46
[formerly6d9a066c36
]] Former-commit-id:d2d4672a46
Former-commit-id:f6ea436e80
This commit is contained in:
parent
05806b864a
commit
e45691b6d5
7 changed files with 408 additions and 354 deletions
|
@ -39,14 +39,14 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.FogMonitor;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 15, 2009 #3963 lvenable Initial creation
|
* Dec 15, 2009 #3963 lvenable Initial creation
|
||||||
|
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class FogThresholdMgr extends AbstractThresholdMgr
|
public class FogThresholdMgr extends AbstractThresholdMgr {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Class instance.
|
* Class instance.
|
||||||
*/
|
*/
|
||||||
|
@ -55,24 +55,21 @@ public class FogThresholdMgr extends AbstractThresholdMgr
|
||||||
/**
|
/**
|
||||||
* Private constructor.
|
* Private constructor.
|
||||||
*/
|
*/
|
||||||
private FogThresholdMgr()
|
private FogThresholdMgr() {
|
||||||
{
|
|
||||||
super("DefaultFogDisplayThresholds.xml",
|
super("DefaultFogDisplayThresholds.xml",
|
||||||
"DefaultFogMonitorThresholds.xml",
|
"DefaultFogMonitorThresholds.xml", "fog");
|
||||||
"fog");
|
|
||||||
|
|
||||||
areaConfigMgr = getAreaConfigMgr();
|
areaConfigMgr = getAreaConfigMgr();
|
||||||
init(); // call init() after areaConfigMgr is set
|
init(); // call init() after areaConfigMgr is set
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an instance of the manager class.
|
* Get an instance of the manager class.
|
||||||
|
*
|
||||||
* @return Class instance.
|
* @return Class instance.
|
||||||
*/
|
*/
|
||||||
public static FogThresholdMgr getInstance()
|
public static FogThresholdMgr getInstance() {
|
||||||
{
|
if (classInstance == null) {
|
||||||
if (classInstance == null)
|
|
||||||
{
|
|
||||||
classInstance = new FogThresholdMgr();
|
classInstance = new FogThresholdMgr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,34 +77,29 @@ public class FogThresholdMgr extends AbstractThresholdMgr
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DR#11279:
|
* DR#11279: When monitor area configuration is changed, threshold manager
|
||||||
* When monitor area configuration is changed,
|
* needs to be re-initialized using the new monitor area configuration
|
||||||
* threshold manager needs to be re-initialized
|
|
||||||
* using the new monitor area configuration
|
|
||||||
*/
|
*/
|
||||||
public static void reInitialize() {
|
public static void reInitialize() {
|
||||||
if ( classInstance != null ) {
|
if (classInstance != null) {
|
||||||
classInstance = null;
|
classInstance = null;
|
||||||
classInstance = new FogThresholdMgr();
|
}
|
||||||
}
|
classInstance = new FogThresholdMgr();
|
||||||
|
// Update threshold file.
|
||||||
|
classInstance.loadDefaultMonitorThreshold();
|
||||||
|
classInstance.saveMonitorThresholds();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ArrayList<String> getThresholdKeys(DataUsageKey dataUsage)
|
protected ArrayList<String> getThresholdKeys(DataUsageKey dataUsage) {
|
||||||
{
|
|
||||||
ArrayList<String> threshKeys = new ArrayList<String>();
|
ArrayList<String> threshKeys = new ArrayList<String>();
|
||||||
|
|
||||||
if (dataUsage == DataUsageKey.DISPLAY)
|
if (dataUsage == DataUsageKey.DISPLAY) {
|
||||||
{
|
for (FogDisplay fogDisp : FogDisplay.values()) {
|
||||||
for (FogDisplay fogDisp : FogDisplay.values())
|
|
||||||
{
|
|
||||||
threshKeys.add(fogDisp.getXmlKey());
|
threshKeys.add(fogDisp.getXmlKey());
|
||||||
}
|
}
|
||||||
}
|
} else if (dataUsage == DataUsageKey.MONITOR) {
|
||||||
else if (dataUsage == DataUsageKey.MONITOR)
|
for (FogMonitor fogMon : FogMonitor.values()) {
|
||||||
{
|
|
||||||
for (FogMonitor fogMon : FogMonitor.values())
|
|
||||||
{
|
|
||||||
threshKeys.add(fogMon.getXmlKey());
|
threshKeys.add(fogMon.getXmlKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,8 +107,8 @@ public class FogThresholdMgr extends AbstractThresholdMgr
|
||||||
return threshKeys;
|
return threshKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MonitorConfigurationManager getAreaConfigMgr() {
|
public MonitorConfigurationManager getAreaConfigMgr() {
|
||||||
if (areaConfigMgr == null) {
|
if (areaConfigMgr == null) {
|
||||||
LocalizationManager mgr = LocalizationManager.getInstance();
|
LocalizationManager mgr = LocalizationManager.getInstance();
|
||||||
String siteScope = mgr.getCurrentSite();
|
String siteScope = mgr.getCurrentSite();
|
||||||
|
@ -125,5 +117,5 @@ public class FogThresholdMgr extends AbstractThresholdMgr
|
||||||
areaConfigMgr.readConfigXml(siteScope);
|
areaConfigMgr.readConfigXml(siteScope);
|
||||||
}
|
}
|
||||||
return areaConfigMgr;
|
return areaConfigMgr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 5, 2010 mpduff Initial creation
|
* Jan 5, 2010 mpduff Initial creation
|
||||||
* Nov 27, 2012 1351 skorolev Changes for non-blocking dialog.
|
* Nov 27, 2012 1351 skorolev Changes for non-blocking dialog.
|
||||||
|
* Jan 29, 2014 2757 skorolev Changed OK button handler.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -53,6 +54,9 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
readConfigData();
|
readConfigData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private FogMonitorConfigurationManager configManager = FogMonitorConfigurationManager
|
||||||
|
.getInstance();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -61,19 +65,23 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void handleOkBtnSelection() {
|
protected void handleOkBtnSelection() {
|
||||||
FogMonitorConfigurationManager configManager = FogMonitorConfigurationManager
|
|
||||||
.getInstance();
|
|
||||||
// Check for changes in the data
|
// Check for changes in the data
|
||||||
if (!configManager.getAddedZones().isEmpty()
|
if (!configManager.getAddedZones().isEmpty()
|
||||||
|| !configManager.getAddedZones().isEmpty()) {
|
|| !configManager.getAddedStations().isEmpty()
|
||||||
|
|| this.timeWindowChanged || this.shipDistanceChanged
|
||||||
|
|| this.fogChkChanged || this.maZonesRemoved) {
|
||||||
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
|
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
|
||||||
"Fog Monitor Confirm Changes",
|
"Fog Monitor Confirm Changes",
|
||||||
"Want to Update Fog Monitor's Setup files?");
|
"Want to Update Fog Monitor's Setup files?");
|
||||||
if (choice == SWT.OK) {
|
if (choice == SWT.OK) {
|
||||||
// Save the config xml file
|
// Save the config xml file
|
||||||
configManager.setShipDistance(distanceScale.getSelection());
|
configManager.setTimeWindow(timeWindow.getSelection());
|
||||||
configManager.setTimeWindow(timeScale.getSelection());
|
this.timeWindowChanged = false;
|
||||||
|
configManager.setShipDistance(shipDistance.getSelection());
|
||||||
|
this.shipDistanceChanged = false;
|
||||||
configManager.setUseAlgorithms(fogChk.getSelection());
|
configManager.setUseAlgorithms(fogChk.getSelection());
|
||||||
|
this.fogChkChanged = false;
|
||||||
|
this.maZonesRemoved = false;
|
||||||
configManager.saveConfigData();
|
configManager.saveConfigData();
|
||||||
/**
|
/**
|
||||||
* DR#11279: re-initialize threshold manager and the monitor
|
* DR#11279: re-initialize threshold manager and the monitor
|
||||||
|
@ -82,18 +90,18 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
FogThresholdMgr.reInitialize();
|
FogThresholdMgr.reInitialize();
|
||||||
FogMonitor.reInitialize();
|
FogMonitor.reInitialize();
|
||||||
|
|
||||||
String message = "New zones have been added, the display "
|
|
||||||
+ "thresholds for the new zones are set to "
|
|
||||||
+ "default values, you may edit them with the display "
|
|
||||||
+ "thresholds editor which can be launched from Fog Monitor "
|
|
||||||
+ "zone table.\n\nIf Fog Monitor is running anywhere within "
|
|
||||||
+ "the office, clear it.\n";
|
|
||||||
|
|
||||||
showMessage(shell, SWT.ICON_INFORMATION | SWT.OK,
|
|
||||||
"Fog Monitor Confirm Changes", message);
|
|
||||||
|
|
||||||
if ((!configManager.getAddedZones().isEmpty())
|
if ((!configManager.getAddedZones().isEmpty())
|
||||||
|| (!configManager.getAddedZones().isEmpty())) {
|
|| (!configManager.getAddedStations().isEmpty())) {
|
||||||
|
String message = "New zones have been added, the display "
|
||||||
|
+ "thresholds for the new zones are set to "
|
||||||
|
+ "default values, you may edit them with the display "
|
||||||
|
+ "thresholds editor which can be launched from Fog Monitor "
|
||||||
|
+ "zone table.\n\nIf Fog Monitor is running anywhere within "
|
||||||
|
+ "the office, clear it.\n";
|
||||||
|
|
||||||
|
showMessage(shell, SWT.ICON_INFORMATION | SWT.OK,
|
||||||
|
"Fog Monitor Confirm Changes", message);
|
||||||
|
|
||||||
String message2 = "New zones have been added, and their monitoring thresholds "
|
String message2 = "New zones have been added, and their monitoring thresholds "
|
||||||
+ "have been set to default values; would you like to modify "
|
+ "have been set to default values; would you like to modify "
|
||||||
+ "their threshold values now?";
|
+ "their threshold values now?";
|
||||||
|
@ -105,6 +113,8 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
DataUsageKey.MONITOR);
|
DataUsageKey.MONITOR);
|
||||||
fogMonitorDlg.open();
|
fogMonitorDlg.open();
|
||||||
}
|
}
|
||||||
|
configManager.getAddedZones().clear();
|
||||||
|
configManager.getAddedStations().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -114,9 +124,9 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
if (yesno == SWT.NO) {
|
if (yesno == SWT.NO) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setReturnValue(true);
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
setReturnValue(true);
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -140,8 +150,22 @@ public class FogMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void readConfigData() {
|
protected void readConfigData() {
|
||||||
FogMonitorConfigurationManager configManager = FogMonitorConfigurationManager
|
|
||||||
.getInstance();
|
|
||||||
configManager.readConfigXml(currentSite);
|
configManager.readConfigXml(currentSite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#setValues
|
||||||
|
* ()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void setValues() {
|
||||||
|
timeWindow.setSelection(configManager.getTimeWindow());
|
||||||
|
setTimeScaleLabel();
|
||||||
|
shipDistance.setSelection(configManager.getShipDistance());
|
||||||
|
setShipDistScaleLabel();
|
||||||
|
fogChk.setSelection(configManager.isUseAlgorithms());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,30 +39,26 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SafeSeasMonitor;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 27, 2009 #3963 lvenable Initial creation
|
* Dec 27, 2009 #3963 lvenable Initial creation
|
||||||
|
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class SSThresholdMgr extends AbstractThresholdMgr
|
public class SSThresholdMgr extends AbstractThresholdMgr {
|
||||||
{
|
|
||||||
private static SSThresholdMgr classInstance;
|
private static SSThresholdMgr classInstance;
|
||||||
|
|
||||||
private SSThresholdMgr()
|
private SSThresholdMgr() {
|
||||||
{
|
|
||||||
super("DefaultSSDisplayThresholds.xml",
|
super("DefaultSSDisplayThresholds.xml",
|
||||||
"DefaultSSMonitorThresholds.xml",
|
"DefaultSSMonitorThresholds.xml", "safeseas");
|
||||||
"safeseas");
|
|
||||||
|
|
||||||
areaConfigMgr = getAreaConfigMgr();
|
areaConfigMgr = getAreaConfigMgr();
|
||||||
init(); // call init() after areaConfigMgr is set
|
init(); // call init() after areaConfigMgr is set
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SSThresholdMgr getInstance()
|
public static SSThresholdMgr getInstance() {
|
||||||
{
|
if (classInstance == null) {
|
||||||
if (classInstance == null)
|
|
||||||
{
|
|
||||||
classInstance = new SSThresholdMgr();
|
classInstance = new SSThresholdMgr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,34 +66,29 @@ public class SSThresholdMgr extends AbstractThresholdMgr
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DR#11279:
|
* DR#11279: When monitor area configuration is changed, threshold manager
|
||||||
* When monitor area configuration is changed,
|
* needs to be re-initialized using the new monitor area configuration
|
||||||
* threshold manager needs to be re-initialized
|
|
||||||
* using the new monitor area configuration
|
|
||||||
*/
|
*/
|
||||||
public static void reInitialize() {
|
public static void reInitialize() {
|
||||||
if ( classInstance != null ) {
|
if (classInstance != null) {
|
||||||
classInstance = null;
|
classInstance = null;
|
||||||
classInstance = new SSThresholdMgr();
|
}
|
||||||
}
|
// Update threshold file.
|
||||||
|
classInstance = new SSThresholdMgr();
|
||||||
|
classInstance.loadDefaultMonitorThreshold();
|
||||||
|
classInstance.saveMonitorThresholds();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ArrayList<String> getThresholdKeys(DataUsageKey dataUsage)
|
protected ArrayList<String> getThresholdKeys(DataUsageKey dataUsage) {
|
||||||
{
|
|
||||||
ArrayList<String> threshKeys = new ArrayList<String>();
|
ArrayList<String> threshKeys = new ArrayList<String>();
|
||||||
|
|
||||||
if (dataUsage == DataUsageKey.DISPLAY)
|
if (dataUsage == DataUsageKey.DISPLAY) {
|
||||||
{
|
for (SafeSeasDisplay ssDisp : SafeSeasDisplay.values()) {
|
||||||
for (SafeSeasDisplay ssDisp : SafeSeasDisplay.values())
|
|
||||||
{
|
|
||||||
threshKeys.add(ssDisp.getXmlKey());
|
threshKeys.add(ssDisp.getXmlKey());
|
||||||
}
|
}
|
||||||
}
|
} else if (dataUsage == DataUsageKey.MONITOR) {
|
||||||
else if (dataUsage == DataUsageKey.MONITOR)
|
for (SafeSeasMonitor ssMon : SafeSeasMonitor.values()) {
|
||||||
{
|
|
||||||
for (SafeSeasMonitor ssMon : SafeSeasMonitor.values())
|
|
||||||
{
|
|
||||||
threshKeys.add(ssMon.getXmlKey());
|
threshKeys.add(ssMon.getXmlKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,8 +96,8 @@ public class SSThresholdMgr extends AbstractThresholdMgr
|
||||||
return threshKeys;
|
return threshKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MonitorConfigurationManager getAreaConfigMgr() {
|
public MonitorConfigurationManager getAreaConfigMgr() {
|
||||||
if (areaConfigMgr == null) {
|
if (areaConfigMgr == null) {
|
||||||
LocalizationManager mgr = LocalizationManager.getInstance();
|
LocalizationManager mgr = LocalizationManager.getInstance();
|
||||||
String siteScope = mgr.getCurrentSite();
|
String siteScope = mgr.getCurrentSite();
|
||||||
|
@ -115,58 +106,58 @@ public class SSThresholdMgr extends AbstractThresholdMgr
|
||||||
areaConfigMgr.readConfigXml(siteScope);
|
areaConfigMgr.readConfigXml(siteScope);
|
||||||
}
|
}
|
||||||
return areaConfigMgr;
|
return areaConfigMgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * Get the path where the display thresholds XML files are contained.
|
// * Get the path where the display thresholds XML files are contained.
|
||||||
// * @return File path.
|
// * @return File path.
|
||||||
// */
|
// */
|
||||||
// @Override
|
// @Override
|
||||||
// public String getDisplayThresholdPath()
|
// public String getDisplayThresholdPath()
|
||||||
// {
|
// {
|
||||||
// String fs = String.valueOf(File.separatorChar);
|
// String fs = String.valueOf(File.separatorChar);
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
//
|
//
|
||||||
// sb.append("safeseas").append(fs);
|
// sb.append("safeseas").append(fs);
|
||||||
// sb.append("threshold").append(fs);
|
// sb.append("threshold").append(fs);
|
||||||
// sb.append("display").append(fs);
|
// sb.append("display").append(fs);
|
||||||
//
|
//
|
||||||
// return sb.toString();
|
// return sb.toString();
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * Get the path where the monitor thresholds XML files are contained.
|
// * Get the path where the monitor thresholds XML files are contained.
|
||||||
// * @return File path.
|
// * @return File path.
|
||||||
// */
|
// */
|
||||||
// @Override
|
// @Override
|
||||||
// public String getMonitorThresholdPath()
|
// public String getMonitorThresholdPath()
|
||||||
// {
|
// {
|
||||||
// String fs = String.valueOf(File.separatorChar);
|
// String fs = String.valueOf(File.separatorChar);
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
//
|
//
|
||||||
// sb.append("safeseas").append(fs);
|
// sb.append("safeseas").append(fs);
|
||||||
// sb.append("threshold").append(fs);
|
// sb.append("threshold").append(fs);
|
||||||
// sb.append("monitor").append(fs);
|
// sb.append("monitor").append(fs);
|
||||||
//
|
//
|
||||||
// return sb.toString();
|
// return sb.toString();
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * Get the path where the XML file containing the user selected
|
// * Get the path where the XML file containing the user selected
|
||||||
// * default file is located.
|
// * default file is located.
|
||||||
// * @return The path of the user selected default file XML.
|
// * @return The path of the user selected default file XML.
|
||||||
// */
|
// */
|
||||||
// @Override
|
// @Override
|
||||||
// public String getDefaultThresholdFilePath()
|
// public String getDefaultThresholdFilePath()
|
||||||
// {
|
// {
|
||||||
// String fs = String.valueOf(File.separatorChar);
|
// String fs = String.valueOf(File.separatorChar);
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
//
|
//
|
||||||
// sb.append("safeseas").append(fs);
|
// sb.append("safeseas").append(fs);
|
||||||
// sb.append("threshold").append(fs);
|
// sb.append("threshold").append(fs);
|
||||||
// sb.append("display").append(fs);
|
// sb.append("display").append(fs);
|
||||||
// sb.append("defaultThresh").append(fs);
|
// sb.append("defaultThresh").append(fs);
|
||||||
//
|
//
|
||||||
// return sb.toString();
|
// return sb.toString();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ import com.raytheon.uf.viz.monitor.safeseas.threshold.SSThresholdMgr;
|
||||||
import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
|
import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* SAFESEAS area configuration dialog.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
@ -40,6 +40,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 5, 2010 mpduff Initial creation
|
* Jan 5, 2010 mpduff Initial creation
|
||||||
* Nov 27, 2012 1351 skorolev Changes for non-blocking dialog.
|
* Nov 27, 2012 1351 skorolev Changes for non-blocking dialog.
|
||||||
|
* Jan 29, 2014 2757 skorolev Changed OK button handler.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -60,6 +61,9 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
readConfigData();
|
readConfigData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SSMonitorConfigurationManager configManager = SSMonitorConfigurationManager
|
||||||
|
.getInstance();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -68,19 +72,23 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void handleOkBtnSelection() {
|
protected void handleOkBtnSelection() {
|
||||||
SSMonitorConfigurationManager configManager = SSMonitorConfigurationManager
|
|
||||||
.getInstance();
|
|
||||||
// Check for changes in the data
|
// Check for changes in the data
|
||||||
if (!configManager.getAddedZones().isEmpty()
|
if (!configManager.getAddedZones().isEmpty()
|
||||||
|| !configManager.getAddedZones().isEmpty()) {
|
|| !configManager.getAddedStations().isEmpty()
|
||||||
|
|| this.timeWindowChanged || this.shipDistanceChanged
|
||||||
|
|| this.fogChkChanged || this.maZonesRemoved) {
|
||||||
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
|
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
|
||||||
"SAFESEAS Monitor Confirm Changes",
|
"SAFESEAS Monitor Confirm Changes",
|
||||||
"Want to update the SAFESEAS setup files?");
|
"Want to update the SAFESEAS setup files?");
|
||||||
if (choice == SWT.OK) {
|
if (choice == SWT.OK) {
|
||||||
// Save the config xml file
|
// Save the config xml file
|
||||||
configManager.setShipDistance(distanceScale.getSelection());
|
configManager.setTimeWindow(timeWindow.getSelection());
|
||||||
configManager.setTimeWindow(timeScale.getSelection());
|
this.timeWindowChanged = false;
|
||||||
|
configManager.setShipDistance(shipDistance.getSelection());
|
||||||
|
this.shipDistanceChanged = false;
|
||||||
configManager.setUseAlgorithms(fogChk.getSelection());
|
configManager.setUseAlgorithms(fogChk.getSelection());
|
||||||
|
this.fogChkChanged = false;
|
||||||
|
this.maZonesRemoved = false;
|
||||||
configManager.saveConfigData();
|
configManager.saveConfigData();
|
||||||
/**
|
/**
|
||||||
* DR#11279: re-initialize threshold manager and the monitor
|
* DR#11279: re-initialize threshold manager and the monitor
|
||||||
|
@ -88,20 +96,30 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
*/
|
*/
|
||||||
SSThresholdMgr.reInitialize();
|
SSThresholdMgr.reInitialize();
|
||||||
SafeSeasMonitor.reInitialize();
|
SafeSeasMonitor.reInitialize();
|
||||||
showMessage(shell, SWT.OK, "SAFESEAS Config Change",
|
if ((!configManager.getAddedZones().isEmpty())
|
||||||
"You're updating the SAFESEAS monitoring settings."
|
|| (!configManager.getAddedStations().isEmpty())) {
|
||||||
+ "\n\nIf SAFESEAS is running anywhere within "
|
|
||||||
+ "the office, please clear it.\n");
|
String message = "You're updating the SAFESEAS monitoring settings."
|
||||||
String message2 = "New zones have been added, and their monitoring thresholds "
|
+ "\n\nIf SAFESEAS is running anywhere within "
|
||||||
+ "have been set to default values; would you like to modify "
|
+ "the office, please clear it.\n";
|
||||||
+ "their threshold values now?";
|
|
||||||
int yesno = showMessage(shell, SWT.ICON_QUESTION | SWT.YES
|
showMessage(shell, SWT.OK, "SAFESEAS Config Change",
|
||||||
| SWT.NO, "Edit Thresholds Now?", message2);
|
message);
|
||||||
if (yesno == SWT.YES) {
|
|
||||||
SSDispMonThreshDlg ssMonitorDlg = new SSDispMonThreshDlg(
|
String message2 = "New zones have been added, and their monitoring thresholds "
|
||||||
shell, CommonConfig.AppName.SAFESEAS,
|
+ "have been set to default values; would you like to modify "
|
||||||
DataUsageKey.MONITOR);
|
+ "their threshold values now?";
|
||||||
ssMonitorDlg.open();
|
|
||||||
|
int yesno = showMessage(shell, SWT.ICON_QUESTION | SWT.YES
|
||||||
|
| SWT.NO, "Edit Thresholds Now?", message2);
|
||||||
|
if (yesno == SWT.YES) {
|
||||||
|
SSDispMonThreshDlg ssMonitorDlg = new SSDispMonThreshDlg(
|
||||||
|
shell, CommonConfig.AppName.SAFESEAS,
|
||||||
|
DataUsageKey.MONITOR);
|
||||||
|
ssMonitorDlg.open();
|
||||||
|
}
|
||||||
|
configManager.getAddedZones().clear();
|
||||||
|
configManager.getAddedStations().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -111,9 +129,9 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
if (yesno == SWT.NO) {
|
if (yesno == SWT.NO) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setReturnValue(true);
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
setReturnValue(true);
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -137,8 +155,22 @@ public class SSMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void readConfigData() {
|
protected void readConfigData() {
|
||||||
SSMonitorConfigurationManager configManager = SSMonitorConfigurationManager
|
|
||||||
.getInstance();
|
|
||||||
configManager.readConfigXml(currentSite);
|
configManager.readConfigXml(currentSite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#setValues
|
||||||
|
* ()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void setValues() {
|
||||||
|
timeWindow.setSelection(configManager.getTimeWindow());
|
||||||
|
setTimeScaleLabel();
|
||||||
|
shipDistance.setSelection(configManager.getShipDistance());
|
||||||
|
setShipDistScaleLabel();
|
||||||
|
fogChk.setSelection(configManager.isUseAlgorithms());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ import com.raytheon.uf.viz.monitor.thresholds.AbstractThresholdMgr;
|
||||||
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowDisplay;
|
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowDisplay;
|
||||||
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowMonitor;
|
import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowMonitor;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class manages the Snow thresholds for display and monitor.
|
* This class manages the Snow thresholds for display and monitor.
|
||||||
*
|
*
|
||||||
|
@ -40,30 +39,26 @@ import com.raytheon.uf.viz.monitor.util.MonitorConfigConstants.SnowMonitor;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Dec 27, 2009 #3963 lvenable Initial creation
|
* Dec 27, 2009 #3963 lvenable Initial creation
|
||||||
|
* Feb 03, 2014 #2757 skorolev Fixed reInitialize()
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class SnowThresholdMgr extends AbstractThresholdMgr
|
public class SnowThresholdMgr extends AbstractThresholdMgr {
|
||||||
{
|
private static SnowThresholdMgr classInstance;
|
||||||
private static SnowThresholdMgr classInstance;
|
|
||||||
|
|
||||||
private SnowThresholdMgr()
|
private SnowThresholdMgr() {
|
||||||
{
|
|
||||||
super("DefaultSnowDisplayThresholds.xml",
|
super("DefaultSnowDisplayThresholds.xml",
|
||||||
"DefaultSnowMonitorThresholds.xml",
|
"DefaultSnowMonitorThresholds.xml", "snow");
|
||||||
"snow");
|
|
||||||
|
|
||||||
areaConfigMgr = getAreaConfigMgr();
|
areaConfigMgr = getAreaConfigMgr();
|
||||||
init(); // call init() after areaConfigMgr is set
|
init(); // call init() after areaConfigMgr is set
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SnowThresholdMgr getInstance()
|
public static SnowThresholdMgr getInstance() {
|
||||||
{
|
if (classInstance == null) {
|
||||||
if (classInstance == null)
|
|
||||||
{
|
|
||||||
classInstance = new SnowThresholdMgr();
|
classInstance = new SnowThresholdMgr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,34 +66,29 @@ private static SnowThresholdMgr classInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DR#11279:
|
* DR#11279: When monitor area configuration is changed, threshold manager
|
||||||
* When monitor area configuration is changed,
|
* needs to be re-initialized using the new monitor area configuration
|
||||||
* threshold manager needs to be re-initialized
|
|
||||||
* using the new monitor area configuration
|
|
||||||
*/
|
*/
|
||||||
public static void reInitialize() {
|
public static void reInitialize() {
|
||||||
if ( classInstance != null ) {
|
if (classInstance != null) {
|
||||||
classInstance = null;
|
classInstance = null;
|
||||||
classInstance = new SnowThresholdMgr();
|
}
|
||||||
}
|
// Update threshold file.
|
||||||
|
classInstance = new SnowThresholdMgr();
|
||||||
|
classInstance.loadDefaultMonitorThreshold();
|
||||||
|
classInstance.saveMonitorThresholds();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ArrayList<String> getThresholdKeys(DataUsageKey dataUsage)
|
protected ArrayList<String> getThresholdKeys(DataUsageKey dataUsage) {
|
||||||
{
|
|
||||||
ArrayList<String> threshKeys = new ArrayList<String>();
|
ArrayList<String> threshKeys = new ArrayList<String>();
|
||||||
|
|
||||||
if (dataUsage == DataUsageKey.DISPLAY)
|
if (dataUsage == DataUsageKey.DISPLAY) {
|
||||||
{
|
for (SnowDisplay snowDisp : SnowDisplay.values()) {
|
||||||
for (SnowDisplay snowDisp : SnowDisplay.values())
|
|
||||||
{
|
|
||||||
threshKeys.add(snowDisp.getXmlKey());
|
threshKeys.add(snowDisp.getXmlKey());
|
||||||
}
|
}
|
||||||
}
|
} else if (dataUsage == DataUsageKey.MONITOR) {
|
||||||
else if (dataUsage == DataUsageKey.MONITOR)
|
for (SnowMonitor snowMon : SnowMonitor.values()) {
|
||||||
{
|
|
||||||
for (SnowMonitor snowMon : SnowMonitor.values())
|
|
||||||
{
|
|
||||||
threshKeys.add(snowMon.getXmlKey());
|
threshKeys.add(snowMon.getXmlKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,8 +96,8 @@ private static SnowThresholdMgr classInstance;
|
||||||
return threshKeys;
|
return threshKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MonitorConfigurationManager getAreaConfigMgr() {
|
public MonitorConfigurationManager getAreaConfigMgr() {
|
||||||
if (areaConfigMgr == null) {
|
if (areaConfigMgr == null) {
|
||||||
LocalizationManager mgr = LocalizationManager.getInstance();
|
LocalizationManager mgr = LocalizationManager.getInstance();
|
||||||
String siteScope = mgr.getCurrentSite();
|
String siteScope = mgr.getCurrentSite();
|
||||||
|
@ -116,58 +106,58 @@ private static SnowThresholdMgr classInstance;
|
||||||
areaConfigMgr.readConfigXml(siteScope);
|
areaConfigMgr.readConfigXml(siteScope);
|
||||||
}
|
}
|
||||||
return areaConfigMgr;
|
return areaConfigMgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * Get the path where the display thresholds XML files are contained.
|
// * Get the path where the display thresholds XML files are contained.
|
||||||
// * @return File path.
|
// * @return File path.
|
||||||
// */
|
// */
|
||||||
// @Override
|
// @Override
|
||||||
// public String getDisplayThresholdPath()
|
// public String getDisplayThresholdPath()
|
||||||
// {
|
// {
|
||||||
// String fs = String.valueOf(File.separatorChar);
|
// String fs = String.valueOf(File.separatorChar);
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
//
|
//
|
||||||
// sb.append("snow").append(fs);
|
// sb.append("snow").append(fs);
|
||||||
// sb.append("threshold").append(fs);
|
// sb.append("threshold").append(fs);
|
||||||
// sb.append("display").append(fs);
|
// sb.append("display").append(fs);
|
||||||
//
|
//
|
||||||
// return sb.toString();
|
// return sb.toString();
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * Get the path where the monitor thresholds XML files are contained.
|
// * Get the path where the monitor thresholds XML files are contained.
|
||||||
// * @return File path.
|
// * @return File path.
|
||||||
// */
|
// */
|
||||||
// @Override
|
// @Override
|
||||||
// public String getMonitorThresholdPath()
|
// public String getMonitorThresholdPath()
|
||||||
// {
|
// {
|
||||||
// String fs = String.valueOf(File.separatorChar);
|
// String fs = String.valueOf(File.separatorChar);
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
//
|
//
|
||||||
// sb.append("snow").append(fs);
|
// sb.append("snow").append(fs);
|
||||||
// sb.append("threshold").append(fs);
|
// sb.append("threshold").append(fs);
|
||||||
// sb.append("monitor").append(fs);
|
// sb.append("monitor").append(fs);
|
||||||
//
|
//
|
||||||
// return sb.toString();
|
// return sb.toString();
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * Get the path where the XML file containing the user selected
|
// * Get the path where the XML file containing the user selected
|
||||||
// * default file is located.
|
// * default file is located.
|
||||||
// * @return The path of the user selected default file XML.
|
// * @return The path of the user selected default file XML.
|
||||||
// */
|
// */
|
||||||
// @Override
|
// @Override
|
||||||
// public String getDefaultThresholdFilePath()
|
// public String getDefaultThresholdFilePath()
|
||||||
// {
|
// {
|
||||||
// String fs = String.valueOf(File.separatorChar);
|
// String fs = String.valueOf(File.separatorChar);
|
||||||
// StringBuilder sb = new StringBuilder();
|
// StringBuilder sb = new StringBuilder();
|
||||||
//
|
//
|
||||||
// sb.append("snow").append(fs);
|
// sb.append("snow").append(fs);
|
||||||
// sb.append("threshold").append(fs);
|
// sb.append("threshold").append(fs);
|
||||||
// sb.append("display").append(fs);
|
// sb.append("display").append(fs);
|
||||||
// sb.append("defaultThresh").append(fs);
|
// sb.append("defaultThresh").append(fs);
|
||||||
//
|
//
|
||||||
// return sb.toString();
|
// return sb.toString();
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,7 @@ import com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jan 5, 2010 mpduff Initial creation
|
* Jan 5, 2010 mpduff Initial creation
|
||||||
* Nov 27, 2012 1351 skorolev Changes for non-blocking dialog.
|
* Nov 27, 2012 1351 skorolev Changes for non-blocking dialog.
|
||||||
|
* Jan 29, 2014 2757 skorolev Changed OK button handler.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -54,6 +55,9 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
readConfigData();
|
readConfigData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private SnowMonitorConfigurationManager configManager = SnowMonitorConfigurationManager
|
||||||
|
.getInstance();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -62,17 +66,18 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void handleOkBtnSelection() {
|
protected void handleOkBtnSelection() {
|
||||||
SnowMonitorConfigurationManager configManager = SnowMonitorConfigurationManager
|
|
||||||
.getInstance();
|
|
||||||
// Check for changes in the data
|
// Check for changes in the data
|
||||||
if (!configManager.getAddedZones().isEmpty()
|
if (!configManager.getAddedZones().isEmpty()
|
||||||
|| !configManager.getAddedZones().isEmpty()) {
|
|| !configManager.getAddedStations().isEmpty()
|
||||||
|
|| this.timeWindowChanged || this.maZonesRemoved) {
|
||||||
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
|
int choice = showMessage(shell, SWT.OK | SWT.CANCEL,
|
||||||
"SNOW Monitor Confirm Changes",
|
"SNOW Monitor Confirm Changes",
|
||||||
"Want to update the SNOW setup files?");
|
"Want to update the SNOW setup files?");
|
||||||
if (choice == SWT.OK) {
|
if (choice == SWT.OK) {
|
||||||
// Save the config xml file
|
// Save the config xml file
|
||||||
configManager.setTimeWindow(timeScale.getSelection());
|
configManager.setTimeWindow(timeWindow.getSelection());
|
||||||
|
this.timeWindowChanged = false;
|
||||||
|
this.maZonesRemoved = false;
|
||||||
configManager.saveConfigData();
|
configManager.saveConfigData();
|
||||||
/**
|
/**
|
||||||
* DR#11279: re-initialize threshold manager and the monitor
|
* DR#11279: re-initialize threshold manager and the monitor
|
||||||
|
@ -80,23 +85,29 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
*/
|
*/
|
||||||
SnowThresholdMgr.reInitialize();
|
SnowThresholdMgr.reInitialize();
|
||||||
SnowMonitor.reInitialize();
|
SnowMonitor.reInitialize();
|
||||||
showMessage(shell, SWT.ICON_INFORMATION | SWT.OK,
|
|
||||||
"SNOW Config Change",
|
|
||||||
"You're updating the SNOW monitoring settings."
|
|
||||||
+ "\n\nIf SNOW is running anywhere within "
|
|
||||||
+ "the office, please clear it.\n");
|
|
||||||
|
|
||||||
String message2 = "New zones have been added, and their monitoring thresholds "
|
if ((!configManager.getAddedZones().isEmpty())
|
||||||
+ "have been set to default values; would you like to modify "
|
|| (!configManager.getAddedStations().isEmpty())) {
|
||||||
+ "their threshold values now?";
|
showMessage(shell, SWT.ICON_INFORMATION | SWT.OK,
|
||||||
int yesno = showMessage(shell, SWT.ICON_QUESTION | SWT.YES
|
"SNOW Config Change",
|
||||||
| SWT.NO, "Edit Thresholds Now?", message2);
|
"You're updating the SNOW monitoring settings."
|
||||||
if (yesno == SWT.YES) {
|
+ "\n\nIf SNOW is running anywhere within "
|
||||||
SnowMonDispThreshDlg snowMonitorDlg = new SnowMonDispThreshDlg(
|
+ "the office, please clear it.\n");
|
||||||
shell, CommonConfig.AppName.SNOW,
|
|
||||||
DataUsageKey.MONITOR);
|
String message2 = "New zones have been added, and their monitoring thresholds "
|
||||||
snowMonitorDlg.open();
|
+ "have been set to default values; would you like to modify "
|
||||||
|
+ "their threshold values now?";
|
||||||
|
int yesno = showMessage(shell, SWT.ICON_QUESTION | SWT.YES
|
||||||
|
| SWT.NO, "Edit Thresholds Now?", message2);
|
||||||
|
if (yesno == SWT.YES) {
|
||||||
|
SnowMonDispThreshDlg snowMonitorDlg = new SnowMonDispThreshDlg(
|
||||||
|
shell, CommonConfig.AppName.SNOW,
|
||||||
|
DataUsageKey.MONITOR);
|
||||||
|
snowMonitorDlg.open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
configManager.getAddedZones().clear();
|
||||||
|
configManager.getAddedStations().clear();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String message3 = "No changes made.\nDo you want to exit?";
|
String message3 = "No changes made.\nDo you want to exit?";
|
||||||
|
@ -105,9 +116,9 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
if (yesno == SWT.NO) {
|
if (yesno == SWT.NO) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setReturnValue(true);
|
||||||
|
close();
|
||||||
}
|
}
|
||||||
setReturnValue(true);
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -130,9 +141,20 @@ public class SnowMonitoringAreaConfigDlg extends MonitoringAreaConfigDlg {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void readConfigData() {
|
protected void readConfigData() {
|
||||||
SnowMonitorConfigurationManager configManager = SnowMonitorConfigurationManager
|
|
||||||
.getInstance();
|
|
||||||
configManager.readConfigXml(currentSite);
|
configManager.readConfigXml(currentSite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.monitor.ui.dialogs.MonitoringAreaConfigDlg#setValues
|
||||||
|
* ()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void setValues() {
|
||||||
|
timeWindow.setSelection(configManager.getTimeWindow());
|
||||||
|
setTimeScaleLabel();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* Nov 16, 2012 1297 skorolev Changes for non-blocking dialog.
|
* Nov 16, 2012 1297 skorolev Changes for non-blocking dialog.
|
||||||
* Feb 06, 2013 1578 skorolev Fixed a cursor problem for checkboxes.
|
* Feb 06, 2013 1578 skorolev Fixed a cursor problem for checkboxes.
|
||||||
* Oct 07, 2013 #2443 lvenable Fixed image memory leak.
|
* Oct 07, 2013 #2443 lvenable Fixed image memory leak.
|
||||||
*
|
* Jan 29, 2014 2757 skorolev Added status variables.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author lvenable
|
* @author lvenable
|
||||||
|
@ -125,17 +125,25 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
/** Edit/Delete button. **/
|
/** Edit/Delete button. **/
|
||||||
private Button editDeleteBtn;
|
private Button editDeleteBtn;
|
||||||
|
|
||||||
/** Time scale control. **/
|
/** Time window control. **/
|
||||||
protected Scale timeScale;
|
protected Scale timeWindow;
|
||||||
|
|
||||||
|
/** Time window status. */
|
||||||
|
protected boolean timeWindowChanged = false;
|
||||||
|
|
||||||
/** Time scale label to display the value set by the time scale. **/
|
/** Time scale label to display the value set by the time scale. **/
|
||||||
private Label timeScaleLbl;
|
private Label timeWindowLbl;
|
||||||
|
|
||||||
/** Distance scale. **/
|
/** Ship Distance scale. **/
|
||||||
protected Scale distanceScale;
|
protected Scale shipDistance;
|
||||||
|
|
||||||
/** Distance scale label to display the value set by the distance scale. **/
|
/** Ship Distance status. */
|
||||||
private Label distanceScaleLBl;
|
protected boolean shipDistanceChanged = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ship Distance scale label to display the value set by the distance scale.
|
||||||
|
**/
|
||||||
|
private Label shipDistanceLBl;
|
||||||
|
|
||||||
/** Monitor area Add button. **/
|
/** Monitor area Add button. **/
|
||||||
private Button monAreaAddBtn;
|
private Button monAreaAddBtn;
|
||||||
|
@ -158,6 +166,9 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
/** Fog check button. **/
|
/** Fog check button. **/
|
||||||
protected Button fogChk;
|
protected Button fogChk;
|
||||||
|
|
||||||
|
/** Fog check button status. */
|
||||||
|
protected boolean fogChkChanged = false;
|
||||||
|
|
||||||
/** Control font. **/
|
/** Control font. **/
|
||||||
private Font controlFont;
|
private Font controlFont;
|
||||||
|
|
||||||
|
@ -170,6 +181,9 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
/** monitor area zones **/
|
/** monitor area zones **/
|
||||||
private java.util.List<String> maZones = null;
|
private java.util.List<String> maZones = null;
|
||||||
|
|
||||||
|
/** monitor area zones status. */
|
||||||
|
protected boolean maZonesRemoved = false;
|
||||||
|
|
||||||
/** monitor area stations **/
|
/** monitor area stations **/
|
||||||
private java.util.List<String> maStations = null;
|
private java.util.List<String> maStations = null;
|
||||||
|
|
||||||
|
@ -457,6 +471,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
removeZoneStn();
|
removeZoneStn();
|
||||||
|
maZonesRemoved = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -646,22 +661,23 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
int defaultVal = (int) Math.round((2.00 - 0.25) / .05);
|
int defaultVal = (int) Math.round((2.00 - 0.25) / .05);
|
||||||
|
|
||||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||||
timeScale = new Scale(scaleComp, SWT.HORIZONTAL);
|
timeWindow = new Scale(scaleComp, SWT.HORIZONTAL);
|
||||||
timeScale.setMinimum(0);
|
timeWindow.setMinimum(0);
|
||||||
timeScale.setMaximum(max);
|
timeWindow.setMaximum(max);
|
||||||
timeScale.setSelection(defaultVal);
|
timeWindow.setSelection(defaultVal);
|
||||||
timeScale.setLayoutData(gd);
|
timeWindow.setLayoutData(gd);
|
||||||
timeScale.addSelectionListener(new SelectionAdapter() {
|
timeWindow.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
setTimeScaleLabel();
|
setTimeScaleLabel();
|
||||||
|
timeWindowChanged = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
gd = new GridData(50, SWT.DEFAULT);
|
gd = new GridData(50, SWT.DEFAULT);
|
||||||
timeScaleLbl = new Label(scaleComp, SWT.NONE);
|
timeWindowLbl = new Label(scaleComp, SWT.NONE);
|
||||||
timeScaleLbl.setFont(controlFont);
|
timeWindowLbl.setFont(controlFont);
|
||||||
timeScaleLbl.setLayoutData(gd);
|
timeWindowLbl.setLayoutData(gd);
|
||||||
|
|
||||||
setTimeScaleLabel();
|
setTimeScaleLabel();
|
||||||
|
|
||||||
|
@ -682,22 +698,23 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
distanceLbl.setLayoutData(gd);
|
distanceLbl.setLayoutData(gd);
|
||||||
|
|
||||||
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||||
distanceScale = new Scale(scaleComp, SWT.HORIZONTAL);
|
shipDistance = new Scale(scaleComp, SWT.HORIZONTAL);
|
||||||
distanceScale.setMinimum(0);
|
shipDistance.setMinimum(0);
|
||||||
distanceScale.setMaximum(200);
|
shipDistance.setMaximum(200);
|
||||||
distanceScale.setSelection(100);
|
shipDistance.setSelection(100);
|
||||||
distanceScale.setLayoutData(gd);
|
shipDistance.setLayoutData(gd);
|
||||||
distanceScale.addSelectionListener(new SelectionAdapter() {
|
shipDistance.addSelectionListener(new SelectionAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
setShipDistScaleLabel();
|
setShipDistScaleLabel();
|
||||||
|
shipDistanceChanged = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
gd = new GridData(50, SWT.DEFAULT);
|
gd = new GridData(50, SWT.DEFAULT);
|
||||||
distanceScaleLBl = new Label(scaleComp, SWT.NONE);
|
shipDistanceLBl = new Label(scaleComp, SWT.NONE);
|
||||||
distanceScaleLBl.setFont(controlFont);
|
shipDistanceLBl.setFont(controlFont);
|
||||||
distanceScaleLBl.setLayoutData(gd);
|
shipDistanceLBl.setLayoutData(gd);
|
||||||
|
|
||||||
setShipDistScaleLabel();
|
setShipDistScaleLabel();
|
||||||
|
|
||||||
|
@ -709,6 +726,12 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
fogChk = new Button(scaleComp, SWT.CHECK);
|
fogChk = new Button(scaleComp, SWT.CHECK);
|
||||||
|
fogChk.addSelectionListener(new SelectionAdapter() {
|
||||||
|
@Override
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
fogChkChanged = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
setAlgorithmText();
|
setAlgorithmText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -784,18 +807,18 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
/**
|
/**
|
||||||
* Set the time scale label.
|
* Set the time scale label.
|
||||||
*/
|
*/
|
||||||
private void setTimeScaleLabel() {
|
protected void setTimeScaleLabel() {
|
||||||
double val = timeScale.getSelection() * .05 + .25;
|
double val = timeWindow.getSelection() * .05 + .25;
|
||||||
val = roundToHundredths(val);
|
val = roundToHundredths(val);
|
||||||
timeScaleLbl.setText(String.format("%5.2f", val));
|
timeWindowLbl.setText(String.format("%5.2f", val));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the ship distance scale label.
|
* Set the ship distance scale label.
|
||||||
*/
|
*/
|
||||||
private void setShipDistScaleLabel() {
|
protected void setShipDistScaleLabel() {
|
||||||
distanceScaleLBl.setText(String.format("%5d",
|
shipDistanceLBl.setText(String.format("%5d",
|
||||||
distanceScale.getSelection()));
|
shipDistance.getSelection()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -958,27 +981,7 @@ public abstract class MonitoringAreaConfigDlg extends CaveSWTDialog implements
|
||||||
/**
|
/**
|
||||||
* Set the slider values and the check box.
|
* Set the slider values and the check box.
|
||||||
*/
|
*/
|
||||||
private void setValues() {
|
protected abstract void setValues();
|
||||||
MonitorConfigurationManager configManager = getConfigManager();
|
|
||||||
|
|
||||||
if (appName == AppName.SAFESEAS) {
|
|
||||||
fogChk.setSelection(((SSMonitorConfigurationManager) configManager)
|
|
||||||
.isUseAlgorithms());
|
|
||||||
distanceScale
|
|
||||||
.setSelection(((SSMonitorConfigurationManager) configManager)
|
|
||||||
.getShipDistance());
|
|
||||||
setShipDistScaleLabel();
|
|
||||||
} else if (appName == AppName.FOG) {
|
|
||||||
fogChk.setSelection(((FogMonitorConfigurationManager) configManager)
|
|
||||||
.isUseAlgorithms());
|
|
||||||
distanceScale
|
|
||||||
.setSelection(((FogMonitorConfigurationManager) configManager)
|
|
||||||
.getShipDistance());
|
|
||||||
setShipDistScaleLabel();
|
|
||||||
}
|
|
||||||
timeScale.setSelection(configManager.getTimeWindow());
|
|
||||||
setTimeScaleLabel();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a dialog message.
|
* Show a dialog message.
|
||||||
|
|
Loading…
Add table
Reference in a new issue