Changeset 7165


Ignore:
Timestamp:
12/10/11 16:32:33 (10 years ago)
Author:
ascheibe
Message:

#1672 build the task tree first and then display it. This should be more light on the CPU.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r7156 r7165  
    242242      HiveServiceLocator.Instance.CallHiveService(service => {
    243243        foreach (HiveTask task in refreshableJob.GetAllHiveTasks()) {
    244           if (task.Task.State == TaskState.Paused) {           
    245             service.RestartTask(task.Task.Id);           
     244          if (task.Task.State == TaskState.Paused) {
     245            service.RestartTask(task.Task.Id);
    246246          }
    247247        }
     
    450450        }
    451451        IDictionary<Guid, HiveTask> allHiveTasks = downloader.Results;
    452 
    453         refreshableJob.HiveTasks = new ItemCollection<HiveTask>(allHiveTasks.Values.Where(x => !x.Task.ParentTaskId.HasValue));
    454 
     452        var parents = allHiveTasks.Values.Where(x => !x.Task.ParentTaskId.HasValue);
     453
     454        refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks...";
     455        // build child-task tree
     456        foreach (HiveTask hiveTask in parents) {
     457          BuildHiveJobTree(hiveTask, allTasks, allHiveTasks);
     458        }
     459
     460        refreshableJob.HiveTasks = new ItemCollection<HiveTask>(parents);
    455461        if (refreshableJob.IsFinished()) {
    456462          refreshableJob.ExecutionState = Core.ExecutionState.Stopped;
     
    458464          refreshableJob.ExecutionState = Core.ExecutionState.Started;
    459465        }
    460 
    461         refreshableJob.Progress.Status = "Downloading/deserializing complete. Displaying tasks...";
    462         // build child-task tree
    463         foreach (HiveTask hiveTask in refreshableJob.HiveTasks) {
    464           BuildHiveJobTree(hiveTask, allTasks, allHiveTasks);
    465         }
    466 
    467466        refreshableJob.OnLoaded();
    468467      } finally {
Note: See TracChangeset for help on using the changeset viewer.