Changeset 1080
- Timestamp:
- 01/07/09 15:28:14 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Console/HiveClientConsole.cs
r1028 r1080 116 116 ListViewItem curEventLogEntry; 117 117 118 foreach (EventLogEntry ele in HiveClientEventLog.Entries) { 119 curEventLogEntry = GenerateEventEntry(ele); 120 lvLog.Items.Add(curEventLogEntry); 121 } 122 lvJobDetail.Sort(); 118 //databinding on listview? 119 if (HiveClientEventLog != null && HiveClientEventLog.Entries != null) { 120 foreach (EventLogEntry ele in HiveClientEventLog.Entries) { 121 curEventLogEntry = GenerateEventEntry(ele); 122 lvLog.Items.Add(curEventLogEntry); 123 } 124 lvJobDetail.Sort(); 125 } 123 126 } 124 127 … … 134 137 } 135 138 136 private void UpdateGraph( int jobsDone, int jobsAborted) {139 private void UpdateGraph(JobStatus[] jobs) { 137 140 ZedGraphControl zgc = new ZedGraphControl(); 138 141 GraphPane myPane = zgc.GraphPane; … … 146 149 myPane.Legend.IsVisible = false; // no legend 147 150 148 myPane.Fill.Color = Color.FromKnownColor(KnownColor.Control);151 myPane.Fill.Color = this.BackColor; 149 152 150 153 myPane.Chart.Fill.Type = FillType.None; 151 154 myPane.Fill.Type = FillType.Solid; 152 155 153 double sum = (double)jobsDone + jobsAborted; 154 double perDone = (double)jobsDone / sum * 100; 155 double perAborted = (double)jobsAborted / sum * 100; 156 157 myPane.AddPieSlice(perDone, Color.Green, 0.1, ""); 158 myPane.AddPieSlice(perAborted, Color.Red, 0.1, ""); 159 156 double allProgress = 0; 157 double done = 0; 158 159 if (jobs.Length == 0) { 160 myPane.AddPieSlice(100, Color.Green, 0.1, ""); 161 } else { 162 for (int i = 0; i < jobs.Length; i++) { 163 allProgress += jobs[i].Progress; 164 } 165 166 done = allProgress / jobs.Length; 167 168 myPane.AddPieSlice(done, Color.Green, 0.1, ""); 169 myPane.AddPieSlice(1-done, Color.Red, 0.1, ""); 170 } 160 171 //Hides the slice labels 161 172 PieItem.Default.LabelType = PieLabelType.None; … … 216 227 } 217 228 218 UpdateGraph(sc.Jobs Done, sc.JobsAborted);229 UpdateGraph(sc.Jobs); 219 230 220 231 if (sc.Status == NetworkEnumWcfConnState.Connected) {
Note: See TracChangeset
for help on using the changeset viewer.