Author: [log in to unmask] Date: Fri Jan 23 18:47:12 2015 New Revision: 1988 Log: Add menu item for resetting of AIDA plots. HPSJAVA-320 Removed: java/trunk/conditions/src/main/java/org/hps/conditions/deprecated/ Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/Commands.java java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java java/trunk/record-util/src/main/java/org/hps/record/evio/EvioDetectorConditionsProcessor.java Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/Commands.java ============================================================================= --- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/Commands.java (original) +++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/Commands.java Fri Jan 23 18:47:12 2015 @@ -32,6 +32,7 @@ static final String NEXT = "next"; static final String PAUSE = "pause"; static final String PROCESSING_STAGE_CHANGED = "processingStageChanged"; + static final String RESET_PLOTS = "resetPlots"; static final String RESTORE_DEFAULT_GUI_LAYOUT = "restoreDefaultGuiLayout"; static final String RESUME = "resume"; static final String SAVE_CONFIG_FILE = "saveConfigFile"; Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java ============================================================================= --- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java (original) +++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java Fri Jan 23 18:47:12 2015 @@ -11,6 +11,7 @@ import static org.hps.monitoring.gui.Commands.LOG_TO_TERMINAL; import static org.hps.monitoring.gui.Commands.NEXT; import static org.hps.monitoring.gui.Commands.PAUSE; +import static org.hps.monitoring.gui.Commands.RESET_PLOTS; import static org.hps.monitoring.gui.Commands.RESTORE_DEFAULT_GUI_LAYOUT; import static org.hps.monitoring.gui.Commands.RESUME; import static org.hps.monitoring.gui.Commands.SAVE_CONFIG_FILE; @@ -23,6 +24,7 @@ import static org.hps.monitoring.gui.Commands.VALIDATE_DATA_FILE; import static org.hps.monitoring.gui.model.ConfigurationModel.MONITORING_APPLICATION_LAYOUT_PROPERTY; import static org.hps.monitoring.gui.model.ConfigurationModel.SAVE_LAYOUT_PROPERTY; +import hep.aida.ITree; import hep.aida.jfree.AnalysisFactory; import hep.aida.jfree.plotter.PlotterRegion; import hep.aida.jfree.plotter.PlotterRegionListener; @@ -302,6 +304,8 @@ if (fileValidationThread == null) { new FileValidationThread().start(); } + } else if (RESET_PLOTS.equals(cmd)) { + resetAidaTree(); } } @@ -446,8 +450,12 @@ private void createSystemStatusWindow() { systemStatusWindow = new SystemStatusWindow(); - WindowConfiguration wc = new WindowConfiguration(650, /* FIXME: Hard-coded width setting. */ - ScreenUtil.getScreenHeight() / 2, (int) ScreenUtil.getBoundsX(0), MAIN_FRAME_HEIGHT); + WindowConfiguration wc = new WindowConfiguration( + 650, /* FIXME: Hard-coded width setting. */ + //ScreenUtil.getScreenHeight() - mainPanel.getHeight(), + 400, + (int) ScreenUtil.getBoundsX(0), + MAIN_FRAME_HEIGHT); systemStatusWindow.setMinimumSize(new Dimension(wc.width, wc.height)); systemStatusWindow.setDefaultWindowConfiguration(wc); } @@ -590,6 +598,14 @@ savePlotsItem.setEnabled(false); savePlotsItem.setToolTipText("Save plots from default AIDA tree to an output file."); plotsMenu.add(savePlotsItem); + + JMenuItem resetPlotsItem = new JMenuItem("Reset Plots"); + resetPlotsItem.setMnemonic(KeyEvent.VK_R); + resetPlotsItem.setActionCommand(RESET_PLOTS); + resetPlotsItem.addActionListener(this); + resetPlotsItem.setEnabled(true); + resetPlotsItem.setToolTipText("Reset all AIDA plots in the default tree."); + plotsMenu.add(resetPlotsItem); JMenu logMenu = new JMenu("Log"); logMenu.setMnemonic(KeyEvent.VK_L); @@ -1116,7 +1132,7 @@ // Create and the job manager. The conditions manager is instantiated from this call but not configured. jobManager = new JobManager(); - if (configurationModel.hasPropertyValue(ConfigurationModel.DETECTOR_ALIAS_PROPERTY) && configurationModel.getDetectorAlias() != null) { + if (configurationModel.hasValidProperty(ConfigurationModel.DETECTOR_ALIAS_PROPERTY)) { // Set a detector alias. ConditionsReader.addAlias(configurationModel.getDetectorName(), "file://" + configurationModel.getDetectorAlias()); logger.config("using detector alias " + configurationModel.getDetectorAlias()); @@ -1135,7 +1151,7 @@ } // Is there a user specified run number from the JobPanel? - if (configurationModel.hasPropertyValue(ConfigurationModel.USER_RUN_NUMBER_PROPERTY)) { + if (configurationModel.hasValidProperty(ConfigurationModel.USER_RUN_NUMBER_PROPERTY)) { int userRunNumber = configurationModel.getUserRunNumber(); String detectorName = configurationModel.getDetectorName(); DatabaseConditionsManager conditionsManager = DatabaseConditionsManager.getInstance(); @@ -1353,6 +1369,9 @@ // RunPanel updater. loopConfig.add(runPanel.new RunModelUpdater()); + // Data rate updater for RunPanel. + loopConfig.add(runPanel.new DataRateUpdater()); + // Setup for conditions activation via EVIO events. loopConfig.add(new EvioDetectorConditionsProcessor(configurationModel.getDetectorName())); @@ -1643,7 +1662,7 @@ plotWindow.resetWindowConfiguration(); systemStatusWindow.resetWindowConfiguration(); } - + /** * Load the current Configuration by updating the ConfigurationModel. */ Modified: java/trunk/record-util/src/main/java/org/hps/record/evio/EvioDetectorConditionsProcessor.java ============================================================================= --- java/trunk/record-util/src/main/java/org/hps/record/evio/EvioDetectorConditionsProcessor.java (original) +++ java/trunk/record-util/src/main/java/org/hps/record/evio/EvioDetectorConditionsProcessor.java Fri Jan 23 18:47:12 2015 @@ -51,7 +51,7 @@ @Override public void startRun(EvioEvent evioEvent) { - System.out.println("EvioDetectorConditionsProcessor.startRun"); + //System.out.println("EvioDetectorConditionsProcessor.startRun"); if (EvioEventUtilities.isPreStartEvent(evioEvent)) { // Get the pre start event's data bank. int[] data = EvioEventUtilities.getControlEventData(evioEvent); @@ -61,7 +61,7 @@ // Initialize the conditions system from the detector name and run number. try { - System.out.println(" setting up conditions from pre start: " + detectorName + " #" + runNumber); + //System.out.println(" setting up conditions from pre start: " + detectorName + " #" + runNumber); ConditionsManager.defaultInstance().setDetector(detectorName, runNumber); } catch (ConditionsNotFoundException e) { throw new RuntimeException("Error setting up conditions from EVIO pre start event.", e);