Changeset 3578 for trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs
- Timestamp:
- 05/01/10 13:58:24 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs
r3220 r3578 242 242 CloneList(jobsOld, out jobsOldHelp); 243 243 244 GetDelta(jobsOld.List, jobsOldHelp); 244 if(jobsOld != null && jobsOld.List != null && jobsOldHelp != null) 245 GetDelta(jobsOld.List, jobsOldHelp); 245 246 246 247 } … … 419 420 lvJobDetails.Items.Clear(); 420 421 421 lvSnapshots.Enabled = true; 422 423 if (currentJob.State == State.offline) { 422 ResponseObject<JobDto> response = ServiceLocator.GetJobManager().GetJobByIdWithDetails(currentJob.Id); 423 424 if(response.Success == false || response.Obj == null) 425 return; 426 427 JobDto job = response.Obj; 428 429 //lvSnapshots.Enabled = true; 430 431 if (job.State == State.offline) { 424 432 pbJobControl.Image = ilLargeImgJob.Images[2]; 425 } else if ( currentJob.State == State.calculating) {433 } else if (job.State == State.calculating) { 426 434 pbJobControl.Image = ilLargeImgJob.Images[1]; 427 } else if ( currentJob.State == State.finished) {435 } else if (job.State == State.finished) { 428 436 pbJobControl.Image = ilLargeImgJob.Images[0]; 429 437 } 430 438 431 lblJobName.Text = currentJob.Id.ToString();432 if ( currentJob.Percentage != null) {439 lblJobName.Text = job.Id.ToString(); 440 if (job.Percentage != null) { 433 441 progressJob.Value = (int) (currentJob.Percentage*100); 434 442 lblProgress.Text = (int) (currentJob.Percentage*100) + "% calculated"; … … 437 445 ListViewItem lvi = new ListViewItem(); 438 446 lvi.Text = "User:"; 439 lvi.SubItems.Add( currentJob.UserId.ToString());447 lvi.SubItems.Add(job.UserId.ToString()); 440 448 lvJobDetails.Items.Add(lvi); 441 449 … … 443 451 lvi = new ListViewItem(); 444 452 lvi.Text = "created at:"; 445 lvi.SubItems.Add( currentJob.DateCreated.ToString());453 lvi.SubItems.Add(job.DateCreated.ToString()); 446 454 lvJobDetails.Items.Add(lvi); 447 455 448 if ( currentJob.ParentJob != null) {456 if (job.ParentJob != null) { 449 457 lvi = null; 450 458 lvi = new ListViewItem(); 451 459 lvi.Text = "Parent job:"; 452 lvi.SubItems.Add( currentJob.ParentJob.ToString());460 lvi.SubItems.Add(job.ParentJob.ToString()); 453 461 lvJobDetails.Items.Add(lvi); 454 462 } … … 457 465 lvi = new ListViewItem(); 458 466 lvi.Text = "Priority:"; 459 lvi.SubItems.Add( currentJob.Priority.ToString());467 lvi.SubItems.Add(job.Priority.ToString()); 460 468 lvJobDetails.Items.Add(lvi); 461 469 462 if ( currentJob.Project != null) {470 if (job.Project != null) { 463 471 lvi = null; 464 472 lvi = new ListViewItem(); 465 473 lvi.Text = "Project:"; 466 lvi.SubItems.Add( currentJob.Project.Name.ToString());474 lvi.SubItems.Add(job.Project.Name.ToString()); 467 475 lvJobDetails.Items.Add(lvi); 468 476 } 469 477 470 if ( currentJob.Client != null) {478 if (job.Client != null) { 471 479 lvi = null; 472 480 lvi = new ListViewItem(); 473 481 lvi.Text = "Calculation begin:"; 474 lvi.SubItems.Add( currentJob.DateCalculated.ToString());482 lvi.SubItems.Add(job.DateCalculated.ToString()); 475 483 lvJobDetails.Items.Add(lvi); 476 484 … … 479 487 lvi = new ListViewItem(); 480 488 lvi.Text = "Client calculated:"; 481 lvi.SubItems.Add( currentJob.Client.Name.ToString());489 lvi.SubItems.Add(job.Client.Name.ToString()); 482 490 lvJobDetails.Items.Add(lvi); 483 491 484 if (currentJob.State == State.finished) { 485 IJobManager jobManager = 486 ServiceLocator.GetJobManager(); 487 ResponseObject<JobResult> jobRes = null; 488 //Todo: jobManager.GetLastJobResultOf(currentJob.Id); 489 490 if (jobRes != null && jobRes.Obj != null) { 491 lvi = null; 492 if (job.State == State.finished) { 493 lvi = null; 492 494 lvi = new ListViewItem(); 493 495 lvi.Text = "Calculation ended:"; 494 lvi.SubItems.Add(job Res.Obj.DateFinished.ToString());496 lvi.SubItems.Add(job.DateFinished.ToString()); 495 497 lvJobDetails.Items.Add(lvi); 496 498 } 497 499 } 498 } 499 if (currentJob.State != State.offline) { 500 lvSnapshots.Items.Clear(); 501 GetSnapshotList(); 502 } else { 503 lvSnapshots.Visible = false; 504 } 505 } 500 } 506 501 507 502 /// <summary> … … 776 771 private void CloneList(ResponseList<JobDto> oldList, out IDictionary<int, JobDto> newList) { 777 772 newList = new Dictionary<int, JobDto>(); 778 for (int i = 0; i < oldList.List.Count; i++) { 779 newList.Add(i, oldList.List[i]); 773 if (oldList != null && oldList.List != null) { 774 for (int i = 0; i < oldList.List.Count; i++) { 775 newList.Add(i, oldList.List[i]); 776 } 780 777 } 781 778 } 782 779 783 780 private bool IsEqual(ClientDto ci1, ClientDto ci2) { 781 if (ci1 == null && ci2 == null) { 782 return true; 783 } 784 784 if (ci2 == null) { 785 785 return false; … … 849 849 } 850 850 851 private void GetSnapshotList() {852 853 lvSnapshots.Items.Clear();854 IJobManager jobManager = ServiceLocator.GetJobManager();855 856 ResponseList<JobResult> jobRes = jobManager.GetAllJobResults(currentJob.Id);857 858 if (jobRes != null && jobRes.List != null) {859 foreach (JobResult jobresult in jobRes.List) {860 ListViewItem curSnapshot = new ListViewItem(jobresult.ClientId.ToString());861 double percentage = jobresult.Percentage * 100;862 curSnapshot.SubItems.Add(percentage.ToString() + " %");863 curSnapshot.SubItems.Add(jobresult.Timestamp.ToString());864 lvSnapshots.Items.Add(curSnapshot);865 }866 }867 868 if ((jobRes.List == null) || (jobRes.List.Count == 0)) {869 lvSnapshots.Visible = false;870 } else {871 lvSnapshots.Visible = true;872 }873 874 }875 876 851 #endregion 877 852
Note: See TracChangeset
for help on using the changeset viewer.