LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  May 2015

HPS-SVN May 2015

Subject:

r2958 - in /java/trunk: monitoring-app/src/main/java/org/hps/monitoring/application/ monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/ monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Tue, 12 May 2015 10:13:53 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (191 lines)

Author: [log in to unmask]
Date: Tue May 12 03:13:41 2015
New Revision: 2958

Log:
use clear/replot to update plot ranges

Modified:
    java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/SystemStatusPanel.java
    java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SensorOccupancyPlotsDriver.java
    java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalMonitoringPlots.java

Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/SystemStatusPanel.java
 =============================================================================
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/SystemStatusPanel.java	(original)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/application/SystemStatusPanel.java	Tue May 12 03:13:41 2015
@@ -4,17 +4,24 @@
 package org.hps.monitoring.application;
 
 import java.awt.BorderLayout;
+import java.awt.Toolkit;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Timer;
+import java.util.TimerTask;
 
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JSplitPane;
 
 import org.hps.monitoring.application.SystemStatusEventsTable.SystemStatusEventsTableModel;
+import org.hps.monitoring.subsys.StatusCode;
 import org.hps.monitoring.subsys.SystemStatus;
 
 /**
- * This is a panel showing the two tables for viewing the system statuses, one showing the current state of all system
- * status monitors and the other with all system status change events.
+ * This is a panel showing the two tables for viewing the system statuses, one
+ * showing the current state of all system status monitors and the other with
+ * all system status change events.
  *
  * @author <a href="mailto:[log in to unmask]">Jeremy McCormick</a>
  */
@@ -32,6 +39,13 @@
     private final SystemStatusTable statusTable = new SystemStatusTable();
 
     /**
+     * The list of statuses to check.
+     */
+    private final List<SystemStatus> statuses = new ArrayList<SystemStatus>();
+
+    private final Timer timer = new Timer("System Status Beeper");
+
+    /**
      * Class constructor.
      */
     SystemStatusPanel() {
@@ -40,6 +54,7 @@
                 new JScrollPane(this.eventsTable));
         splitPane.setDividerLocation(150);
         this.add(splitPane, BorderLayout.CENTER);
+        timer.scheduleAtFixedRate(new SystemStatusBeeper(), 0, 1000);
     }
 
     /**
@@ -51,6 +66,7 @@
         // Register listeners of table models on this status.
         this.statusTable.getTableModel().addSystemStatus(status);
         this.eventsTable.getSystemStatusEventsTableModel().addSystemStatus(status);
+        this.statuses.add(status);
     }
 
     /**
@@ -63,4 +79,20 @@
         // Clear the system status events table.
         ((SystemStatusEventsTableModel) this.eventsTable.getModel()).clear();
     }
+
+    private class SystemStatusBeeper extends TimerTask {
+
+        @Override
+        public void run() {
+            boolean isAlarming = false;
+            for (SystemStatus status : statuses) {
+                if (status.getStatusCode() == StatusCode.ALARM) {
+                    isAlarming = true;
+                }
+            }
+            if (isAlarming) {
+                System.out.println("beep\007");
+            }
+        }
+    }
 }

Modified: java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SensorOccupancyPlotsDriver.java
 =============================================================================
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SensorOccupancyPlotsDriver.java	(original)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/drivers/svt/SensorOccupancyPlotsDriver.java	Tue May 12 03:13:41 2015
@@ -528,17 +528,17 @@
                     maxSampleStatus.setStatus(StatusCode.ALARM, "Sensor " + sensor.getName() + " looks out of time.");
                 }
                 IPlotterStyle plotterStyle = createOccupancyPlotStyle("Max Sample Number", sensor, true);
-//                region.clear();
-//                region.plot(maxSamplePlot, plotterStyle);
-                region.applyStyle(plotterStyle);
+                region.clear();
+                region.plot(maxSamplePlot, plotterStyle);
+//                region.applyStyle(plotterStyle);
 //                region.style().regionBoxStyle().backgroundStyle().setColor("246, 34, 34, 1");
 //                setBackgroundColor(region.style(),sensor.isAxial(),true);
 
             } else {
                 IPlotterStyle plotterStyle = createOccupancyPlotStyle("Max Sample Number", sensor, false);
-//                region.clear();
-//                region.plot(maxSamplePlot, plotterStyle);
-                region.applyStyle(plotterStyle);
+                region.clear();
+                region.plot(maxSamplePlot, plotterStyle);
+//                region.applyStyle(plotterStyle);
 //                setBackgroundColor(region.style(),sensor.isAxial(),false);
             }
         }
@@ -572,11 +572,15 @@
                     occupancyStatus.setStatus(StatusCode.ALARM, "Sensor " + sensor.getName() + " occupancy abnormal.");
                 }
                 IPlotterStyle plotterStyle = createOccupancyPlotStyle("Max Sample Number", sensor, true);
-                region.applyStyle(plotterStyle);
+                region.clear();
+                region.plot(occupancyPlot, plotterStyle);
+//                region.applyStyle(plotterStyle);
 
             } else {
                 IPlotterStyle plotterStyle = createOccupancyPlotStyle("Max Sample Number", sensor, false);
-                region.applyStyle(plotterStyle);
+                region.clear();
+                region.plot(occupancyPlot, plotterStyle);
+//                region.applyStyle(plotterStyle);
             }
         }
         if (isSystemOK) {

Modified: java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalMonitoringPlots.java
 =============================================================================
--- java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalMonitoringPlots.java	(original)
+++ java/trunk/monitoring-drivers/src/main/java/org/hps/monitoring/ecal/plots/EcalMonitoringPlots.java	Tue May 12 03:13:41 2015
@@ -166,10 +166,10 @@
             //System.out.println("Event: "+thisEventN+" "+prevEventN);
             //System.out.println("Time: "+thisEventTime+" "+prevEventTime);
             // System.out.println("Monitor: "+thisTime+" "+prevTime+" "+NoccupancyFill);
-
+if (scale>0) {
             hitCountFillPlot.scale(scale);
             clusterCountFillPlot.scale(scale);
-            redraw();
+            redraw();}
             prevTime=thisTime;
             prevEventN=thisEventN;
             prevEventTime=thisEventTime;
@@ -186,15 +186,15 @@
     void redraw() {
         hitCountDrawPlot.reset();
         hitCountDrawPlot.add(hitCountFillPlot);
-//        plotter.region(0).clear();
-//        plotter.region(0).plot(hitCountDrawPlot);
+        plotter.region(0).clear();
+        plotter.region(0).plot(hitCountDrawPlot);
 //        plotter.region(0).refresh();
         hitCountFillPlot.reset();
 
         clusterCountDrawPlot.reset();
         clusterCountDrawPlot.add(clusterCountFillPlot);
-//        plotter.region(1).clear();
-//        plotter.region(1).plot(clusterCountDrawPlot);
+        plotter.region(1).clear();
+        plotter.region(1).plot(clusterCountDrawPlot);
 //        plotter.region(1).refresh();
         clusterCountFillPlot.reset();
 
@@ -208,8 +208,8 @@
             if ((row != 0) && (column != 0) && (!EcalMonitoringUtilities.isInHole(row, column)))
                 occupancyDrawPlot.fill(column, row, mean);
         }
-//        plotter.region(2).clear();
-//        if (occupancyDrawPlot.sumAllBinHeights()> 0) plotter.region(2).plot(occupancyDrawPlot);
+        plotter.region(2).clear();
+        if (occupancyDrawPlot.sumAllBinHeights()> 0) plotter.region(2).plot(occupancyDrawPlot);
 //        plotter.region(2).refresh();
     }
 

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use