Changeset 6721 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/RefreshableHiveExperiment.cs
- Timestamp:
- 09/08/11 13:41:25 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.3/RefreshableHiveExperiment.cs
r6479 r6721 225 225 } 226 226 #endregion 227 227 228 228 #region JobResultPoller Events 229 229 … … 248 248 private void RegisterResultPollingEvents() { 249 249 jobResultPoller.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured); 250 jobResultPoller.JobResultsReceived += new EventHandler<EventArgs<IEnumerable<Lightweight Job>>>(jobResultPoller_JobResultReceived);250 jobResultPoller.JobResultsReceived += new EventHandler<EventArgs<IEnumerable<LightweightTask>>>(jobResultPoller_JobResultReceived); 251 251 jobResultPoller.IsPollingChanged += new EventHandler(jobResultPoller_IsPollingChanged); 252 252 } 253 253 private void DeregisterResultPollingEvents() { 254 254 jobResultPoller.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured); 255 jobResultPoller.JobResultsReceived -= new EventHandler<EventArgs<IEnumerable<Lightweight Job>>>(jobResultPoller_JobResultReceived);255 jobResultPoller.JobResultsReceived -= new EventHandler<EventArgs<IEnumerable<LightweightTask>>>(jobResultPoller_JobResultReceived); 256 256 jobResultPoller.IsPollingChanged -= new EventHandler(jobResultPoller_IsPollingChanged); 257 257 } … … 262 262 } 263 263 } 264 private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<Lightweight Job>> e) {265 foreach (Lightweight JoblightweightJob in e.Value) {264 private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<LightweightTask>> e) { 265 foreach (LightweightTask lightweightJob in e.Value) { 266 266 HiveJob hiveJob = GetHiveJobById(lightweightJob.Id); 267 267 if (hiveJob != null) { 268 268 // lastJobDataUpdate equals DateTime.MinValue right after it was uploaded. When the first results are polled, this value is updated 269 if (hiveJob.Job.State == JobState.Offline && lightweightJob.State != JobState.Finished && lightweightJob.State != JobState.Failed && lightweightJob.State != JobState.Aborted) {269 if (hiveJob.Job.State == TaskState.Offline && lightweightJob.State != TaskState.Finished && lightweightJob.State != TaskState.Failed && lightweightJob.State != TaskState.Aborted) { 270 270 hiveJob.Job.LastJobDataUpdate = lightweightJob.LastJobDataUpdate; 271 271 } … … 289 289 // if the job is paused, download but don't integrate into parent optimizer (to avoid Prepare) 290 290 291 if (localJob.State == JobState.Paused) {291 if (localJob.State == TaskState.Paused) { 292 292 localHiveJob.ItemJob = itemJob; 293 293 } else { 294 if (localJob.Parent JobId.HasValue) {295 HiveJob parentHiveJob = GetHiveJobById(localJob.Parent JobId.Value);294 if (localJob.ParentTaskId.HasValue) { 295 HiveJob parentHiveJob = GetHiveJobById(localJob.ParentTaskId.Value); 296 296 parentHiveJob.IntegrateChild(itemJob, localJob.Id); 297 297 } else { … … 327 327 var jobs = this.GetAllHiveJobs(); 328 328 hiveExperiment.JobCount = jobs.Count(); 329 hiveExperiment.CalculatingCount = jobs.Count(j => j.Job.State == JobState.Calculating);330 hiveExperiment.FinishedCount = jobs.Count(j => j.Job.State == JobState.Finished);329 hiveExperiment.CalculatingCount = jobs.Count(j => j.Job.State == TaskState.Calculating); 330 hiveExperiment.FinishedCount = jobs.Count(j => j.Job.State == TaskState.Finished); 331 331 OnJobStatisticsChanged(); 332 332 } 333 333 334 334 public bool AllJobsFinished() { 335 return this.GetAllHiveJobs().All(j => (j.Job.State == JobState.Finished336 || j.Job.State == JobState.Aborted337 || j.Job.State == JobState.Failed)335 return this.GetAllHiveJobs().All(j => (j.Job.State == TaskState.Finished 336 || j.Job.State == TaskState.Aborted 337 || j.Job.State == TaskState.Failed) 338 338 && j.IsFinishedJobDownloaded); 339 339 }
Note: See TracChangeset
for help on using the changeset viewer.