Commit in java/trunk/monitoring-app/src/main/java/org/hps/monitoring on MAIN
MonitoringApplicationMain.java+3-1830 -> 831
enums/StatusCode.java+2-1830 -> 831
gui/JobSettingsPanel.java+3-36830 -> 831
   /MonitoringApplication.java+24-22830 -> 831
   /SystemStatusFrame.java+74-7830 -> 831
   /SystemStatusTableModel.java+44-13830 -> 831
subsys/SystemStatus.java+6830 -> 831
      /SystemStatusImpl.java+19-5830 -> 831
subsys/et/EtSystemMonitor.java+1-1830 -> 831
subsys/svt/BasicHitMonitoringDriver.java+1-1830 -> 831
+177-87
10 modified files
Resolve HPSJAVA-226 by adding button that sets to CLEARED state.  Some other minor changes.

java/trunk/monitoring-app/src/main/java/org/hps/monitoring
MonitoringApplicationMain.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/MonitoringApplicationMain.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/MonitoringApplicationMain.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -57,8 +57,10 @@
 
                 // Load the connection settings.
                 if (cl.hasOption("c")) {
-                    app.load(new Configuration(new File(cl.getOptionValue("c"))));
+                    app.set(new Configuration(new File(cl.getOptionValue("c"))));
                 }
+                
+                app.initialize();
         
                 // Set the app to be visible.
                 app.setVisible(true);

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/enums
StatusCode.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/enums/StatusCode.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/enums/StatusCode.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -8,8 +8,9 @@
     UNKNOWN,                
     CLEARED,
     OFFLINE,
+    INFO,
     WARNING,
     ERROR,
     ALARM,
-    HALT;        
+    HALT;
 }

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui
JobSettingsPanel.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/JobSettingsPanel.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/JobSettingsPanel.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -187,41 +187,8 @@
             throw new IOException("Not an LCSim XML file.");
         }
     }
-
+         
     /**
-     * Check that the steering file or resource is valid.
-     * @return True if steering is valid; false if not.
-     */
-    /*
-    void checkSteering() throws IOException {        
-        SteeringType steeringType = SteeringType.values()[steeringTypeComboBox.getSelectedIndex()];
-        System.out.println("checkSteering - " + steeringType.name());        
-        if (steeringType.equals(SteeringType.RESOURCE)) {
-            
-            String steeringResource = getSteeringResource();
-            System.out.println("steeringResource = " + steeringResource);
-            
-            // Check that steering resource exists.
-            InputStream is = getClass().getResourceAsStream(steeringResource);
-            if (is == null) {
-                throw new IOException("Steering resource does not exist or is not accessible.");
-            }
-        } else if (steeringType.equals(SteeringType.FILE)) {
-            
-            // Get steering file.
-            String steeringFilePath = steeringFileField.getText();
-            System.out.println("steeringFilePath = " + steeringFilePath);
-            
-            // Check that steering file exists.
-            File f = new File(steeringFilePath);
-            if (!f.exists()) {
-                throw new IOException("Steering file does not exist or is not readable.");
-            } 
-        } 
-    }
-    */
-     
-    /**
      * Setup the event builder from the field setting.
      * @return True if builder is setup successfully; false if not.
      */
