Commit in hps-java/src/main/java/org/lcsim/hps on MAIN | |||
monitoring/svt/SVTSimpleEventDisplay.java | +7 | -6 | 1.12 -> 1.13 |
/SVTHitPulsePlots.java | +1 | -1 | 1.18 -> 1.19 |
/SVTHitRecoCorrelations.java | +1 | -1 | 1.10 -> 1.11 |
/SVTHitReconstructionPlots.java | +1 | -1 | 1.21 -> 1.22 |
/SVTPulseFitPlots.java | +1 | -1 | 1.7 -> 1.8 |
/TrackTimePlots.java | +1 | -1 | 1.5 -> 1.6 |
/TrackingReconstructionPlots.java | +1 | -1 | 1.19 -> 1.20 |
/SensorOccupancyPlotsDriver.java | +2 | -2 | 1.7 -> 1.8 |
/SVTEventInfo.java | +1 | -1 | 1.8 -> 1.9 |
monitoring/ecal/TriggerPlots.java | +2 | -2 | 1.11 -> 1.12 |
/EcalHitPlots.java | +1 | -1 | 1.11 -> 1.12 |
/EcalClusterPlots.java | +1 | -1 | 1.11 -> 1.12 |
/EcalDaqPlots.java | +1 | -1 | 1.7 -> 1.8 |
/EcalPedestalPlots.java | +2 | -2 | 1.14 -> 1.15 |
/EcalMonitoringPlots.java | +2 | -2 | 1.10 -> 1.11 |
users/omoreno/SvtTrackingPerformance.java | +2 | -2 | 1.1 -> 1.2 |
/SvtTrackAnalysis.java | +2 | -2 | 1.6 -> 1.7 |
users/mgraham/ElwinsTrackingRecon.java | +1 | -1 | 1.4 -> 1.5 |
/ExamplePlotter.java | +1 | -1 | 1.5 -> 1.6 |
/HitTimePlotter.java | +1 | -1 | 1.2 -> 1.3 |
/TwoTrackAnalysis.java | +1 | -1 | 1.5 -> 1.6 |
monitoring/MonitoringAnalysisFactory.java | +11 | -13 | 1.2 -> 1.3 |
/MonitoringApplication.java | +218 | -226 | 1.59 -> 1.60 |
/MonitoringPlotFactory.java | +45 | -26 | 1.4 -> 1.5 |
/Resettable.java | -13 | 1.1 removed | |
/Redrawable.java | -11 | 1.1 removed | |
users/sarah/ExamplePlotter.java | +1 | -1 | 1.2 -> 1.3 |
users/phansson/ECalGainDriver.java | +2 | -2 | 1.17 -> 1.18 |
monitoring/deprecated/Resettable.java | +14 | added 1.1 | |
/Redrawable.java | +13 | added 1.1 | |
recon/ecal/EcalCrystalFilter.java | +2 | -2 | 1.8 -> 1.9 |
+339 | -326 |
switch to JFree backend for development; deprecate some Driver-based interfaces for now until I decide what to do with them
diff -u -r1.12 -r1.13 --- SVTSimpleEventDisplay.java 25 Oct 2013 20:24:05 -0000 1.12 +++ SVTSimpleEventDisplay.java 6 Nov 2013 19:19:55 -0000 1.13 @@ -3,6 +3,7 @@
import hep.aida.IHistogram1D; import hep.aida.IPlotter; import hep.aida.IPlotterFactory;
+import hep.aida.jfree.plot.style.DefaultHistogram1DStyle;
import java.util.List;
@@ -10,7 +11,7 @@
import org.lcsim.event.RawTrackerHit; import org.lcsim.fit.helicaltrack.HelicalTrackHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.tracking.SvtUtils; import org.lcsim.recon.tracking.digitization.sisim.SiTrackerHit; import org.lcsim.util.Driver;
@@ -21,7 +22,7 @@
* This class can be configured to reset after each event for use as an * event display by calling {@link #setSingleEvent(boolean)}. *
- * @version $Id: SVTSimpleEventDisplay.java,v 1.12 2013/10/25 20:24:05 jeremy Exp $
+ * @version $Id: SVTSimpleEventDisplay.java,v 1.13 2013/11/06 19:19:55 jeremy Exp $
*/ public class SVTSimpleEventDisplay extends Driver implements Resettable {
@@ -135,7 +136,7 @@
private void setupHitCountPlots() { plotter4 = factory.create("Hit Counts"); plotter4.setTitle("Hit Counts");
- //plotter4.setStyle(new DefaultHistogram1DStyle());
+ plotter4.setStyle(new DefaultHistogram1DStyle());
plotter4.style().dataStyle().errorBarStyle().setVisible(false); plotter4.createRegions(1, 2);
@@ -148,7 +149,7 @@
private void setupHelicalTrackHitPlots() { plotter3 = factory.create("HelicalTrackHits"); plotter3.setTitle("HelicalTrackHits");
- //plotter3.setStyle(new DefaultHistogram1DStyle());
+ plotter3.setStyle(new DefaultHistogram1DStyle());
plotter3.style().dataStyle().errorBarStyle().setVisible(false); plotter3.style().statisticsBoxStyle().setVisible(false); plotter3.createRegions(4, 5);
@@ -157,7 +158,7 @@
private void setupTrackerHitPlots() { plotter2 = factory.create("TrackerHits"); plotter2.setTitle("TrackerHits");
- //plotter2.setStyle(new DefaultHistogram1DStyle());
+ plotter2.setStyle(new DefaultHistogram1DStyle());
plotter2.style().dataStyle().errorBarStyle().setVisible(false); plotter2.style().statisticsBoxStyle().setVisible(false); plotter2.createRegions(4, 5);
@@ -166,7 +167,7 @@
private void setupRawTrackerHitPlots() { plotter = factory.create("RawTrackerHits"); plotter.setTitle("RawTrackerHits");
- //plotter.setStyle(new DefaultHistogram1DStyle());
+ plotter.setStyle(new DefaultHistogram1DStyle());
plotter.style().dataStyle().errorBarStyle().setVisible(false); plotter.style().statisticsBoxStyle().setVisible(false); plotter.createRegions(4, 5);
diff -u -r1.18 -r1.19 --- SVTHitPulsePlots.java 25 Oct 2013 20:14:23 -0000 1.18 +++ SVTHitPulsePlots.java 6 Nov 2013 19:19:55 -0000 1.19 @@ -20,7 +20,7 @@
import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.10 -r1.11 --- SVTHitRecoCorrelations.java 25 Oct 2013 20:14:23 -0000 1.10 +++ SVTHitRecoCorrelations.java 6 Nov 2013 19:19:55 -0000 1.11 @@ -22,7 +22,7 @@
import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.recon.tracking.digitization.sisim.SiTrackerHitStrip1D; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.21 -r1.22 --- SVTHitReconstructionPlots.java 25 Oct 2013 20:14:23 -0000 1.21 +++ SVTHitReconstructionPlots.java 6 Nov 2013 19:19:55 -0000 1.22 @@ -23,7 +23,7 @@
import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.tracking.HPSFittedRawTrackerHit; import org.lcsim.hps.recon.tracking.SvtUtils; import org.lcsim.recon.tracking.digitization.sisim.SiTrackerHitStrip1D;
diff -u -r1.7 -r1.8 --- SVTPulseFitPlots.java 25 Oct 2013 20:14:23 -0000 1.7 +++ SVTPulseFitPlots.java 6 Nov 2013 19:19:55 -0000 1.8 @@ -14,7 +14,7 @@
import org.lcsim.detector.tracker.silicon.SiSensor; import org.lcsim.event.EventHeader; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.tracking.HPSFittedRawTrackerHit; import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants; import org.lcsim.hps.recon.tracking.HPSSVTConstants;
diff -u -r1.5 -r1.6 --- TrackTimePlots.java 25 Oct 2013 20:14:23 -0000 1.5 +++ TrackTimePlots.java 6 Nov 2013 19:19:55 -0000 1.6 @@ -14,8 +14,8 @@
import org.lcsim.fit.helicaltrack.HelicalTrackStrip; import org.lcsim.geometry.Detector; import org.lcsim.hps.evio.TriggerData;
-import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.tracking.SvtUtils; import org.lcsim.recon.tracking.digitization.sisim.SiTrackerHitStrip1D; import org.lcsim.util.Driver;
diff -u -r1.19 -r1.20 --- TrackingReconstructionPlots.java 25 Oct 2013 20:14:23 -0000 1.19 +++ TrackingReconstructionPlots.java 6 Nov 2013 19:19:55 -0000 1.20 @@ -14,8 +14,8 @@
import org.lcsim.geometry.Detector; import org.lcsim.geometry.IDDecoder; import org.lcsim.hps.event.BeamlineConstants;
-import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.HPSEcalCluster; import org.lcsim.hps.recon.vertexing.HelixConverter; import org.lcsim.hps.recon.vertexing.StraightLineTrack;
diff -u -r1.7 -r1.8 --- SensorOccupancyPlotsDriver.java 25 Oct 2013 20:14:23 -0000 1.7 +++ SensorOccupancyPlotsDriver.java 6 Nov 2013 19:19:55 -0000 1.8 @@ -17,7 +17,7 @@
import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
@@ -28,7 +28,7 @@
* to 20. * * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: SensorOccupancyPlotsDriver.java,v 1.7 2013/10/25 20:14:23 jeremy Exp $
+ * @version $Id: SensorOccupancyPlotsDriver.java,v 1.8 2013/11/06 19:19:55 jeremy Exp $
* */ public class SensorOccupancyPlotsDriver extends Driver implements Resettable {
diff -u -r1.8 -r1.9 --- SVTEventInfo.java 14 Aug 2012 01:02:07 -0000 1.8 +++ SVTEventInfo.java 6 Nov 2013 19:19:55 -0000 1.9 @@ -11,7 +11,7 @@
import org.lcsim.event.EventHeader; import org.lcsim.event.RawTrackerHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.tracking.SvtUtils; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.11 -r1.12 --- TriggerPlots.java 1 Nov 2013 19:23:53 -0000 1.11 +++ TriggerPlots.java 6 Nov 2013 19:19:55 -0000 1.12 @@ -10,8 +10,8 @@
import org.lcsim.event.EventHeader; import org.lcsim.geometry.Detector; import org.lcsim.hps.evio.TriggerData;
-import org.lcsim.hps.monitoring.Redrawable; -import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Redrawable; +import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.HPSEcalCluster; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.11 -r1.12 --- EcalHitPlots.java 25 Oct 2013 20:12:30 -0000 1.11 +++ EcalHitPlots.java 6 Nov 2013 19:19:55 -0000 1.12 @@ -10,7 +10,7 @@
import org.lcsim.event.EventHeader; import org.lcsim.geometry.Detector; import org.lcsim.hps.evio.TriggerData;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.ECalUtils; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.11 -r1.12 --- EcalClusterPlots.java 25 Oct 2013 20:12:30 -0000 1.11 +++ EcalClusterPlots.java 6 Nov 2013 19:19:55 -0000 1.12 @@ -12,7 +12,7 @@
import org.lcsim.event.EventHeader; import org.lcsim.geometry.Detector; import org.lcsim.hps.evio.TriggerData;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.ECalUtils; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.7 -r1.8 --- EcalDaqPlots.java 25 Feb 2013 22:39:24 -0000 1.7 +++ EcalDaqPlots.java 6 Nov 2013 19:19:55 -0000 1.8 @@ -14,7 +14,7 @@
import org.lcsim.event.RawTrackerHit; import org.lcsim.geometry.Detector; import org.lcsim.geometry.compact.Subdetector;
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.EcalConditions; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.14 -r1.15 --- EcalPedestalPlots.java 25 Oct 2013 20:12:30 -0000 1.14 +++ EcalPedestalPlots.java 6 Nov 2013 19:19:55 -0000 1.15 @@ -21,8 +21,8 @@
import org.lcsim.event.RawTrackerHit; import org.lcsim.event.base.BaseRawCalorimeterHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Redrawable; -import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Redrawable; +import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.ECalUtils; import org.lcsim.hps.recon.ecal.EcalConditions; import org.lcsim.util.Driver;
diff -u -r1.10 -r1.11 --- EcalMonitoringPlots.java 5 Jun 2013 19:03:48 -0000 1.10 +++ EcalMonitoringPlots.java 6 Nov 2013 19:19:55 -0000 1.11 @@ -11,8 +11,8 @@
import org.lcsim.event.RawTrackerHit; import org.lcsim.event.base.BaseRawCalorimeterHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Redrawable; -import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Redrawable; +import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.HPSEcalCluster; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.1 -r1.2 --- SvtTrackingPerformance.java 12 Jun 2012 03:03:00 -0000 1.1 +++ SvtTrackingPerformance.java 6 Nov 2013 19:19:55 -0000 1.2 @@ -14,12 +14,12 @@
import org.lcsim.util.aida.AIDA; //--- hps-java ---//
-import org.lcsim.hps.monitoring.Resettable;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
/** * * @author Omar Moreno <[log in to unmask]>
- * @version $Id: SvtTrackingPerformance.java,v 1.1 2012/06/12 03:03:00 omoreno Exp $
+ * @version $Id: SvtTrackingPerformance.java,v 1.2 2013/11/06 19:19:55 jeremy Exp $
*/ public class SvtTrackingPerformance extends Driver implements Resettable {
diff -u -r1.6 -r1.7 --- SvtTrackAnalysis.java 25 Oct 2013 19:45:01 -0000 1.6 +++ SvtTrackAnalysis.java 6 Nov 2013 19:19:55 -0000 1.7 @@ -27,8 +27,8 @@
//--- hps-java ---//
-import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.HPSEcalCluster; import org.lcsim.hps.recon.tracking.HPSFittedRawTrackerHit; import org.lcsim.hps.recon.tracking.TrackUtils;
@@ -36,7 +36,7 @@
/** * * @author Omar Moreno
- * @version $Id: SvtTrackAnalysis.java,v 1.6 2013/10/25 19:45:01 jeremy Exp $
+ * @version $Id: SvtTrackAnalysis.java,v 1.7 2013/11/06 19:19:55 jeremy Exp $
* */
diff -u -r1.4 -r1.5 --- ElwinsTrackingRecon.java 25 Oct 2013 19:43:35 -0000 1.4 +++ ElwinsTrackingRecon.java 6 Nov 2013 19:19:56 -0000 1.5 @@ -19,8 +19,8 @@
import org.lcsim.geometry.Detector; import org.lcsim.geometry.IDDecoder; import org.lcsim.hps.event.BeamlineConstants;
-import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.HPSEcalCluster; import org.lcsim.hps.recon.tracking.*; import org.lcsim.hps.recon.vertexing.HelixConverter;
diff -u -r1.5 -r1.6 --- ExamplePlotter.java 25 Oct 2013 19:43:35 -0000 1.5 +++ ExamplePlotter.java 6 Nov 2013 19:19:56 -0000 1.6 @@ -16,8 +16,8 @@
import org.lcsim.fit.helicaltrack.HelicalTrackFit; import org.lcsim.geometry.Detector; import org.lcsim.hps.event.BeamlineConstants;
-import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.tracking.HPSTrack; import org.lcsim.hps.recon.vertexing.HelixConverter; import org.lcsim.hps.recon.vertexing.StraightLineTrack;
diff -u -r1.2 -r1.3 --- HitTimePlotter.java 25 Oct 2013 19:44:04 -0000 1.2 +++ HitTimePlotter.java 6 Nov 2013 19:19:56 -0000 1.3 @@ -16,8 +16,8 @@
import org.lcsim.fit.helicaltrack.HelicalTrackFit; import org.lcsim.fit.helicaltrack.HelicalTrackHit; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.readout.ecal.ReadoutTimestamp; import org.lcsim.hps.recon.tracking.HPSSVTCalibrationConstants; import org.lcsim.hps.recon.tracking.HPSTrack;
diff -u -r1.5 -r1.6 --- TwoTrackAnalysis.java 25 Oct 2013 19:43:35 -0000 1.5 +++ TwoTrackAnalysis.java 6 Nov 2013 19:19:56 -0000 1.6 @@ -26,8 +26,8 @@
import org.lcsim.fit.helicaltrack.HelicalTrackHit; import org.lcsim.geometry.Detector; import org.lcsim.hps.event.BeamlineConstants;
-import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.tracking.HPSTrack; import org.lcsim.hps.recon.vertexing.HelixConverter; import org.lcsim.hps.recon.vertexing.StraightLineTrack;
diff -u -r1.2 -r1.3 --- MonitoringAnalysisFactory.java 5 Jun 2013 19:06:43 -0000 1.2 +++ MonitoringAnalysisFactory.java 6 Nov 2013 19:19:56 -0000 1.3 @@ -3,19 +3,20 @@
import hep.aida.IPlotterFactory; import hep.aida.ref.AnalysisFactory;
-import java.util.HashMap; -import java.util.Map; -
/**
+ * This class implements the AIDA <code>IAnalysisFactory</code> for the monitoring application, + * so that plots are automatically rendered into its tabs. Its primary function is overriding + * {@link #createPlotterFactory()} and {@link #createPlotterFactory(String)} to return a custom + * <code>IPlotterFactory</code> object. + *
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: MonitoringAnalysisFactory.java,v 1.2 2013/06/05 19:06:43 jeremy Exp $
+ * @version $Id: MonitoringAnalysisFactory.java,v 1.3 2013/11/06 19:19:56 jeremy Exp $
*/ public class MonitoringAnalysisFactory extends AnalysisFactory {
- - Map<String,IPlotterFactory> plotFactories = new HashMap<String,IPlotterFactory>(); -
+
/**
- * Register this class as the default AnalysisFactory for AIDA by setting the magic property string.
+ * Register this class as the default AnalysisFactory for AIDA by setting + * the magic property string.
*/ final static void register() { System.setProperty("hep.aida.IAnalysisFactory", MonitoringAnalysisFactory.class.getName());
@@ -25,12 +26,9 @@
* Create a named plotter factory for the monitoring application. */ public IPlotterFactory createPlotterFactory(String name) {
- if (plotFactories.get(name) == null) { - plotFactories.put(name, new MonitoringPlotFactory(name)); - } - return plotFactories.get(name);
+ return new MonitoringPlotFactory(name);
}
-
+
/** * Create an unnamed plotter factory for the monitoring application. */
diff -u -r1.59 -r1.60 --- MonitoringApplication.java 4 Oct 2013 06:02:19 -0000 1.59 +++ MonitoringApplication.java 6 Nov 2013 19:19:56 -0000 1.60 @@ -28,6 +28,7 @@
import static org.lcsim.hps.monitoring.MonitoringCommands.steeringFileCmd; import static org.lcsim.hps.monitoring.MonitoringCommands.steeringResourceCmd; import static org.lcsim.hps.monitoring.MonitoringCommands.updateTimeCmd;
+import hep.aida.jfree.AnalysisFactory;
import java.awt.AWTException; import java.awt.BorderLayout;
@@ -82,27 +83,32 @@
import org.apache.commons.cli.ParseException; import org.apache.commons.cli.PosixParser; import org.lcsim.hps.evio.LCSimEventBuilder;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.job.JobControlManager; import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA; /**
- * Monitoring application for HPS Test Run, which can run LCSim steering files - * on data converted from the ET ring. This class is accessible to users by - * calling its main() method. - *
+ * Monitoring application for HPS Test Run, which can run LCSim steering files on data + * converted from the ET ring. This class is accessible to users by calling its main() + * method.
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: MonitoringApplication.java,v 1.59 2013/10/04 06:02:19 jeremy Exp $
+ * @version $Id: MonitoringApplication.java,v 1.60 2013/11/06 19:19:56 jeremy Exp $
*/
-// FIXME: Review minimum size settings to see which are actually being respected. Remove where not needed. -// FIXME: Since this class is almost 2k lines, might want to refactor into multiple classes. -// TODO: Capture std err and out and redirect to a text panel within the app. -// TODO: Review use of Resettable and Redrawable to see if they can be removed and standard Driver API used instead.
+// FIXME: Review minimum size settings to see which are actually being respected. Remove +// where they are not needed. +// FIXME: Since this class is almost 2k lines, might want to refactor it into multiple +// classes. +// TODO: Capture std err and out and redirect to a text panel within the application. +// TODO: Review use of Resettable and Redrawable to see if they can be removed and the +// standard Driver API used instead. Resettable can maybe be replaced by startOfData(). +// TODO: Add JFreeChart backend support and make CL option to use it. +// FIXME: Tracebacks from errors should be caught and written into the log table.
public class MonitoringApplication { // Top-level Swing components. private JPanel mainPanel;
- private JPanel leftPanel;
+ private JPanel leftPanel;
private JPanel rightPanel; private JTabbedPane plotPane; private JTabbedPane tabs;
@@ -113,8 +119,9 @@
private JMenuBar menuBar; private EventButtonsPanel buttonsPanel; private JFrame frame;
- - // References to menu items that will be enabled/disabled depending on application state.
+ + // References to menu items that will be enabled/disabled depending on application + // state.
private JMenuItem connectItem; private JMenuItem disconnectItem; private JMenuItem resetConnectionItem;
@@ -128,70 +135,70 @@
private JMenuItem saveJobSettingsItem; private JMenuItem loadJobSettingsItem; private JMenuItem resetJobSettingsItem;
-
+
// Saved references to System.out and System.err in case need to reset. private final PrintStream sysOut = System.out; private final PrintStream sysErr = System.err;
-
+
// ET connection parameters and state. private ConnectionParameters connectionParameters; private EtConnection connection; private int connectionStatus = ConnectionStatus.DISCONNECTED;
-
+
// Event processing objects. private JobControlManager jobManager; private LCSimEventBuilder eventBuilder; private EtEventProcessor eventProcessor; private Thread eventProcessingThread;
-
+
// Job timing. private Timer timer; private long jobStartTime;
-
+
// ActionListener for GUI event dispatching. private ActionListener actionListener;
-
+
// Logging objects. private static Logger logger; private Handler logHandler; private DefaultTableModel logTableModel;
- static final String[] logTableColumns = {"Source", "Message", "Date", "Level"};
+ static final String[] logTableColumns = { "Source", "Message", "Date", "Level" };
private JTable logTable; private Level defaultLogMessageLevel = Level.INFO;
-
+
// Some default GUI size parameters. private final int logTableWidth = 700; private final int logTableHeight = 270;
-
+
// Format for screenshots. Hard-coded to PNG. private static final String screenshotFormat = "png";
-
+
// The AIDA remote server. private AIDAServer server;
-
+
// Listener for processing EtEvents. private EtEventListener etListener = new MonitoringApplicationEtListener();
-
+
// Maximum time in millis to wait for the ET system to disconnect. // TODO: Make this an option in the JobPanel. private int maxCleanupTime = 5000;
-
+
// Format of date field for log. private final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM-dd-yyyy HH:mm:ss.SSS"); private static final String LCSIM_FAIL_MESSAGE = "Failed to setup LCSim.";
-
+
private static final int screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width; private static final int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
- - private static final int leftPanelWidth = (int)(screenWidth * 0.33); - private static final int rightPanelWidth = (int)(screenWidth * 0.40); -
+ + private static final int leftPanelWidth = (int) (screenWidth * 0.33); + private static final int rightPanelWidth = (int) (screenWidth * 0.40); +
private static final int connectionStatusPanelHeight = 50; private static final int connectionStatusPanelWidth = 400;
-
+
/**
- * Constructor for the monitoring application. Users cannot access this. - * Call the main method instead.
+ * Constructor for the monitoring application. Users cannot access this. Call the main + * method instead.
*/ private MonitoringApplication() {
@@ -200,7 +207,7 @@
// Create the ActionEventListener for event dispatching. actionListener = new MonitoringApplicationActionListener();
-
+
// Setup the application menus. createMenu();
@@ -212,12 +219,13 @@
// Setup AIDA. setupAida();
-
+
// Log that the application started successfully.
- log("Application initialized successfully.");
+ log("Application initialized successfully.");
}
-
+
private void setupAida() {
+ AnalysisFactory.configure();
MonitoringAnalysisFactory.register(); MonitoringPlotFactory.setRootPane(plotPane); }
@@ -231,19 +239,22 @@
createLeftPanel(); createRightPanel(); }
-
+ + /** + * Create the left panel. + */
private void createLeftPanel() {
-
+
// Lefthand panel containing the three application tabs. leftPanel = new JPanel();
- // set border ex. - //leftPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); - //leftPanel.setBorder(BorderFactory.createEmptyBorder()); - leftPanel.setMinimumSize(new Dimension(leftPanelWidth, screenHeight-30));
+ // set border ex. + // leftPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); + // leftPanel.setBorder(BorderFactory.createEmptyBorder()); + leftPanel.setMinimumSize(new Dimension(leftPanelWidth, screenHeight - 30));
leftPanel.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints();
-
+
// Event processing buttons. c = new GridBagConstraints(); c.gridx = 0;
@@ -253,7 +264,7 @@
buttonsPanel = new EventButtonsPanel(); buttonsPanel.addActionListener(actionListener); leftPanel.add(buttonsPanel, c);
-
+
// Connection status panel. c.gridx = 0; c.gridy = 1;
@@ -290,7 +301,7 @@
c.weightx = c.weighty = 1.0; c.insets = new Insets(0, 0, 0, 10); leftPanel.add(tabsPanel, c);
-
+
// Layout attributes for left panel. c = new GridBagConstraints(); c.gridx = 0;
@@ -302,15 +313,18 @@
c.insets = new Insets(0, 5, 0, 0); mainPanel.add(leftPanel, c); }
-
+ + /** + * Create the right panel. + */
private void createRightPanel() {
-
+
// Create right-hand panel. rightPanel = new JPanel();
- rightPanel.setPreferredSize(new Dimension(rightPanelWidth, screenHeight-30)); - rightPanel.setMinimumSize(new Dimension(rightPanelWidth, screenHeight-30)); - rightPanel.setLayout(new BorderLayout()); -
+ rightPanel.setPreferredSize(new Dimension(rightPanelWidth, screenHeight - 30)); + rightPanel.setMinimumSize(new Dimension(rightPanelWidth, screenHeight - 30)); + rightPanel.setLayout(new BorderLayout()); +
// Create plot pane with empty tabs. plotPane = new JTabbedPane(); rightPanel.add(plotPane, BorderLayout.CENTER);
@@ -325,7 +339,10 @@
c.weighty = 1.0; mainPanel.add(rightPanel, c); }
-
+ + /** + * Create the menu items. + */
private void createMenu() { menuBar = new JMenuBar();
@@ -333,24 +350,25 @@
JMenu connectionMenu = new JMenu("Connection"); connectionMenu.setMnemonic(KeyEvent.VK_C); menuBar.add(connectionMenu);
-
+
connectItem = addMenuItem("Connect", KeyEvent.VK_C, connectCmd, true, "Connect to ET system using parameters from connection panel.", connectionMenu);
- disconnectItem = addMenuItem("Disconnect", KeyEvent.VK_D, disconnectCmd, false, "Disconnect from the current ET session.", connectionMenu);
+ disconnectItem = addMenuItem("Disconnect", KeyEvent.VK_D, disconnectCmd, false, "Disconnect from the current ET session.", connectionMenu);
resetConnectionItem = addMenuItem("Reset Connection Settings", KeyEvent.VK_R, resetConnectionSettingsCmd, true, "Reset connection settings to defaults.", connectionMenu);
- connectionLoadItem = addMenuItem("Load Connection...", KeyEvent.VK_L, loadConnectionCmd, true, "Load connection settings from a saved properties file.", connectionMenu);
+ connectionLoadItem = addMenuItem("Load Connection...", KeyEvent.VK_L, loadConnectionCmd, true, "Load connection settings from a saved properties file.", connectionMenu);
addMenuItem("Save Connection...", KeyEvent.VK_S, saveConnectionCmd, true, "Save connection settings to a properties file.", connectionMenu); addMenuItem("Exit", KeyEvent.VK_X, exitCmd, true, "Exit from the application.", connectionMenu); JMenu eventMenu = new JMenu("Event"); eventMenu.setMnemonic(KeyEvent.VK_E); menuBar.add(eventMenu);
-
+
addMenuItem("Reset Event Monitor", KeyEvent.VK_E, resetEventsCmd, true, "Reset timer and counters in the event monitor tab.", eventMenu); /**
- * FIXME: Rest of these should be converted to use the addMenuItem() helper method...
+ * FIXME: Rest of these should be converted to use the addMenuItem() helper + * method...
*/
-
+
JMenuItem eventRefreshItem = new JMenuItem("Set Event Refresh..."); eventRefreshItem.setMnemonic(KeyEvent.VK_V); eventRefreshItem.setActionCommand(eventRefreshCmd);
@@ -453,10 +471,20 @@
saveLogItem.addActionListener(actionListener); saveLogItem.setToolTipText("Save the log records to a tab delimited text file."); logMenu.add(saveLogItem);
-
+
addMenuItem("Clear log", KeyEvent.VK_C, clearLogTableCmd, true, "Clear the log table of all messages.", logMenu); }
-
+ + /** + * Add a menu item. + * @param label The label. + * @param mnemonic The single letter shortcut. + * @param cmd The command. + * @param enabled Whether it is enabled. + * @param tooltip The tooltip text. + * @param menu The menu to which it should be added. + * @return + */
private JMenuItem addMenuItem(String label, int mnemonic, String cmd, boolean enabled, String tooltip, JMenu menu) { JMenuItem item = new JMenuItem(label); item.setMnemonic(mnemonic);
@@ -477,26 +505,32 @@
* Puts log messages into the application's log table GUI component. */ public void publish(LogRecord record) {
- Object[] row = new Object[]{record.getLoggerName(), // source - record.getMessage(), // message - dateFormat.format(new Date(record.getMillis())), // date - record.getLevel()}; // level
+ Object[] row = new Object[] { record.getLoggerName(), // source + record.getMessage(), // message + dateFormat.format(new Date(record.getMillis())), // date + record.getLevel() }; // level
logTableModel.insertRow(logTable.getRowCount(), row); }
+ /** + * Close the handler (no-op). + */
public void close() throws SecurityException { }
+ /** + * Flush the handler (no-op). + */
public void flush() { } } /**
- * Creates the application's log table GUI component, which is a JTable - * containing messages from the logger.
+ * Creates the application's log table GUI component, which is a JTable containing + * messages from the logger.
*/ private void createLogTable() {
-
+
String data[][] = new String[0][0]; logTableModel = new DefaultTableModel(data, logTableColumns); logTable = new JTable(logTableModel);
@@ -515,8 +549,7 @@
} /**
- * Setup the application's Logger object for writing messages to the log - * table.
+ * Setup the application's Logger object for writing messages to the log table.
*/ private void setupLogger() { logger = Logger.getLogger(this.getClass().getSimpleName());
@@ -528,7 +561,6 @@
/** * Create the monitoring application frame and run it on a separate thread.
- *
* @return Reference to the created application. */ private static final MonitoringApplication createMonitoringApplication() {
@@ -543,7 +575,6 @@
/** * Run the monitoring application from the command line.
- *
* @param args The command line arguments. */ public static void main(String[] args) {
@@ -585,10 +616,18 @@
} }
+ /** + * Load connection settings from a file. + * @param file The properties file. + */
private void loadConnectionSettings(File file) { connectionPanel.loadPropertiesFile(file); }
+ /** + * Load job settings from a file. + * @param file The properties file. + */
private void loadJobSettings(File file) { try { jobPanel.setJobSettings(new JobSettings(file));
@@ -606,14 +645,19 @@
*/ private class MonitoringApplicationActionListener implements ActionListener {
+ /** + * Action handler method for the app. + * @param e The event to handle. + */
public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); if (cmd != MonitoringCommands.updateTimeCmd) {
- // Log actions performed. Catch errors in case logging is not initialized yet.
+ // Log actions performed. Catch errors in case logging is not initialized + // yet.
try { log(Level.FINEST, "Action performed <" + cmd + ">."); } catch (Exception xx) {
- xx.printStackTrace();
+ xx.printStackTrace();
} } if (connectCmd.equals(cmd)) {
@@ -677,13 +721,16 @@
} /**
- * This fires when a steering resource file is selected from the combo box. - * The Job Settings are changed to use a resource type.
+ * This fires when a steering resource file is selected from the combo box. The Job + * Settings are changed to use a resource type.
*/ private void steeringResourceSelected() { jobPanel.setSteeringType(JobPanel.RESOURCE); }
+ /** + * Save the job settings to a selected file. + */
private void saveJobSettings() { JFileChooser fc = new JFileChooser(); fc.setDialogTitle("Save Job Settings");
@@ -702,6 +749,9 @@
} }
+ /** + * Load job settings from a selected file. + */
private void loadJobSettings() { JFileChooser fc = new JFileChooser(); fc.setDialogTitle("Load Job Settings");
@@ -719,6 +769,9 @@
} }
+ /** + * Reset the job settings to the defaults. + */
private void resetJobSettings() { jobPanel.resetJobSettings(); // Redirect System.out and err back to the terminal.
@@ -726,8 +779,8 @@
} /**
- * This is the primary entry point for starting a monitoring session. The - * session is started on a new thread so it doesn't block.
+ * This is the primary entry point for starting a monitoring session. The session is + * started on a new thread so it doesn't block.
*/ private void startSessionThread() { if (getConnectionStatus() != ConnectionStatus.CONNECTED) {
@@ -744,8 +797,7 @@
} /**
- * Set a new log level for the application and also forward to the event - * processor.
+ * Set a new log level for the application and also forward to the event processor.
*/ private void setLogLevel() { Level newLevel = jobPanel.getLogLevel();
@@ -753,56 +805,9 @@
if (eventProcessor != null) { eventProcessor.setLogLevel(newLevel); }
-
+
log(Level.INFO, "Log Level was changed to <" + jobPanel.getLogLevel().toString() + ">."); }
- - /* - private class DisconnectDialog extends JDialog { - - static final String cmd = "done"; - volatile boolean done = false; - - DisconnectDialog() { - super((JFrame)null, "Disconnecting"); - setLayout(new GridBagLayout()); - GridBagConstraints c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 0; - c.fill = GridBagConstraints.NONE; - getContentPane().add(new JLabel("You are about to be disconnected."), c); - JButton b = new JButton("Ok"); - b.setActionCommand(cmd); - b.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent evt) { - if (evt.getActionCommand().equals(cmd)) { - done = true; - dispose(); - } - } - }); - c = new GridBagConstraints(); - c.gridx = 0; - c.gridy = 1; - c.fill = GridBagConstraints.NONE; - getContentPane().add(b, c); - pack(); - setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); - setModal(false); - //setMinimumSize(new Dimension(100, 100)); - setResizable(false); - setLocationRelativeTo(null); - setVisible(true); - toFront(); - } - - void waitForConfirm() { - while (!done) { - } - return; - } - } - */
/** * The listener for hooking into the event processor.
@@ -844,20 +849,21 @@
public void errorOnEvent() { eventPanel.updateBadEventCount(); }
-
+
/**
- * End of job actions. This cleans up the Monitoring Application to put - * it into the proper state for subsequent disconnection from the ET ring.
+ * End of job actions. This cleans up the Monitoring Application to put it into + * the proper state for subsequent disconnection from the ET ring.
*/ public void finish() { // Show a warning dialog box before disconnecting, if this option is selected.
- // This needs to go here rather than in disconnect() so that the LCSim plots stay up.
+ // This needs to go here rather than in disconnect() so that the LCSim plots + // stay up.
if (warnOnDisconnect()) { log(Level.FINEST, "Waiting for user to verify disconnect request.");
- showDialog("You are about to be disconnected."); - //DisconnectDialog d = new DisconnectDialog(); - //d.waitForConfirm();
+ showDialog("You are about to be disconnected."); + // DisconnectDialog d = new DisconnectDialog(); + // d.waitForConfirm();
} try {
@@ -891,7 +897,7 @@
if (server != null) { log(Level.INFO, "Closing remote AIDA server."); server.close();
- server = null;
+ server = null;
log(Level.INFO, "Remote AIDA server was closed."); } } catch (Exception e) {
@@ -925,7 +931,6 @@
/** * Set the connection status.
- *
* @param status The connection status. */ private void setConnectionStatus(int status) {
@@ -937,7 +942,6 @@
/** * Get the current connection status.
- *
* @return The connection status. */ private int getConnectionStatus() {
@@ -946,7 +950,6 @@
/** * Pop-up a modal dialog.
- *
* @param m The message to display in the dialog box. */ private void showDialog(String m) {
@@ -962,21 +965,21 @@
frame.setContentPane(mainPanel); frame.setJMenuBar(menuBar); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
- //frame.setMinimumSize(new Dimension(600, 850));
+ // frame.setMinimumSize(new Dimension(600, 850));
frame.setResizable(true); frame.pack();
- - // Maximize frame size. - //final GraphicsConfiguration config = frame.getGraphicsConfiguration(); - //final int left = Toolkit.getDefaultToolkit().getScreenInsets(config).left; - //final int right = Toolkit.getDefaultToolkit().getScreenInsets(config).right; - //final int top = Toolkit.getDefaultToolkit().getScreenInsets(config).top; - //final int bottom = Toolkit.getDefaultToolkit().getScreenInsets(config).bottom; - //final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - //final int width = screenSize.width - left - right; - //final int height = screenSize.height - top - bottom; - //frame.setSize(width,height); -
+ + // Maximize frame size. + // final GraphicsConfiguration config = frame.getGraphicsConfiguration(); + // final int left = Toolkit.getDefaultToolkit().getScreenInsets(config).left; + // final int right = Toolkit.getDefaultToolkit().getScreenInsets(config).right; + // final int top = Toolkit.getDefaultToolkit().getScreenInsets(config).top; + // final int bottom = Toolkit.getDefaultToolkit().getScreenInsets(config).bottom; + // final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + // final int width = screenSize.width - left - right; + // final int height = screenSize.height - top - bottom; + // frame.setSize(width,height); +
frame.setVisible(true); }
@@ -1020,7 +1023,6 @@
/** * Get the full title of the application.
- *
* @return The application title. */ private static String getApplicationTitle() {
@@ -1029,7 +1031,6 @@
/** * Get the hostname, which is used in the application title.
- *
* @return The hostname. */ private static String getHostname() {
@@ -1042,7 +1043,6 @@
/** * Get the user name, which is used in the application title.
- *
* @return The user name. */ private static String getUserName() {
@@ -1054,9 +1054,8 @@
} /**
- * Call the reset() method on Drivers which implement {@link Resettable}. - * They must implement the - * {@link Resettable} interface for this to work.
+ * Call the reset() method on Drivers which implement {@link Resettable}. They must + * implement the {@link Resettable} interface for this to work.
*/ private synchronized void resetDrivers() { if (jobManager != null) {
@@ -1074,9 +1073,9 @@
} /**
- * Redirect System.out and System.err to a file. This is primarily used to - * capture lengthy debug output from event processing. Messages sent to the - * Logger are unaffected.
+ * Redirect System.out and System.err to a file. This is primarily used to capture + * lengthy debug output from event processing. Messages sent to the Logger are + * unaffected.
*/ private void logToFile() { JFileChooser fc = new JFileChooser();
@@ -1106,7 +1105,7 @@
log("Redirected System output to file <" + logFile.getPath() + ">."); } catch (IOException e) {
- e.printStackTrace();
+ e.printStackTrace();
log(Level.SEVERE, "Error redirecting System output to file <" + logFile.getPath() + ">."); showDialog("Error redirecting System output to log file."); }
@@ -1114,6 +1113,11 @@
} }
+ /** + * Redirect <code>System.out</code> and <code>System.err</code> to a file. + * @param file The output log file. + * @throws FileNotFoundException if the file does not exist. + */
private void redirectStdOutAndErrToFile(File file) throws FileNotFoundException { PrintStream ps = new PrintStream(new FileOutputStream(file.getPath())); System.setOut(ps);
@@ -1121,9 +1125,9 @@
} /**
- * Redirect System.out and System.err back to the terminal, e.g. if they - * were previously sent to a file. This is independent of messages that are - * sent to the application's log table.
+ * Redirect <code>System.out</code> and <code>System.err</code> back to the terminal, + * e.g. if they were previously sent to a file. This is independent of messages that + * are sent to the application's log table.
*/ private void logToTerminal() { System.setOut(sysOut);
@@ -1152,15 +1156,15 @@
eventPanel.setEventRefresh(newEventRefresh); log("Event refresh set to <" + newEventRefresh + ">."); } catch (Exception e) {
- e.printStackTrace();
+ e.printStackTrace();
log(Level.WARNING, "Ignored invalid event refresh setting."); showDialog("The value " + inputValue + " is not valid for Event Refresh Rate."); } } /**
- * Using a modal dialog, set the maximum number of events to process before - * an automatic disconnect.
+ * Using a modal dialog, set the maximum number of events to process before an + * automatic disconnect.
*/ private void setMaxEvents() { String inputValue = JOptionPane.showInputDialog("Max Events:", eventPanel.getMaxEvents());
@@ -1178,15 +1182,15 @@
} log("Max events set to <" + newMaxEvents + ">."); } catch (Exception e) {
- e.printStackTrace();
+ e.printStackTrace();
log(Level.WARNING, "Ignored invalid max events setting <" + inputValue + ">."); showDialog("The value " + inputValue + " is not valid for Max Events."); } } /**
- * Set the GUI state to disconnected, which will enable/disable applicable - * GUI components and menu items.
+ * Set the GUI state to disconnected, which will enable/disable applicable GUI + * components and menu items.
*/ private void setDisconnectedGuiState() {
@@ -1216,8 +1220,8 @@
} /**
- * Set the GUI to connected state, which will enable/disable appropriate - * components and menu items.
+ * Set the GUI to connected state, which will enable/disable appropriate components + * and menu items.
*/ private void setConnectedGuiState() {
@@ -1276,7 +1280,6 @@
/** * Save a screenshot to an output file.
- *
* @param fileName The name of the output file. */ private void takeScreenshot(String fileName) {
@@ -1287,18 +1290,17 @@
BufferedImage image = robot.createScreenCapture(screenRectangle); ImageIO.write(image, screenshotFormat, new File(fileName)); } catch (AWTException e) {
- e.printStackTrace();
+ e.printStackTrace();
showDialog(e.getMessage()); } catch (IOException e) {
- e.printStackTrace();
+ e.printStackTrace();
showDialog(e.getMessage()); } } /**
- * Get the fully qualified class name of the current event builder for - * converting from EVIO to LCIO. - *
+ * Get the fully qualified class name of the current event builder for converting from + * EVIO to LCIO.
* @return The class name of the event builder. */ private String getEventBuilderClassName() {
@@ -1307,7 +1309,6 @@
/** * Get the type of steering file being used.
- *
* @return The type of the steering file. */ private int getSteeringType() {
@@ -1316,7 +1317,6 @@
/** * Get the current max events setting.
- *
* @return The maximum number of events to process before disconnect. */ private int getMaxEvents() {
@@ -1324,8 +1324,8 @@
} /**
- * Execute a monitoring session. This is executed in a separate thread so as - * not to block the GUI or other threads during a monitoring session.
+ * Execute a monitoring session. This is executed in a separate thread so as not to + * block the GUI or other threads during a monitoring session.
*/ private void session() {
@@ -1353,7 +1353,7 @@
try { eventProcessingThread.join(); } catch (InterruptedException e) {
- e.printStackTrace();
+ e.printStackTrace();
} log("Event processor finished with status <" + ConnectionStatus.toString(eventProcessor.getStatus()) + ">."); endStatus = eventProcessor.getStatus();
@@ -1391,7 +1391,6 @@
/** * Create the thread that will execute the EtEvent processing chain.
- *
* @return The thread on which event processing will occur. */ private void createEventProcessingThread() {
@@ -1402,7 +1401,8 @@
// Add the application's listener for callbacks to the GUI components. eventProcessor.addListener(this.etListener);
- // Set pause mode from JobPanel, after which it can be toggled using the event buttons.
+ // Set pause mode from JobPanel, after which it can be toggled using the event + // buttons.
eventProcessor.pauseMode(this.jobPanel.pauseMode()); // Create a new thread for event processing.
@@ -1421,8 +1421,7 @@
} /**
- * Connect to the ET system specified in the GUI's connection panel - * settings.
+ * Connect to the ET system specified in the GUI's connection panel settings.
*/ private void connect() {
@@ -1440,9 +1439,7 @@
} /**
- * Get the steering parameter, which is either a file path or resource - * string. - *
+ * Get the steering parameter, which is either a file path or resource string.
* @return The steering parameter. */ private String getSteering() {
@@ -1451,7 +1448,6 @@
/** * Get the name of the detector for conditions data.
- *
* @return The name of the detector. */ private String getDetectorName() {
@@ -1460,7 +1456,6 @@
/** * Get the connection parameter settings from the connection panel.
- *
* @return The connection parameters. */ private ConnectionParameters getConnectionParameters() {
@@ -1469,7 +1464,6 @@
/** * Get whether a warning dialog will open before disconnect.
- *
* @return True if warning will occur before disconnect; false if no. */ private boolean warnOnDisconnect() {
@@ -1478,7 +1472,6 @@
/** * Get whether errors in event processing will cause automatic disconnect.
- *
* @return True if disconnect on event processing error; false to continue. */ private boolean disconnectOnError() {
@@ -1491,7 +1484,6 @@
/** * Disconnect from the current ET session with a particular status.
- *
* @param status The connection status. */ synchronized private void disconnect(int status) {
@@ -1515,7 +1507,7 @@
log(Level.FINE, "Stopping the event processor."); eventProcessor.stop(); }
-
+
// Set the application status from the caller. setConnectionStatus(status);
@@ -1532,9 +1524,9 @@
} /**
- * This is a thread for cleaning up the ET connection. This is executed - * under a separate thread, because it could potentially block forever. - * So we need to be able to kill it after waiting for X amount of time.
+ * This is a thread for cleaning up the ET connection. This is executed under a + * separate thread, because it could potentially block forever. So we need to be able + * to kill it after waiting for X amount of time.
*/ private class EtCleanupThread extends Thread {
@@ -1575,7 +1567,7 @@
// Wait X seconds for cleanup thread to finish. cleanupThread.join(this.maxCleanupTime); } catch (InterruptedException e) {
- e.printStackTrace();
+ e.printStackTrace();
} if (cleanupThread.succeeded()) {
@@ -1601,13 +1593,15 @@
*/ private void setupLCSim() {
- log(Level.INFO, "Setting up LCSim.");
+ log(Level.INFO, "Setting up LCSim.");
- // Clear the static AIDA tree in case plots are hanging around from previous sessions.
+ // Clear the static AIDA tree in case plots are hanging around from previous + // sessions.
resetAidaTree();
-
+
// Reset the plots tab.
- this.plotPane.removeAll();
+ plotPane.removeAll(); + // ((MonitoringAnalysisFactory)MonitoringAnalysisFactory.create()).clearPlotFactories();
// Get steering resource or file as a String parameter. String steering = getSteering();
@@ -1621,7 +1615,8 @@
} try {
- // Create job manager and configure based on steering type of resource or file.
+ // Create job manager and configure based on steering type of resource or + // file.
jobManager = new JobControlManager(); jobManager.setPerformDryRun(true); if (steeringType == JobPanel.RESOURCE) {
@@ -1633,15 +1628,16 @@
log(Level.CONFIG, "Setting up steering file <" + steering + ">."); jobManager.setup(new File(steering)); }
-
+
// Call configure to trigger conditions setup and other initialization. jobManager.configure(); // Setup the event builder to translate from EVIO to LCIO. createEventBuilder();
- } // Catch all other setup exceptions and re-throw them as RuntimeExceptions. - catch (Exception e) {
+ // Catch all other setup exceptions and re-throw them as RuntimeExceptions. + } catch (Exception e) {[truncated at 1000 lines; 91 more skipped]
diff -u -r1.4 -r1.5 --- MonitoringPlotFactory.java 5 Jun 2013 20:10:52 -0000 1.4 +++ MonitoringPlotFactory.java 6 Nov 2013 19:19:56 -0000 1.5 @@ -1,7 +1,7 @@
package org.lcsim.hps.monitoring; import hep.aida.IPlotter;
-import hep.aida.ref.plotter.PlotterFactory;
+import hep.aida.jfree.plotter.PlotterFactory;
import hep.aida.ref.plotter.PlotterUtilities; import java.awt.BorderLayout;
@@ -11,57 +11,76 @@
import javax.swing.JTabbedPane; /**
- * This class implements an AIDA IPlotterFactory for the monitoring application. - * It extends the reference plotter by putting plots into tabs. Each plotter - * factory is given its own top-level tab in a root tabbed pane, under which are - * separate tabs for each plotter. The root pane is static and shared across all - * plotter factories. It is set externally by the MonitoringApplication before - * any calls to AIDA are made from Drivers.
+ * This class implements an AIDA IPlotterFactory for the monitoring application. + * It extends the JFree plotter by putting plots into tabs. Each plotter factory + * is given its own top-level tab in a root tabbed pane, under which are separate tabs + * for each plotter. The root pane is static and shared across all plotter factories. + * It is set externally by the MonitoringApplication before any calls to AIDA are made + * from Drivers.
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: MonitoringPlotFactory.java,v 1.4 2013/06/05 20:10:52 jeremy Exp $
+ * @version $Id: MonitoringPlotFactory.java,v 1.5 2013/11/06 19:19:56 jeremy Exp $
*/ class MonitoringPlotFactory extends PlotterFactory {
- - // The name of the factory which will be used in naming tabs in the monitoring app. - String name = null; -
+ + /* + * The name of the factory which will be used in naming tabs in the monitoring app. + */ + String name = null; +
// The GUI tabs for this factory's plots. private JTabbedPane tabs = new JTabbedPane();
-
+
// Root pane where this factory's top-level tab will be inserted. private static JTabbedPane rootPane = null;
- - MonitoringPlotFactory() {
+ + /** + * Class constructor. + */ + MonitoringPlotFactory() {
super(); rootPane.addTab("", tabs);
- rootPane.setTabComponentAt(rootPane.getTabCount()-1, new JLabel(" "));
+ rootPane.setTabComponentAt(rootPane.getTabCount() - 1, new JLabel(" "));
}
-
+ + /** + * Class constructor. + * @param name The name of the factory. + */
MonitoringPlotFactory(String name) { super();
- this.name = name; - if (!(new RuntimeException()).getStackTrace()[2].getClassName().equals("hep.aida.ref.plotter.style.registry.StyleStoreXMLReader")) {
+ this.name = name; + if (!(new RuntimeException()).getStackTrace()[2].getClassName() + .equals("hep.aida.ref.plotter.style.registry.StyleStoreXMLReader")) {
rootPane.addTab(name, tabs);
- rootPane.setTabComponentAt(rootPane.getTabCount()-1, new JLabel(name));
+ rootPane.setTabComponentAt(rootPane.getTabCount() - 1, new JLabel(name));
} }
-
+ + /** + * Create a named plotter. + * @param plotterName The name of the plotter. + * @return The plotter. + */
public IPlotter create(String plotterName) { IPlotter plotter = super.create(plotterName); JPanel plotterPanel = new JPanel(new BorderLayout()); plotterPanel.add(PlotterUtilities.componentForPlotter(plotter), BorderLayout.CENTER); tabs.addTab(plotterName, plotterPanel);
- tabs.setTabComponentAt(tabs.getTabCount()-1, new JLabel(plotterName));
+ tabs.setTabComponentAt(tabs.getTabCount() - 1, new JLabel(plotterName));
return plotter; }
-
+ + /** + * Create an unnamed plotter. + * @return The plotter. + */
public IPlotter create() { return create((String) null); }
-
+
/**
- * Set the reference to the root tab pane where this factory's GUI tabs will be inserted. - * @param rootPane
+ * Set the reference to the root tab pane where this factory's GUI tabs will be inserted. + * @param rootPane The root tabbed pane.
*/ static void setRootPane(JTabbedPane rootPane) { MonitoringPlotFactory.rootPane = rootPane;
diff -N Resettable.java --- Resettable.java 22 Mar 2012 22:03:35 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@
-package org.lcsim.hps.monitoring; - -/** - * Drivers that will be attached to monitoring system should implement - * this if they will be reset when the "reset" button is pressed on the - * monitoring app. - * - * @author Jeremy McCormick <[log in to unmask]> - * - */ -public interface Resettable { - void reset(); -}
diff -N Redrawable.java --- Redrawable.java 6 May 2012 00:01:13 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@
-package org.lcsim.hps.monitoring; - -/** - * Drivers that will be attached to monitoring system should implement - * this if they will only redraw plots every N events, or when redraw() is called. - * Setting eventRefreshRate = 0 should disable automatic redrawing. - */ -public interface Redrawable { - public void redraw(); - public void setEventRefreshRate(int eventRefreshRate); -}
diff -u -r1.2 -r1.3 --- ExamplePlotter.java 25 Oct 2013 19:45:01 -0000 1.2 +++ ExamplePlotter.java 6 Nov 2013 19:19:56 -0000 1.3 @@ -9,8 +9,8 @@
import org.lcsim.event.EventHeader; import org.lcsim.event.Track; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
diff -u -r1.17 -r1.18 --- ECalGainDriver.java 1 Nov 2013 19:23:53 -0000 1.17 +++ ECalGainDriver.java 6 Nov 2013 19:19:56 -0000 1.18 @@ -21,9 +21,9 @@
import org.lcsim.event.Track; import org.lcsim.event.base.BaseTrack; import org.lcsim.geometry.Detector;
-import org.lcsim.hps.monitoring.Redrawable; -import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Redrawable; +import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.hps.recon.ecal.HPSEcalCluster; import org.lcsim.hps.recon.tracking.EcalTrackMatch; import org.lcsim.hps.recon.tracking.TrackUtils;
diff -N Resettable.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Resettable.java 6 Nov 2013 19:19:56 -0000 1.1 @@ -0,0 +1,14 @@
+package org.lcsim.hps.monitoring.deprecated; + +/** + * Drivers that will be attached to monitoring system should implement + * this if they will be reset when the "reset" button is pressed on the + * monitoring app. + * @author Jeremy McCormick <[log in to unmask]> + * @deprecated Use standard methods like {@link org.lcsim.util.Driver#startOfData()} + * or {@link org.lcsim.util.Driver#detectorChanged(Detector)}. + */ +@Deprecated +public interface Resettable { + void reset(); +}
diff -N Redrawable.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Redrawable.java 6 Nov 2013 19:19:56 -0000 1.1 @@ -0,0 +1,13 @@
+package org.lcsim.hps.monitoring.deprecated; + +/** + * Drivers that will be attached to monitoring system should implement + * this if they will only redraw plots every N events, or when redraw() is called. + * Setting eventRefreshRate = 0 should disable automatic redrawing. + * @deprecated Individual Drivers should implement this behavior. No interface should be necessary. + */ +@Deprecated +public interface Redrawable { + public void redraw(); + public void setEventRefreshRate(int eventRefreshRate); +}
diff -u -r1.8 -r1.9 --- EcalCrystalFilter.java 25 Oct 2013 20:15:28 -0000 1.8 +++ EcalCrystalFilter.java 6 Nov 2013 19:19:56 -0000 1.9 @@ -19,9 +19,9 @@
import org.lcsim.event.base.BaseRawCalorimeterHit; import org.lcsim.geometry.Detector; import org.lcsim.hps.evio.TriggerData;
-import org.lcsim.hps.monitoring.Redrawable; -import org.lcsim.hps.monitoring.Resettable;
import org.lcsim.hps.monitoring.deprecated.AIDAFrame;
+import org.lcsim.hps.monitoring.deprecated.Redrawable; +import org.lcsim.hps.monitoring.deprecated.Resettable;
import org.lcsim.util.Driver; import org.lcsim.util.aida.AIDA;
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1