Changeset 8206 for branches/GP-MoveOperators/HeuristicLab.Clients.Hive
- Timestamp:
- 07/03/12 16:46:35 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:mergeinfo changed
/trunk/sources merged: 8084,8088-8090,8092-8100,8102-8113,8115,8117-8132,8134-8146,8148-8156,8158-8160,8163-8170,8173-8176,8178-8190,8192-8205
- Property svn:mergeinfo changed
-
branches/GP-MoveOperators/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r7582 r8206 258 258 private void UploadJob(RefreshableJob refreshableJob, CancellationToken cancellationToken) { 259 259 try { 260 refreshableJob.IsProgressing = true; 260 261 refreshableJob.Progress = new Progress("Connecting to server..."); 261 refreshableJob.IsProgressing = true;262 263 262 IEnumerable<string> resourceNames = ToResourceNameList(refreshableJob.Job.ResourceNames); 264 263 var resourceIds = new List<Guid>(); … … 317 316 finally { 318 317 refreshableJob.IsProgressing = false; 318 refreshableJob.Progress.Finish(); 319 319 } 320 320 } … … 351 351 /// </summary> 352 352 /// <param name="parentHiveTask">shall be null if its the root task</param> 353 private void UploadTaskWithChildren( IProgress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, bool isPrivileged, CancellationToken cancellationToken) {353 private void UploadTaskWithChildren(Progress progress, HiveTask hiveTask, HiveTask parentHiveTask, IEnumerable<Guid> groups, int[] taskCount, int totalJobCount, Guid configPluginId, Guid jobId, ILog log, bool isPrivileged, CancellationToken cancellationToken) { 354 354 taskUploadSemaphore.WaitOne(); 355 355 bool semaphoreReleased = false; … … 427 427 public static void LoadJob(RefreshableJob refreshableJob) { 428 428 var hiveExperiment = refreshableJob.Job; 429 refreshableJob.IsProgressing = true; 429 430 refreshableJob.Progress = new Progress(); 430 431 431 432 try { 432 refreshableJob.IsProgressing = true;433 433 int totalJobCount = 0; 434 434 IEnumerable<LightweightTask> allTasks; … … 472 472 finally { 473 473 refreshableJob.IsProgressing = false; 474 refreshableJob.Progress.Finish(); 474 475 } 475 476 } … … 493 494 private static IEnumerable<string> ToResourceNameList(string resourceNames) { 494 495 if (!string.IsNullOrEmpty(resourceNames)) { 495 return resourceNames.Split( ';');496 return resourceNames.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); 496 497 } else { 497 498 return new List<string>(); -
branches/GP-MoveOperators/HeuristicLab.Clients.Hive/3.3/RefreshableJob.cs
r7782 r8206 31 31 32 32 namespace HeuristicLab.Clients.Hive { 33 public class RefreshableJob : IHiveItem, IDeepCloneable, IContent, I ProgressReporter, IComparable<RefreshableJob> {33 public class RefreshableJob : IHiveItem, IDeepCloneable, IContent, IComparable<RefreshableJob> { 34 34 private JobResultPoller jobResultPoller; 35 35 private ConcurrentTaskDownloader<ItemTask> jobDownloader; 36 36 private static object locker = new object(); 37 38 public bool IsProgressing { get; set; } 37 39 38 40 private Job job; … … 165 167 } 166 168 167 private bool isProgressing;168 public bool IsProgressing{169 get { return isProgressing; }169 private Progress progress; 170 public Progress Progress { 171 get { return progress; } 170 172 set { 171 if (isProgressing != value) { 172 isProgressing = value; 173 OnIsProgressingChanged(); 174 } 175 } 176 } 177 178 private IProgress progress; 179 public IProgress Progress { 180 get { return progress; } 181 set { this.progress = value; } 182 } 173 this.progress = value; 174 OnIsProgressingChanged(); 175 } 176 } 177 183 178 184 179 private ThreadSafeLog log; … … 229 224 230 225 #region JobResultPoller Events 231 232 226 public void StartResultPolling() { 233 227 if (jobResultPoller == null) { … … 410 404 } 411 405 412 public event EventHandler IsProgressingChanged;413 protected virtual void OnIsProgressingChanged() {414 var handler = IsProgressingChanged;415 if (handler != null) handler(this, EventArgs.Empty);416 }417 418 406 public event EventHandler IsDownloadableChanged; 419 407 private void OnIsDownloadableChanged() { … … 475 463 if (handler != null) handler(this, EventArgs.Empty); 476 464 } 465 public event EventHandler IsProgressingChanged; 466 private void OnIsProgressingChanged() { 467 var handler = IsProgressingChanged; 468 if (handler != null) handler(this, EventArgs.Empty); 469 } 477 470 #endregion 478 471 … … 519 512 public event EventHandler HiveTasksChanged; 520 513 protected virtual void OnHiveTasksChanged() { 521 if (jobResultPoller != null && jobResultPoller.IsPolling) { 522 jobResultPoller.Stop(); 523 DeregisterResultPollingEvents(); 524 } 514 StopResultPolling(); 525 515 if (this.HiveTasks != null && this.HiveTasks.Count > 0 && this.GetAllHiveTasks().All(x => x.Task.Id != Guid.Empty)) { 526 516 if (IsFinished()) { 527 517 this.ExecutionState = Core.ExecutionState.Stopped; 528 518 this.RefreshAutomatically = false; 529 } 530 531 if (this.RefreshAutomatically) { 532 StartResultPolling(); 519 if (jobResultPoller != null) DeregisterResultPollingEvents(); 520 } else { 521 this.RefreshAutomatically = true; 533 522 } 534 523 }
Note: See TracChangeset
for help on using the changeset viewer.