Author: [log in to unmask]
Date: Fri Mar 6 12:39:38 2015
New Revision: 2303
Log:
Fixed some rendering bugs in the trigger monitoring GUI panels.
Modified:
java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/AbstractTablePanel.java
java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/AbstractTriggerTablePanel.java
java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ClusterTablePanel.java
java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/TriggerDiagnosticGUIDriver.java
Modified: java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/AbstractTablePanel.java
=============================================================================
--- java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/AbstractTablePanel.java (original)
+++ java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/AbstractTablePanel.java Fri Mar 6 12:39:38 2015
@@ -44,7 +44,7 @@
/**
* Instantiates an <code>AbstractTablePanel</code>.
- * @param args Arguments to be usd when generating the panel tables.
+ * @param args Arguments to be used when generating the panel tables.
*/
public AbstractTablePanel(Object... args) {
// Initialize the tables.
Modified: java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/AbstractTriggerTablePanel.java
=============================================================================
--- java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/AbstractTriggerTablePanel.java (original)
+++ java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/AbstractTriggerTablePanel.java Fri Mar 6 12:39:38 2015
@@ -81,9 +81,10 @@
int mostDigits = ComponentUtils.max(lstat.getReconTriggerCount(), lstat.getSSPBankTriggerCount(),
lstat.getSSPSimTriggerCount(), rstat.getReconTriggerCount(), rstat.getSSPBankTriggerCount(),
rstat.getSSPSimTriggerCount());
+ int spaces = ComponentUtils.getDigits(mostDigits);
// Update the single-value counters.
- String countFormat = "%" + mostDigits + "d";
+ String countFormat = "%" + spaces + "d";
setLocalRowValue(ROW_RECON_COUNT, String.format(countFormat, lstat.getReconTriggerCount()));
setLocalRowValue(ROW_SSP_SIM_COUNT, String.format(countFormat, lstat.getSSPSimTriggerCount()));
setLocalRowValue(ROW_SSP_BANK_COUNT, String.format(countFormat, lstat.getSSPBankTriggerCount()));
@@ -92,7 +93,7 @@
setGlobalRowValue(ROW_SSP_BANK_COUNT, String.format(countFormat, rstat.getSSPBankTriggerCount()));
// Update the percentage counters.
- String percentFormat = "%" + mostDigits + "d / %" + mostDigits + "d (%7.3f)";
+ String percentFormat = "%" + spaces + "d / %" + spaces + "d (%7.3f)";
setLocalRowValue(ROW_SSP_EFFICIENCY, String.format(percentFormat, lstat.getMatchedSSPTriggers(),
lstat.getSSPSimTriggerCount(), (100.0 * lstat.getMatchedSSPTriggers() / lstat.getSSPSimTriggerCount())));
Modified: java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ClusterTablePanel.java
=============================================================================
--- java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ClusterTablePanel.java (original)
+++ java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/ClusterTablePanel.java Fri Mar 6 12:39:38 2015
@@ -66,6 +66,7 @@
lstat.getPositionFailures(), lstat.getEnergyFailures(), lstat.getHitCountFailures(),
rstat.getReconClusterCount(), rstat.getSSPClusterCount(), rstat.getMatches(),
rstat.getPositionFailures(), rstat.getEnergyFailures(), rstat.getHitCountFailures());
+ int spaces = ComponentUtils.getDigits(mostDigits);
// Put the number of reconstructed and SSP clusters into
// the tables.
@@ -75,15 +76,20 @@
rstat.getReconClusterCount(),
rstat.getSSPClusterCount()
};
- String countFormat = "%" + mostDigits + "d";
+ String countFormat = "%" + spaces + "d";
setLocalRowValue(ROW_RECON_COUNT, String.format(countFormat, clusterValue[0]));
setLocalRowValue(ROW_SSP_COUNT, String.format(countFormat, clusterValue[1]));
setGlobalRowValue(ROW_RECON_COUNT, String.format(countFormat, clusterValue[2]));
setGlobalRowValue(ROW_SSP_COUNT, String.format(countFormat, clusterValue[3]));
+
+ System.out.printf("(row = %d, col = %d) --> %s%n", ROW_RECON_COUNT, 1, String.format(countFormat, clusterValue[0]));
+ System.out.printf("(row = %d, col = %d) --> %s%n", ROW_SSP_COUNT, 1, String.format(countFormat, clusterValue[1]));
+
+
// Output the tracked statistical data.
int total;
- String percentFormat = "%" + mostDigits + "d / %" + mostDigits + "d (%7.3f)";
+ String percentFormat = "%" + spaces + "d / %" + spaces + "d (%7.3f)";
int[] statValue = {
lstat.getMatches(),
lstat.getPositionFailures(),
@@ -106,6 +112,12 @@
setGlobalRowValue(ROW_FAILED_POSITION, String.format(percentFormat, statValue[5], total, 100.0 * statValue[5] / total));
setGlobalRowValue(ROW_FAILED_ENERGY, String.format(percentFormat, statValue[6], total, 100.0 * statValue[6] / total));
setGlobalRowValue(ROW_FAILED_HIT_COUNT, String.format(percentFormat, statValue[7], total, 100.0 * statValue[7] / total));
+
+
+ System.out.printf("(row = %d, col = %d) --> %s%n", ROW_MATCHED, 1, String.format(percentFormat, statValue[0], total, 100.0 * statValue[0] / total));
+ System.out.printf("(row = %d, col = %d) --> %s%n", ROW_FAILED_POSITION, 1, String.format(percentFormat, statValue[1], total, 100.0 * statValue[1] / total));
+ System.out.printf("(row = %d, col = %d) --> %s%n", ROW_FAILED_ENERGY, 1, String.format(percentFormat, statValue[2], total, 100.0 * statValue[2] / total));
+ System.out.printf("(row = %d, col = %d) --> %s%n", ROW_FAILED_HIT_COUNT, 1, String.format(percentFormat, statValue[3], total, 100.0 * statValue[3] / total));
}
}
}
Modified: java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/TriggerDiagnosticGUIDriver.java
=============================================================================
--- java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/TriggerDiagnosticGUIDriver.java (original)
+++ java/trunk/monitoring-util/src/main/java/org/hps/monitoring/trigger/TriggerDiagnosticGUIDriver.java Fri Mar 6 12:39:38 2015
@@ -11,14 +11,20 @@
public class TriggerDiagnosticGUIDriver extends Driver {
private JFrame window = new JFrame();
private ClusterTablePanel clusterTable = new ClusterTablePanel();
+ private SinglesTablePanel singlesTable = new SinglesTablePanel();
+ private PairTablePanel pairTable = new PairTablePanel();
+ private EfficiencyTablePanel efficiencyTable = new EfficiencyTablePanel();
private String diagnosticCollectionName = "DiagnosticSnapshot";
@Override
public void startOfData() {
- window.add(clusterTable);
- window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setSize(500, 400);
+ //window.add(clusterTable);
+ //window.add(singlesTable);
+ //window.add(pairTable);
+ window.add(efficiencyTable);
+ window.setVisible(true);
}
@Override
@@ -33,7 +39,10 @@
DiagSnapshot snapshot = snapshotList.get(0);
// Feed it to the table.
- clusterTable.updatePanel(snapshot);
+ //clusterTable.updatePanel(snapshot);
+ singlesTable.updatePanel(snapshot);
+ pairTable.updatePanel(snapshot);
+ efficiencyTable.updatePanel(snapshot);
}
}
|