@@ -288,7 +255,6 @@
      * @param s The resource path.
      */
     void setSteeringResource(final String s) {
-        System.out.println("setSteeringResource - " + s);
         SwingUtilities.invokeLater(new Runnable() {
             public void run() {
                 steeringResourcesComboBox.setSelectedItem(s);
@@ -525,8 +491,9 @@
         setSteeringType(SteeringType.valueOf(config.get("steeringType")));
         if (config.hasKey("steeringFile"))
             setSteeringFile(new File(config.get("steeringFile")));
-        if (config.hasKey("steeringResource")) 
+        if (config.hasKey("steeringResource")) {
             setSteeringResource(config.get("steeringResource"));
+        }
         setDetectorName(config.get("detectorName"));
         setEventBuilder(config.get("eventBuilderClassName"));
         setLogToFile(config.getBoolean("logToFile"));

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui
MonitoringApplication.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -144,13 +144,13 @@
      * Constructor for the monitoring application.
      */
     public MonitoringApplication() {        
-        initialize();
+        //initialize();
     }
         
     /**
      * Perform all intialization on start up.
      */
-    private void initialize() {
+    public void initialize() {
         
         // Create and configure the logger.
         setupLogger();
@@ -533,7 +533,7 @@
         Level newLevel = getJobSettingsPanel().getLogLevel();
         if (logger.getLevel() != newLevel) {
             logger.setLevel(newLevel);
-            log(Level.INFO, "Log Level was changed to < " + getJobSettingsPanel().getLogLevel().toString() + " >");
+            log(Level.INFO, "Log Level was changed to <" + getJobSettingsPanel().getLogLevel().toString() + ">");
         }
     }
 
@@ -544,7 +544,7 @@
     private void setConnectionStatus(ConnectionStatus status) {
         connectionStatus = status;
         connectionStatusPanel.setConnectionStatus(status);
-        log(Level.FINE, "Connection status changed to < " + status.name() + " >");
+        log(Level.FINE, "Connection status changed to <" + status.name() + ">");
         logHandler.flush();
     }
 
@@ -574,7 +574,7 @@
             File fileName = fc.getSelectedFile();
             try {
                 AIDA.defaultInstance().saveAs(fileName);
-                logger.log(Level.INFO, "Plots saved to file < " + fileName + " >");
+                logger.log(Level.INFO, "Plots saved to file <" + fileName + ">");
             } catch (IOException e) {
                 errorHandler.setError(e)
                     .setMessage("Error saving plots to file.")
@@ -661,7 +661,7 @@
                 logItem.setEnabled(false);
             }
         });
-        log("Redirected std out and err to file < " + file.getPath() + " >");
+        log("Redirected std out and err to file <" + file.getPath() + ">");
     }
 
     /**
@@ -751,7 +751,7 @@
                 fileName = fileName + "." + screenshotFormat;
             }
             takeScreenshot(fileName);
-            log(Level.INFO, "Screenshot saved to file < " + fileName + " >");
+            log(Level.INFO, "Screenshot saved to file <" + fileName + ">");
         }
     }
 
@@ -969,7 +969,7 @@
         // Get steering resource or file as a String parameter.
         String steering = getSteering();
         SteeringType steeringType = getJobSettingsPanel().getSteeringType();
-        log(Level.CONFIG, "Set LCSim steering to < " + steering + " > with type < " + (steeringType == SteeringType.RESOURCE ? "RESOURCE" : "FILE") + " >");
+        log(Level.CONFIG, "Set LCSim steering to <" + steering + "> with type <" + (steeringType == SteeringType.RESOURCE ? "RESOURCE" : "FILE") + ">");
 
         try {
             // Create job manager and configure.
@@ -996,13 +996,15 @@
     }
 
     private void setupSteeringFile(String steering) {
-        log(Level.CONFIG, "Setting up steering file < " + steering + " >");
+        log(Level.CONFIG, "Setting up steering file <" + steering + ">");
         jobManager.setup(new File(steering));
     }
 
     private void setupSteeringResource(String steering) throws IOException {
-        log(Level.CONFIG, "Setting up steering resource < " + steering + " >");
+        log(Level.CONFIG, "Setting up steering resource <" + steering + ">");
         InputStream is = this.getClass().getClassLoader().getResourceAsStream(steering);
+        if (is == null)
+            throw new IOException("Steering resource is not accessible or does not exist.");
         jobManager.setup(is);
         is.close();
     }
@@ -1015,7 +1017,7 @@
         // Setup the EventBuilder class.
         String eventBuilderClassName = getEventBuilderClassName();
 
-        log(Level.FINE, "Initializing event builder < " + eventBuilderClassName + " >");
+        log(Level.FINE, "Initializing event builder <" + eventBuilderClassName + ">");
 
         try {
             eventBuilder = (LCSimEventBuilder) Class.forName(eventBuilderClassName).newInstance();
@@ -1026,7 +1028,7 @@
         // Set the detector name on the event builder so it can find conditions data.
         eventBuilder.setDetectorName(getDetectorName());
 
-        log(Level.INFO, "Successfully initialized event builder < " + eventBuilderClassName + " >");
+        log(Level.INFO, "Successfully initialized event builder <" + eventBuilderClassName + ">");
     }
 
     /**
@@ -1078,7 +1080,7 @@
                     BufferedWriter out = new BufferedWriter(new FileWriter(logFile.getPath()));
                     out.write(buf.toString());
                     out.close();
-                    log("Saved log to file < " + logFile.getPath() + " >");
+                    log("Saved log to file <" + logFile.getPath() + ">");
                 } catch (IOException e) {                    
                     errorHandler.setError(e)
                         .setMessage("Error saving log to file.")
@@ -1235,7 +1237,7 @@
     private void configDataSource() {
         DataSourceType dataSourceType = getDataSourcePanel().getDataSourceType();
         String filePath = getDataSourcePanel().getFilePath();
-        log(Level.INFO, "Data source type < " + dataSourceType + " >");
+        log(Level.INFO, "Data source type <" + dataSourceType + ">");
         if (dataSourceType.equals(DataSourceType.ET_SERVER)) {
             eventProcessing.setRecordSource(new EtEventSource(connection));
             log(Level.FINE, "ET event source");
@@ -1245,7 +1247,7 @@
         } else if (dataSourceType.equals(DataSourceType.LCIO_FILE)) {
             try {
                 eventProcessing.setRecordSource(new LCIOEventSource(new File(filePath)));
-                log(Level.FINE, "LCIO file < " + filePath + " >");
+                log(Level.FINE, "LCIO file <" + filePath + ">");
             } catch (IOException e) {
                 errorHandler.setError(e)
                     .log()
@@ -1289,7 +1291,7 @@
 
         // Save final AIDA file if option is selected.
         if (getJobSettingsPanel().isAidaAutoSaveEnabled()) {
-            log(Level.INFO, "Saving AIDA file < " + getJobSettingsPanel().getAidaAutoSaveFileName() + " >");
+            log(Level.INFO, "Saving AIDA file <" + getJobSettingsPanel().getAidaAutoSaveFileName() + ">");
             try {
                 AIDA.defaultInstance().saveAs(getJobSettingsPanel().getAidaAutoSaveFileName());
             } catch (IOException e) {
@@ -1483,7 +1485,7 @@
         int r = fc.showDialog(mainPanel, "Load ...");
         if (r == JFileChooser.APPROVE_OPTION) {
             File f = fc.getSelectedFile();
-            log(Level.CONFIG, "Loading settings from file < " + f.getPath() + " >");
+            log(Level.CONFIG, "Loading settings from file <" + f.getPath() + ">");
             Configuration newConfig = new Configuration(f);
             this.set(newConfig);
             this.load(config);
@@ -1497,7 +1499,7 @@
         int r = fc.showSaveDialog(mainPanel);
         if (r == JFileChooser.APPROVE_OPTION) {
             File f = fc.getSelectedFile();
-            log(Level.CONFIG, "Saving configuration to file < " + f.getPath() + " >");
+            log(Level.CONFIG, "Saving configuration to file <" + f.getPath() + ">");
             config.writeToFile(f);            
         }
     }
@@ -1518,9 +1520,9 @@
         }
         
         if (config.getFile() != null)
-            log(Level.CONFIG, "Loaded config from file < " + config.getFile().getPath() + " >");
+            log(Level.CONFIG, "Loaded config from file <" + config.getFile().getPath() + ">");
         else 
-            log(Level.CONFIG, "Loaded config resource < " + config.getResourcePath() + " >");
+            log(Level.CONFIG, "Loaded config resource <" + config.getResourcePath() + ">");
     }
 
     private void addConfigurables() {
@@ -1557,8 +1559,8 @@
     }
     
     public void loadDefaultConfigFile() {
-        log(Level.CONFIG, "Loading default config file from resource < " + DEFAULT_CONFIG_RESOURCE + " >");
+        log(Level.CONFIG, "Loading default config file from resource <" + DEFAULT_CONFIG_RESOURCE + ">");
         set(new Configuration(DEFAULT_CONFIG_RESOURCE));
-        load(config);        
+        load(config);
     }
 }
\ No newline at end of file

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui
SystemStatusFrame.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/SystemStatusFrame.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/SystemStatusFrame.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -1,21 +1,27 @@
 package org.hps.monitoring.gui;
 
 import static org.hps.monitoring.gui.SystemStatusTableModel.ACTIVE_COL;
+import static org.hps.monitoring.gui.SystemStatusTableModel.CLEARABLE_COL;
 import static org.hps.monitoring.gui.SystemStatusTableModel.LAST_CHANGED_COL;
+import static org.hps.monitoring.gui.SystemStatusTableModel.RESET_COL;
 import static org.hps.monitoring.gui.SystemStatusTableModel.STATUS_COL;
 import static org.hps.monitoring.gui.SystemStatusTableModel.SYSTEM_COL;
 
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import javax.swing.JButton;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
 import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
 
 import org.hps.monitoring.enums.StatusCode;
 
@@ -29,9 +35,11 @@
 
     int WIDTH = 650;
     int HEIGHT = ScreenUtil.getScreenHeight() / 2;
-
+        
     SystemStatusFrame() {
         table = new JTable(new SystemStatusTableModel());
+        
+        // Rendering of system status cells using different background colors.
         table.getColumnModel().getColumn(SystemStatusTableModel.STATUS_COL).setCellRenderer(new DefaultTableCellRenderer() {
 
             @Override
@@ -45,25 +53,30 @@
                 if (statusCode.ordinal() >= StatusCode.ERROR.ordinal()) {
                     // Any type of error is red.
                     label.setBackground(Color.RED);
-                } else if (statusCode.ordinal() == StatusCode.WARNING.ordinal()) {
+                } else if (statusCode.equals(StatusCode.WARNING)) {
                     // Warnings are yellow.
                     label.setBackground(Color.YELLOW);
-                } else if (statusCode.ordinal() == StatusCode.OKAY.ordinal()) {
+                } else if (statusCode.equals(StatusCode.OKAY)) {
                     // Okay is green.
                     label.setBackground(Color.GREEN);
-                } else if (statusCode.ordinal() == StatusCode.OFFLINE.ordinal()) {
+                } else if (statusCode.equals(StatusCode.OFFLINE)) {
                     // Offline is orange.
                     label.setBackground(Color.ORANGE);
-                } else if (statusCode.ordinal() == StatusCode.UNKNOWN.ordinal()) {
+                } else if (statusCode.equals(StatusCode.UNKNOWN)) {
                     // Unknown is gray.
                     label.setBackground(Color.GRAY);
+                } else if (statusCode.equals(StatusCode.CLEARED)) {
+                    // Cleared is light gray.
+                    label.setBackground(Color.LIGHT_GRAY);
                 } else {
-                    // Default is white, though this shouldn't ever happen!
+                    // Default is white, though this shouldn't happen!
                     label.setBackground(Color.WHITE);
                 }
                 return label;
             }
         });
+        
+        // Date formatting for last changed.
         table.getColumnModel().getColumn(LAST_CHANGED_COL).setCellRenderer(new DefaultTableCellRenderer() {
 
             final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM-dd-yyyy HH:mm:ss.SSS");
@@ -76,14 +89,25 @@
                 return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
             }
         });
+        
+        // Button for clearing system statuses.
+        table.getColumnModel().getColumn(RESET_COL).setCellRenderer(new ButtonRenderer("Clear"));
+        table.addMouseListener(new JTableButtonMouseListener(table));
+        table.getColumn("Clearable").setWidth(0);
+        table.getColumn("Clearable").setMinWidth(0);
+        table.getColumn("Clearable").setMaxWidth(0);
+        
+        // Column widths.
         table.getColumnModel().getColumn(ACTIVE_COL).setPreferredWidth(8);
         table.getColumnModel().getColumn(STATUS_COL).setPreferredWidth(10);
         table.getColumnModel().getColumn(SYSTEM_COL).setPreferredWidth(10);
         // TODO: Add widths for every column.
-
+                
+        // Scroll pane.
         JScrollPane scrollPane = new JScrollPane(table);
         scrollPane.setOpaque(true);
 
+        // Additional config.
         setMinimumSize(new Dimension(WIDTH, HEIGHT));
         setTitle("System Status Monitor");
         setContentPane(scrollPane);
@@ -105,4 +129,47 @@
     public SystemStatusTableModel getTableModel() {
         return (SystemStatusTableModel) table.getModel();
     }
+    
+    /**
+     * Renders a button if the status is clearable.
+     */
+    private class ButtonRenderer extends JButton implements TableCellRenderer {
+                
+        public ButtonRenderer(String label) {
+            this.setText(label);
+        }
+
+        public Component getTableCellRendererComponent(
+                JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {            
+            boolean clearable = (Boolean)table.getModel().getValueAt(row, CLEARABLE_COL);
+            if (clearable)
+                return this;
+            else 
+                return null;
+        }
+    }
+    
+    /**
+     * Fires a mouse click event when the clear button is pressed, which in turn
+     * will activate the action event for the button.  The <code>ActionListener</code> 
+     * then sets the <code>StatusCode</code> to <code>CLEARED</code>.
+     */
+    private static class JTableButtonMouseListener extends MouseAdapter {
+        private final JTable table;
+        
+        public JTableButtonMouseListener(JTable table) {
+            this.table = table;
+        }
+
+        public void mouseClicked(MouseEvent e) {
+            int column = table.getColumnModel().getColumnIndexAtX(e.getX());
+            int row = e.getY() / table.getRowHeight(); 
+            if (row < table.getRowCount() && row >= 0 && column < table.getColumnCount() && column >= 0) {
+                Object value = table.getValueAt(row, column);
+                if (value instanceof JButton) {
+                    ((JButton)value).doClick();
+                }
+            }
+        }
+    }          
 }
\ No newline at end of file

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui
SystemStatusTableModel.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/SystemStatusTableModel.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/SystemStatusTableModel.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -1,12 +1,16 @@
 package org.hps.monitoring.gui;
 
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
+import javax.swing.JButton;
 import javax.swing.table.AbstractTableModel;
 
+import org.hps.monitoring.enums.StatusCode;
 import org.hps.monitoring.subsys.SystemStatus;
 import org.hps.monitoring.subsys.SystemStatusListener;
 
@@ -16,23 +20,27 @@
  */
 public class SystemStatusTableModel extends AbstractTableModel implements SystemStatusListener {
 
-    static final int ACTIVE_COL = 0;
-    static final int STATUS_COL = 1;
-    static final int SYSTEM_COL = 2;
-    static final int DESCRIPTION_COL = 3;
-    static final int MESSAGE_COL = 4;
-    static final int LAST_CHANGED_COL = 5;
+    static final int RESET_COL = 0;
+    static final int ACTIVE_COL = 1;
+    static final int STATUS_COL = 2;
+    static final int SYSTEM_COL = 3;
+    static final int DESCRIPTION_COL = 4;
+    static final int MESSAGE_COL = 5;
+    static final int LAST_CHANGED_COL = 6;
+    static final int CLEARABLE_COL = 7;
             
     static final String[] columnNames = {
+            "Reset",
             "Active",
             "Status",
             "System",       
             "Description",
             "Message", 
-            "Last Changed"
+            "Last Changed",
+            "Clearable"
     };
     
-    List<SystemStatus> statuses = new ArrayList<SystemStatus>();    
+    List<SystemStatus> statuses = new ArrayList<SystemStatus>();
     final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM-dd-yyyy HH:mm:ss.SSS");
     
     public void addSystemStatus(SystemStatus status) {
@@ -57,7 +65,7 @@
     }
 
     @Override
-    public Object getValueAt(int rowIndex, int columnIndex) {
+    public Object getValueAt(final int rowIndex, final int columnIndex) {
         SystemStatus status = statuses.get(rowIndex);
         switch (columnIndex) {
             case ACTIVE_COL:
@@ -72,6 +80,30 @@
                 return status.getMessage();
             case LAST_CHANGED_COL:
                 return new Date(status.getLastChangedMillis());
+            case RESET_COL:
+                // If the status is clearable, then it has a button that can be used to
+                // manually set the state to CLEARED.  If the status is not clearable,
+                // then nothing is rendered in this cell.
+                if (status.isClearable()) {
+                    final JButton button = new JButton();
+                    button.addActionListener(new ActionListener() {
+                        public void actionPerformed(ActionEvent e) {                            
+                            SystemStatus status = statuses.get(rowIndex);
+                            // Only clearable statuses can have this state set.  Check for this
+                            // just to be safe, even though no button is available for non-clearable
+                            // statuses.
+                            if (status.isClearable()) {
+                                StatusCode oldStatusCode = status.getStatusCode();
+                                status.setStatus(StatusCode.CLEARED, "Cleared from " + oldStatusCode.name() + " state.");
+                            }
+                        }
+                    });
+                    return button;
+                } else {
+                    return null;
+                }                
+            case CLEARABLE_COL:
+                return status.isClearable();
             default:
                 return null;
         }
@@ -92,7 +124,7 @@
     @Override
     public boolean isCellEditable(int row, int col) {
         if (col == ACTIVE_COL)
-            return true;
+            return true;        
         else 
             return false;
     }
@@ -106,13 +138,12 @@
     public void clear() {
         statuses.clear();
         fireTableDataChanged();
-    }    
+    }
     
     @Override
     public void setValueAt(Object value, int row, int col) {
         if (col == ACTIVE_COL) {
             statuses.get(row).setActive((Boolean) value);
         }
-    }
-    
+    }    
 }

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys
SystemStatus.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/SystemStatus.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/SystemStatus.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -74,4 +74,10 @@
      * @return True if status is active.
      */
     boolean isActive();
+    
+    /**
+     * True if the status can be cleared.
+     * @return True if status can be cleared.
+     */
+    boolean isClearable();
 }

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys
SystemStatusImpl.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/SystemStatusImpl.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/SystemStatusImpl.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -18,10 +18,18 @@
     final Subsystem systemName;
     final String description;
     boolean active = true;
+    final boolean clearable;
     
-    public SystemStatusImpl(Subsystem systemName, String description) {
+    /**
+     * Fully qualified constructor.
+     * @param systemName The enum specifiying the system being monitored.
+     * @param description A description of this specific status monitor.
+     * @param clearable True if this status can be cleared.
+     */
+    public SystemStatusImpl(Subsystem systemName, String description, boolean clearable) {
         this.systemName = systemName;
         this.description = description;
+        this.clearable = clearable;
         setLastChangedTime();
         SystemStatusRegistry.getSystemStatusRegistery().register(this);
     }
@@ -48,11 +56,12 @@
 
     @Override
     public void setStatus(StatusCode code, String message) {
-        this.code = code;
-        this.message = message;
-        setLastChangedTime();
-        if (isActive())
+        if (isActive()) {
+            this.code = code;
+            this.message = message;
+            setLastChangedTime();
             notifyListeners();
+        }
     }
 
     @Override
@@ -87,4 +96,9 @@
     public boolean isActive() {
         return active;
     }
+    
+    @Override 
+    public boolean isClearable() {
+        return clearable;
+    }
 }

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/et
EtSystemMonitor.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/et/EtSystemMonitor.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/et/EtSystemMonitor.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -22,7 +22,7 @@
     Timer timer = new Timer("ET Event Monitor");
     
     public EtSystemMonitor() {
-        systemStatus = new SystemStatusImpl(Subsystem.ET, "Example ET Monitor");
+        systemStatus = new SystemStatusImpl(Subsystem.ET, "Example ET Monitor", false);
         systemStatus.setStatus(StatusCode.UNKNOWN, "System is not active yet.");
     }
     

java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/svt
BasicHitMonitoringDriver.java 830 -> 831
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/svt/BasicHitMonitoringDriver.java	2014-07-29 20:00:51 UTC (rev 830)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/subsys/svt/BasicHitMonitoringDriver.java	2014-07-29 22:02:20 UTC (rev 831)
@@ -25,7 +25,7 @@
     static final String hitsCollectionName = "SVTRawTrackerHits";
                 
     public BasicHitMonitoringDriver() {
-        status = new SystemStatusImpl(Subsystem.SVT, "Checks that SVT hits are received.");
+        status = new SystemStatusImpl(Subsystem.SVT, "Checks that SVT hits are received.", true);
         status.setStatus(StatusCode.UNKNOWN, "Status is unknown.");
     }
     
SVNspam 0.1