Issue #1158 Changed the scheduled and alerted alarm containers in SCANAlarmAlertManager to be sychronized. Changed the alarm button and alarm in SCANCellTableDlg to show and alarm only when the current table has alarms. Turn off alarms if the threshold has changed. Also a fix for ScanResource to initialize the ScanDrawer only after it has initialized the GeodeticCalculator.
Former-commit-id:0750f76993
[formerly49f61f42f1
] [formerly02ca1776b4
] [formerly0750f76993
[formerly49f61f42f1
] [formerly02ca1776b4
] [formerly1ed32bdefc
[formerly02ca1776b4
[formerly e1f97dfdf69c0cf625555372e8855d85967c4b2a]]]] Former-commit-id:1ed32bdefc
Former-commit-id:9575ce37d2
[formerlyc34cdda42f
] [formerly af9bbfb5aa58b854fab891b292d963e9ec66cad2 [formerly88d9115db9
]] Former-commit-id: d587191e75e38d5c93e25ec02a38f42309887bb7 [formerly10ddb22854
] Former-commit-id:3fab94cf35
This commit is contained in:
parent
42a67b10de
commit
e4e96327f0
8 changed files with 93 additions and 18 deletions
|
@ -19,6 +19,8 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.monitor.scan.commondialogs;
|
package com.raytheon.uf.viz.monitor.scan.commondialogs;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.FocusAdapter;
|
import org.eclipse.swt.events.FocusAdapter;
|
||||||
import org.eclipse.swt.events.FocusEvent;
|
import org.eclipse.swt.events.FocusEvent;
|
||||||
|
@ -40,8 +42,12 @@ import org.eclipse.swt.widgets.Text;
|
||||||
import com.raytheon.uf.common.monitor.scan.config.AbsConfigMgr;
|
import com.raytheon.uf.common.monitor.scan.config.AbsConfigMgr;
|
||||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
|
import com.raytheon.uf.common.monitor.scan.config.SCANConfig;
|
||||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||||
|
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
|
||||||
|
import com.raytheon.uf.viz.monitor.scan.tables.AbstractTableDlg;
|
||||||
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager;
|
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager;
|
||||||
|
import com.raytheon.uf.viz.monitor.scan.tables.SCANCellTableDlg;
|
||||||
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
|
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
|
||||||
|
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlertedAlarms;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
|
||||||
public class SCANAlarmThreshDlg extends CaveSWTDialog implements
|
public class SCANAlarmThreshDlg extends CaveSWTDialog implements
|
||||||
|
@ -239,6 +245,16 @@ public class SCANAlarmThreshDlg extends CaveSWTDialog implements
|
||||||
@Override
|
@Override
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
alarmChoiceChanged();
|
alarmChoiceChanged();
|
||||||
|
String columnName = attributeCbo.getText();
|
||||||
|
mgr.clearAlertedAlarms(site, scanTable);
|
||||||
|
AbstractTableDlg tableDlg = ScanMonitor.getInstance()
|
||||||
|
.getDialog(scanTable, site);
|
||||||
|
tableDlg.updateThresh(columnName);
|
||||||
|
if (mgr.getAlertedAlarmCount(site, scanTable) == 0) {
|
||||||
|
tableDlg.turnOffAlarm();
|
||||||
|
} else {
|
||||||
|
tableDlg.turnOnAlarm();
|
||||||
|
}
|
||||||
shell.dispose();
|
shell.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class ScanResource extends
|
||||||
VizApp.runAsync(new Runnable() {
|
VizApp.runAsync(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (getScanDrawer().font != null) {
|
if (gc != null && getScanDrawer().font != null) {
|
||||||
getScanDrawer().font.setMagnification(getCapability(
|
getScanDrawer().font.setMagnification(getCapability(
|
||||||
MagnificationCapability.class).getMagnification()
|
MagnificationCapability.class).getMagnification()
|
||||||
.floatValue());
|
.floatValue());
|
||||||
|
@ -560,7 +560,7 @@ public class ScanResource extends
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ScanDrawer getScanDrawer() {
|
public ScanDrawer getScanDrawer() {
|
||||||
if (drawer == null) {
|
if (drawer == null && gc != null) {
|
||||||
if (getTable().equals(ScanTables.CELL)) {
|
if (getTable().equals(ScanTables.CELL)) {
|
||||||
drawer = new ScanDrawer(SCANConfig.getInstance()
|
drawer = new ScanDrawer(SCANConfig.getInstance()
|
||||||
.getStormCellConfig(), gc, getScan()
|
.getStormCellConfig(), gc, getScan()
|
||||||
|
|
|
@ -765,4 +765,8 @@ public abstract class AbstractTableDlg extends Dialog implements IMonitor,
|
||||||
protected abstract void handleRankMenuEvent(SelectionEvent event);
|
protected abstract void handleRankMenuEvent(SelectionEvent event);
|
||||||
|
|
||||||
public abstract void updateThresh(String attr);
|
public abstract void updateThresh(String attr);
|
||||||
|
|
||||||
|
public abstract void turnOffAlarm();
|
||||||
|
|
||||||
|
public abstract void turnOnAlarm();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,13 @@ package com.raytheon.uf.viz.monitor.scan.tables;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
|
@ -36,6 +39,7 @@ import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums;
|
||||||
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
import com.raytheon.uf.common.monitor.scan.config.SCANConfigEnums.ScanTables;
|
||||||
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
|
import com.raytheon.uf.viz.monitor.scan.ScanMonitor;
|
||||||
import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
|
import com.raytheon.uf.viz.monitor.scan.data.ScanDataGenerator;
|
||||||
|
import com.raytheon.uf.viz.monitor.scan.tables.SCANAlarmAlertManager.AlarmType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manager class to hold between scan dialog and alarming capabilities
|
* Manager class to hold between scan dialog and alarming capabilities
|
||||||
|
@ -74,11 +78,11 @@ public class SCANAlarmAlertManager {
|
||||||
|
|
||||||
private static SCANAlarmAlertManager instance = null;
|
private static SCANAlarmAlertManager instance = null;
|
||||||
|
|
||||||
private HashMap<String, HashMap<ScanTables, List<ScheduledAlarms>>> scheduledAlarmsMap;
|
private Map<String, Map<ScanTables, List<ScheduledAlarms>>> scheduledAlarmsMap;
|
||||||
|
|
||||||
private HashMap<String, HashMap<ScanTables, Set<AlertedAlarms>>> alertedAlarmsMap;
|
private Map<String, Map<ScanTables, Set<AlertedAlarms>>> alertedAlarmsMap;
|
||||||
|
|
||||||
private HashMap<String, HashMap<ScanTables, List<String>>> idents;
|
private Map<String, Map<ScanTables, List<String>>> idents;
|
||||||
|
|
||||||
private boolean ring = false;
|
private boolean ring = false;
|
||||||
|
|
||||||
|
@ -98,7 +102,7 @@ public class SCANAlarmAlertManager {
|
||||||
public void addSite(String site) {
|
public void addSite(String site) {
|
||||||
|
|
||||||
if (!scheduledAlarmsMap.containsKey(site)) {
|
if (!scheduledAlarmsMap.containsKey(site)) {
|
||||||
HashMap<ScanTables, List<ScheduledAlarms>> siteScheduledAlarmsMap = new HashMap<ScanTables, List<ScheduledAlarms>>();
|
Map<ScanTables, List<ScheduledAlarms>> siteScheduledAlarmsMap = Collections.synchronizedMap(new HashMap<ScanTables, List<ScheduledAlarms>>());
|
||||||
siteScheduledAlarmsMap.put(ScanTables.DMD,
|
siteScheduledAlarmsMap.put(ScanTables.DMD,
|
||||||
new CopyOnWriteArrayList<ScheduledAlarms>());
|
new CopyOnWriteArrayList<ScheduledAlarms>());
|
||||||
siteScheduledAlarmsMap.put(ScanTables.CELL,
|
siteScheduledAlarmsMap.put(ScanTables.CELL,
|
||||||
|
@ -107,7 +111,7 @@ public class SCANAlarmAlertManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!alertedAlarmsMap.containsKey(site)) {
|
if (!alertedAlarmsMap.containsKey(site)) {
|
||||||
HashMap<ScanTables, Set<AlertedAlarms>> siteAlertedAlarmsSet = new HashMap<ScanTables, Set<AlertedAlarms>>();
|
Map<ScanTables, Set<AlertedAlarms>> siteAlertedAlarmsSet = Collections.synchronizedMap(new HashMap<ScanTables, Set<AlertedAlarms>>());
|
||||||
siteAlertedAlarmsSet.put(ScanTables.DMD,
|
siteAlertedAlarmsSet.put(ScanTables.DMD,
|
||||||
new HashSet<AlertedAlarms>());
|
new HashSet<AlertedAlarms>());
|
||||||
siteAlertedAlarmsSet.put(ScanTables.CELL,
|
siteAlertedAlarmsSet.put(ScanTables.CELL,
|
||||||
|
@ -116,7 +120,7 @@ public class SCANAlarmAlertManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!idents.containsKey(site)) {
|
if (!idents.containsKey(site)) {
|
||||||
HashMap<ScanTables, List<String>> siteIdents = new HashMap<ScanTables, List<String>>();
|
Map<ScanTables, List<String>> siteIdents = new HashMap<ScanTables, List<String>>();
|
||||||
siteIdents.put(ScanTables.CELL, new ArrayList<String>());
|
siteIdents.put(ScanTables.CELL, new ArrayList<String>());
|
||||||
siteIdents.put(ScanTables.DMD, new ArrayList<String>());
|
siteIdents.put(ScanTables.DMD, new ArrayList<String>());
|
||||||
idents.put(site, siteIdents);
|
idents.put(site, siteIdents);
|
||||||
|
@ -126,15 +130,15 @@ public class SCANAlarmAlertManager {
|
||||||
private SCANAlarmAlertManager() {
|
private SCANAlarmAlertManager() {
|
||||||
|
|
||||||
if (scheduledAlarmsMap == null) {
|
if (scheduledAlarmsMap == null) {
|
||||||
scheduledAlarmsMap = new HashMap<String, HashMap<ScanTables, List<ScheduledAlarms>>>();
|
scheduledAlarmsMap = Collections.synchronizedMap(new HashMap<String, Map<ScanTables, List<ScheduledAlarms>>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alertedAlarmsMap == null) {
|
if (alertedAlarmsMap == null) {
|
||||||
alertedAlarmsMap = new HashMap<String, HashMap<ScanTables, Set<AlertedAlarms>>>();
|
alertedAlarmsMap = Collections.synchronizedMap(new HashMap<String, Map<ScanTables, Set<AlertedAlarms>>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (idents == null) {
|
if (idents == null) {
|
||||||
idents = new HashMap<String, HashMap<ScanTables, List<String>>>();
|
idents = new HashMap<String, Map<ScanTables, List<String>>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -496,6 +500,7 @@ public class SCANAlarmAlertManager {
|
||||||
|
|
||||||
public void removeAlertedAlarms(String site, ScanTables tableType) {
|
public void removeAlertedAlarms(String site, ScanTables tableType) {
|
||||||
alertedAlarmsMap.get(site).get(tableType).clear();
|
alertedAlarmsMap.get(site).get(tableType).clear();
|
||||||
|
setRing(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -603,4 +608,5 @@ public class SCANAlarmAlertManager {
|
||||||
+ this.row + "\nCol #:" + this.col + "\nCleared: " + cleared + "\n";
|
+ this.row + "\nCol #:" + this.col + "\nCleared: " + cleared + "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -475,8 +475,7 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
|
||||||
alarmDlg.open();
|
alarmDlg.open();
|
||||||
if (!alarmBtn.isDisposed()
|
if (!alarmBtn.isDisposed()
|
||||||
&& (mgr.getAlertedAlarmCount(site, scanTable) == 0)) {
|
&& (mgr.getAlertedAlarmCount(site, scanTable) == 0)) {
|
||||||
alarmBtn.setVisible(false);
|
turnOffAlarm();
|
||||||
mgr.setRing(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -488,6 +487,22 @@ public class SCANCellTableDlg extends AbstractTableDlg implements
|
||||||
timeLbl.setLayoutData(gd);
|
timeLbl.setLayoutData(gd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void turnOffAlarm() {
|
||||||
|
if (alarmBtn != null && !alarmBtn.isDisposed()) {
|
||||||
|
alarmBtn.setVisible(false);
|
||||||
|
}
|
||||||
|
mgr.setRing(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void turnOnAlarm() {
|
||||||
|
if (alarmBtn != null && !alarmBtn.isDisposed()) {
|
||||||
|
alarmBtn.setVisible(true);
|
||||||
|
}
|
||||||
|
mgr.setRing(true);
|
||||||
|
}
|
||||||
|
|
||||||
// private void resetButtonForegroundColor(Button btn)
|
// private void resetButtonForegroundColor(Button btn)
|
||||||
// {
|
// {
|
||||||
// btn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
|
// btn.setForeground(display.getSystemColor(SWT.COLOR_WHITE));
|
||||||
|
|
|
@ -514,8 +514,7 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
|
||||||
alarmsDlg.open();
|
alarmsDlg.open();
|
||||||
if (!alarmBtn.isDisposed()
|
if (!alarmBtn.isDisposed()
|
||||||
&& mgr.getAlertedAlarms(site, scanTable).isEmpty()) {
|
&& mgr.getAlertedAlarms(site, scanTable).isEmpty()) {
|
||||||
alarmBtn.setVisible(false);
|
turnOffAlarm();
|
||||||
mgr.setRing(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1299,4 +1298,19 @@ public class SCANDmdTableDlg extends AbstractTableDlg implements
|
||||||
dmdTableComp.alarmSelection(ident);
|
dmdTableComp.alarmSelection(ident);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void turnOffAlarm() {
|
||||||
|
if (alarmBtn != null && !alarmBtn.isDisposed()) {
|
||||||
|
alarmBtn.setVisible(false);
|
||||||
|
}
|
||||||
|
mgr.setRing(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void turnOnAlarm() {
|
||||||
|
if (alarmBtn != null && !alarmBtn.isDisposed()) {
|
||||||
|
alarmBtn.setVisible(true);
|
||||||
|
}
|
||||||
|
mgr.setRing(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -647,4 +647,14 @@ public class SCANMesoTableDlg extends AbstractTableDlg implements
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void turnOffAlarm() {
|
||||||
|
mgr.setRing(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void turnOnAlarm() {
|
||||||
|
mgr.setRing(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -609,4 +609,14 @@ public class SCANTvsTableDlg extends AbstractTableDlg implements
|
||||||
// Not currently used for TVS
|
// Not currently used for TVS
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void turnOffAlarm() {
|
||||||
|
mgr.setRing(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void turnOnAlarm() {
|
||||||
|
mgr.setRing(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue