[Swift-commit] r7079 - in trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi: . tui

hategan at ci.uchicago.edu hategan at ci.uchicago.edu
Tue Sep 17 02:27:16 CDT 2013


Author: hategan
Date: 2013-09-17 02:27:16 -0500 (Tue, 17 Sep 2013)
New Revision: 7079

Modified:
   trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi/SummaryPane.java
   trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi/tui/LevelBars.java
Log:
use total number of jobs as range for summary bars instead of the maximum

Modified: trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi/SummaryPane.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi/SummaryPane.java	2013-09-17 03:08:32 UTC (rev 7078)
+++ trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi/SummaryPane.java	2013-09-17 07:27:16 UTC (rev 7079)
@@ -66,6 +66,7 @@
             SummaryItem summary = (SummaryItem) state.getItemByID(SummaryItem.ID, StatefulItemClass.WORKFLOW);
             if (summary != null) {
                 Map<String, Integer> counts = summary.getCounts(state);
+                bars.setRange(state.getTotal());
                 for (int i = 0; i < SummaryItem.STATES.length; i++) {
                     if (SummaryItem.STATES[i].isEnabled()) {
                         Integer v = counts.get(SummaryItem.STATES[i].getName());

Modified: trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi/tui/LevelBars.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi/tui/LevelBars.java	2013-09-17 03:08:32 UTC (rev 7078)
+++ trunk/src/org/griphyn/vdl/karajan/monitor/monitors/ansi/tui/LevelBars.java	2013-09-17 07:27:16 UTC (rev 7079)
@@ -34,14 +34,15 @@
     
     public void setValue(int index, int v) {
         values[index] = v;
+        int r = range;
         for (int i = 0; i < values.length; i++) {
-            if (values[i] > range) {
-                range = values[i];
+            if (values[i] > r) {
+                r = values[i];
             }
         }
         for (int i = 0; i < values.length; i++) {
-            if (range > 0) {
-                getBar(i).setValue((float) values[i] / range);
+            if (r > 0) {
+                getBar(i).setValue((float) values[i] / r);
             }
             else {
                 getBar(i).setValue(0);
@@ -49,6 +50,10 @@
         }
     }
     
+    public void setRange(int range) {
+        this.range = range;
+    }
+    
     public void setOtherValue(int i, int ov) {
         if (range != 0) {
             getBar(i).setOtherValue((float) ov / range);




More information about the Swift-commit mailing list