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:

r2887 - in /java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger: ShifterTrigPanel.java ShifterTrigWindow.java

From:

[log in to unmask]

Reply-To:

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

Date:

Sun, 3 May 2015 07:57:37 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (108 lines)

Author: [log in to unmask]
Date: Sun May  3 00:57:26 2015
New Revision: 2887

Log:
Added JavaDocs to files and fixed a minor font color issue.

Modified:
    java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ShifterTrigPanel.java
    java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ShifterTrigWindow.java

Modified: java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ShifterTrigPanel.java
 =============================================================================
--- java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ShifterTrigPanel.java	(original)
+++ java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ShifterTrigPanel.java	Sun May  3 00:57:26 2015
@@ -22,6 +22,10 @@
 	private JLabel[] fieldTitle;
 	private JLabel[] fieldValue;
 	
+	/**
+	 * Instantiates a new <code>ShifterTrigPanel</code> with the
+	 * indicated name.
+	 */
 	public ShifterTrigPanel(String name) {
 		// Instantiate a layout for the fields.
 		SpringLayout layout = new SpringLayout();
@@ -172,6 +176,12 @@
 		}
 	}
 	
+	/**
+	 * Updates the panel statistical display with data from the
+	 * argument snapshot.
+	 * @param stat - The snapshot from which to derive statistical
+	 *               data.
+	 */
 	public void updatePanel(DiagnosticSnapshot stat) {
 		// If the snapshot is null, insert "null" values in the
 		// field panels,
@@ -234,6 +244,23 @@
                 processEfficiency(seenPairTriggers[SSP][TRIGGER_1],   matchedPairTriggers[SSP][TRIGGER_1],   8, spaces, 0.99, 0.95);
 	}
 	
+	/**
+	 * Updates the indicated field value using the indicated number
+	 * seen and matched elements. Automatically handles the special
+	 * case of zero seen elements and also updates the colors of the
+	 * field labels to the appropriate color based on the efficiency
+	 * and the thresholds for warnings.
+	 * @param seen - The number of elements seen.
+	 * @param matched - The number of elements matched.
+	 * @param fieldIndex - The index for the field that should display
+	 *                     the statistical data.
+	 * @param spaces - The number of spaces to giveto each displayed
+	 *                 value.
+	 * @param threshWarning - The threshold at which the "warning
+	 *                        color should be used.
+	 * @param threshCritical - The threshold at which the "critical"
+	 *                         color should be used.
+	 */
 	private void processEfficiency(int seen, int matched, int fieldIndex, int spaces, double threshWarning, double threshCritical) {
 		// Calculate the efficiency.
 		double efficiency = 100.0 * matched / seen;
@@ -267,6 +294,9 @@
 		}
 		
 		// Otherwise, use the default component background.
-		else { fieldValue[fieldIndex].setBackground(getBackground()); }
+		else {
+			fieldValue[fieldIndex].setBackground(getBackground());
+			fieldValue[fieldIndex].setForeground(getForeground());
+		}
 	}
 }

Modified: java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ShifterTrigWindow.java
 =============================================================================
--- java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ShifterTrigWindow.java	(original)
+++ java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ShifterTrigWindow.java	Sun May  3 00:57:26 2015
@@ -5,16 +5,26 @@
 import java.awt.GridLayout;
 
 import javax.swing.JPanel;
-
+/**
+ * Class <code>ShifterTrigWindow</code> displays basic efficiency data
+ * for clustering and each of the four data triggers for both the entire
+ * run and for a local time window. The data displays will change color
+ * to either yellow or red if the efficiencies drop too low.
+ */
 public class ShifterTrigWindow extends JPanel implements DiagnosticUpdatable {
 	private static final long serialVersionUID = 1L;
 	private ShifterTrigPanel localPanel = new ShifterTrigPanel("Instantaneous");
 	private ShifterTrigPanel globalPanel = new ShifterTrigPanel("Run-Integrated");
 	
+	/**
+	 * Instantiates a new panel for displaying basic information
+	 * pertaining to trigger diagnostics.
+	 */
 	public ShifterTrigWindow() {
 		setLayout(new GridLayout(1, 2));
 		add(localPanel);
 		add(globalPanel);
+		updatePanel(null, null);
 	}
 	
 	@Override

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