Changeset 1273
- Timestamp:
- 03/06/09 14:35:46 (16 years ago)
- Location:
- branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HeuristicLab.Hive.Server.Console.csproj
r1120 r1273 85 85 <DependentUpon>AddJobForm.cs</DependentUpon> 86 86 </Compile> 87 <Compile Include="Changes.cs" /> 87 88 <Compile Include="HiveServerConsole.cs"> 88 89 <SubType>Form</SubType> -
branches/Hive_Management_Console_Refactoring_Ticket508/HeuristicLab.Hive.Server.Console/HiveServerManagementConsole.cs
r1267 r1273 108 108 count = (count + 1) % 3; 109 109 } 110 lvClientControl.BeginUpdate(); 110 111 lvClientControl.Groups.Add(lvg); 112 lvClientControl.EndUpdate(); 111 113 clientObjects.Add(cg.Id, lvg); 112 114 } // Groups … … 119 121 count = (count + 1) % 3; 120 122 } 123 lvClientControl.BeginUpdate(); 121 124 lvClientControl.Groups.Add(lvunsorted); 125 lvClientControl.EndUpdate(); 122 126 if (flagClient) { 123 127 ClientClicked(); … … 154 158 jobObjects.Add(job.Id, lvi); 155 159 tvJobControl.Nodes[0].Nodes.Add(job.Id.ToString()); 156 lvJobControl.Items.Add(lvi); 160 161 //lvJobControl.Items.Add(lvi); 162 157 163 lvi.ToolTipText = (job.Percentage * 100) + "% of job calculated"; 158 164 } else if (job.State == State.finished) { … … 160 166 jobObjects.Add(job.Id, lvi); 161 167 tvJobControl.Nodes[1].Nodes.Add(job.Id.ToString()); 162 lvJobControl.Items.Add(lvi);168 //lvJobControl.Items.Add(lvi); 163 169 } else if (job.State == State.offline) { 164 170 ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobPending); 165 171 jobObjects.Add(job.Id, lvi); 166 172 tvJobControl.Nodes[2].Nodes.Add(job.Id.ToString()); 167 lvJobControl.Items.Add(lvi);173 //lvJobControl.Items.Add(lvi); 168 174 } 169 175 } // Jobs 176 lvJobControl.BeginUpdate(); 177 foreach (ListViewItem lvi in jobObjects.Values) { 178 lvJobControl.Items.Add(lvi); 179 } 170 180 lvJobControl.Groups.Add(lvJobCalculating); 171 181 lvJobControl.Groups.Add(lvJobFinished); 172 182 lvJobControl.Groups.Add(lvJobPending); 183 lvJobControl.EndUpdate(); 173 184 if (flagJob) { 174 185 JobClicked(); … … 219 230 lvUserControl.Items.Add(new ListViewItem(u.Name, 0, lvunsorted)); 220 231 } 232 lvUserControl.BeginUpdate(); 221 233 lvUserControl.Groups.Add(lvunsorted); 234 lvUserControl.EndUpdate(); 222 235 if (flagUser) { 223 236 UserClicked(); … … 468 481 469 482 private void updaterWoker_DoWork(object sender, DoWorkEventArgs e) { 483 #region ClientInfo 484 List<Changes> changes = new List<Changes>(); 470 485 ResponseList<ClientInfo> clientInfoOld = clientInfo; 471 486 IClientManager clientManager = 472 487 ServiceLocator.GetClientManager(); 488 bool found = false; 473 489 clientInfo = clientManager.GetAllClients(); 490 491 ResponseList<ClientInfo> clientInfoOldHelp = clientInfoOld; 492 474 493 foreach (ClientInfo ci in clientInfo.List) { 475 foreach (ClientInfo cio in clientInfoOld.List) { 476 ci.Id.Equals(cio.Id); 477 } 478 } 479 494 for (int i = 0; i < clientInfoOld.List.Count; i ++) { 495 ClientInfo cio = clientInfoOld.List[i]; 496 if (ci.Id.Equals(cio.Id)) { 497 found = true; 498 if (ci.State != cio.State) { 499 changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Update }); 500 } 501 for (int j = 0; j < clientInfoOldHelp.List.Count; j++) { 502 if (cio.Id.Equals(clientInfoOldHelp.List[i])) { 503 clientInfoOldHelp.List.RemoveAt(i); 504 break; 505 } 506 } 507 break; 508 } 509 } 510 if (found == false) { 511 changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Create }); 512 } 513 } 514 foreach (ClientInfo ci in clientInfoOldHelp.List) { 515 changes.Add(new Changes { Types = Type.Client, ID = ci.Id, ChangeType = Change.Delete }); 516 } 517 #endregion 518 519 #region Clients 520 ResponseList<ClientGroup> clientsOld = clients; 521 found = false; 522 clients = clientManager.GetAllClientGroups(); 523 524 ResponseList<ClientGroup> clientsOldHelp = clientsOld; 525 526 foreach (ClientGroup cg in clients.List) { 527 for (int i = 0; i < clientInfoOld.List.Count; i++) { 528 ClientGroup cgo = clientsOld.List[i]; 529 if (cg.Id.Equals(cgo.Id)) { 530 found = true; 531 foreach (Resource resource in cg.Resources) { 532 foreach (Resource resourceold in cgo.Resources) { 533 if (resource.Id.Equals(resourceold.Id)) { 534 if (resourceold.Name != resource.Name) { 535 changes.Add(new Changes { Types = Type.Client, ID = cg.Id, ChangeType = Change.Update }); 536 } 537 } 538 } 539 } 540 for (int j = 0; j < clientInfoOldHelp.List.Count; j++) { 541 if (cgo.Id.Equals(clientInfoOldHelp.List[i])) { 542 clientInfoOldHelp.List.RemoveAt(i); 543 break; 544 } 545 } 546 break; 547 } 548 } 549 if (found == false) { 550 changes.Add(new Changes { Types = Type.ClientGroup, ID = cg.Id, ChangeType = Change.Create }); 551 } 552 } 553 foreach (ClientGroup cg in clientsOldHelp.List) { 554 changes.Add(new Changes { Types = Type.ClientGroup, ID = cg.Id, ChangeType = Change.Delete }); 555 } 556 #endregion 557 558 #region job 559 ResponseList<Job> jobsOld = jobs; 560 IJobManager jobManager = 561 ServiceLocator.GetJobManager(); 562 found = false; 563 jobs = jobManager.GetAllJobs(); 564 565 ResponseList<Job> jobsOldHelp = jobsOld; 566 567 foreach (Job job in jobs.List) { 568 for (int i = 0; i < jobsOld.List.Count; i++) { 569 Job jobold = jobsOld.List[i]; 570 if (job.Id.Equals(jobold.Id)) { 571 found = true; 572 if (job.Client != jobold.Client) { 573 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Update }); 574 } else if (job.DateCalculated != jobold.DateCalculated) { 575 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Update }); 576 } 577 //for (int j = 0; j < clientInfoOldHelp.List.Count; j++) { 578 // if (job.Id.Equals(clientInfoOldHelp.List[i])) { 579 // clientInfoOldHelp.List.RemoveAt(i); 580 // break; 581 // } 582 //} 583 break; 584 } 585 } 586 if (found == false) { 587 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Create }); 588 } 589 } 590 foreach (Job job in jobsOldHelp.List) { 591 changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Delete }); 592 } 593 #endregion 594 480 595 } 481 596 #endregion
Note: See TracChangeset
for help on using the changeset viewer.