Changeset 6178 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/RefreshableHiveExperiment.cs
- Timestamp:
- 05/10/11 17:58:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/RefreshableHiveExperiment.cs
r6168 r6178 34 34 public class RefreshableHiveExperiment : IHiveItem, IDeepCloneable, IContent, IProgressReporter { 35 35 private JobResultPoller jobResultPoller; 36 private JobDownloader<ItemJob> jobDownloader = newJobDownloader<ItemJob>(2, 2);36 private ConcurrentJobDownloader<ItemJob> jobDownloader = new ConcurrentJobDownloader<ItemJob>(2, 2); 37 37 private static object locker = new object(); 38 38 … … 83 83 } 84 84 85 [Storable] 86 private bool isControllable = true; 87 public bool IsControllable { 88 get { return isControllable; } 89 set { 90 if (value != isControllable) { 91 isControllable = value; 92 OnIsControllableChanged(); 93 } 94 } 95 } 96 85 97 #region Constructors and Cloning 86 98 public RefreshableHiveExperiment() { … … 99 111 this.RefreshAutomatically = original.RefreshAutomatically; 100 112 this.IncludeJobs = original.IncludeJobs; 113 this.IsControllable = original.IsControllable; 101 114 } 102 115 public IDeepCloneable Clone(Cloner cloner) { … … 163 176 jobDownloader.DownloadJob(hj.Job.Id, (id, itemJob, exception) => { 164 177 if (exception != null) { 165 throw new JobDownloaderException("Downloading job failed.", exception);178 throw new ConcurrentJobDownloaderException("Downloading job failed.", exception); 166 179 } 167 180 … … 171 184 // if the job is paused, download but don't integrate into parent optimizer (to avoid Prepare) 172 185 if (hj.Job.State == JobState.Paused) { 173 hj. JobItem= itemJob;186 hj.ItemJob = itemJob; 174 187 } else { 175 188 if (lightweightJob.ParentJobId.HasValue) { … … 177 190 parentHiveJob.IntegrateChild(itemJob, hj.Job.Id); 178 191 } else { 179 hj. JobItem= itemJob;192 hj.ItemJob = itemJob; 180 193 } 181 194 } … … 211 224 212 225 public bool AllJobsFinished() { 213 return hiveExperiment.GetAllHiveJobs().All(j => j.Job.State == JobState.Finished 214 || j.Job.State == JobState.Aborted 215 || j.Job.State == JobState.Failed); 226 return hiveExperiment.GetAllHiveJobs().All(j => (j.Job.State == JobState.Finished 227 || j.Job.State == JobState.Aborted 228 || j.Job.State == JobState.Failed) 229 && j.ItemJobDownloaded); 216 230 } 217 231 … … 299 313 if (handler != null) handler(sender, e); 300 314 } 315 316 public event EventHandler IsControllableChanged; 317 private void OnIsControllableChanged() { 318 var handler = IsControllableChanged; 319 if (handler != null) handler(this, EventArgs.Empty); 320 } 301 321 #endregion 302 322
Note: See TracChangeset
for help on using the changeset viewer.