Changeset 4557 for branches/HeuristicLab.Hive/sources
- Timestamp:
- 10/05/10 17:00:47 (14 years ago)
- Location:
- branches/HeuristicLab.Hive/sources/HeuristicLab.Hive
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Calendar/3.3/Properties/AssemblyInfo.cs
r4425 r4557 58 58 // [assembly: AssemblyVersion("1.0.*")] 59 59 [assembly: AssemblyVersion("3.3.0.0")] 60 [assembly: AssemblyFileVersion("3.3.0.442 4")]60 [assembly: AssemblyFileVersion("3.3.0.4425")] -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/JobResult.cs
r4424 r4557 27 27 namespace HeuristicLab.Hive.Contracts.BusinessObjects { 28 28 29 // [chn] Where are those JobResults used? would it make sense to use it instead of JobDto for querying Job-Status? Probably yes30 // ask gradinger31 29 [StorableClass] 32 30 [DataContract] -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/HeuristicLab.Hive.Contracts-3.3.csproj
r4423 r4557 167 167 </ItemGroup> 168 168 <ItemGroup> 169 <None Include="Diagrams\Services.cd" /> 169 170 <None Include="HeuristicLab.snk" /> 170 171 <None Include="Properties\AssemblyInfo.frame" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HiveJobView.Designer.cs
r4423 r4557 55 55 this.childHiveJobView = new HeuristicLab.Hive.Experiment.Views.HiveJobListView(); 56 56 this.runsTabPage = new System.Windows.Forms.TabPage(); 57 this.runCollectionView = new HeuristicLab.Optimization.Views.RunCollectionView();58 57 this.logTabPage = new System.Windows.Forms.TabPage(); 59 58 this.logView = new HeuristicLab.Core.Views.LogView(); 59 this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 60 60 this.jobStatusGroupBox.SuspendLayout(); 61 61 this.tabControl.SuspendLayout(); … … 386 386 // runsTabPage 387 387 // 388 this.runsTabPage.Controls.Add(this.runCollectionView );388 this.runsTabPage.Controls.Add(this.runCollectionViewHost); 389 389 this.runsTabPage.Location = new System.Drawing.Point(4, 22); 390 390 this.runsTabPage.Name = "runsTabPage"; … … 393 393 this.runsTabPage.Text = "Runs"; 394 394 this.runsTabPage.UseVisualStyleBackColor = true; 395 //396 // runCollectionView397 //398 this.runCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)399 | System.Windows.Forms.AnchorStyles.Left)400 | System.Windows.Forms.AnchorStyles.Right)));401 this.runCollectionView.Caption = "RunCollection View";402 this.runCollectionView.Content = null;403 this.runCollectionView.Location = new System.Drawing.Point(3, 3);404 this.runCollectionView.Name = "runCollectionView";405 this.runCollectionView.ReadOnly = false;406 this.runCollectionView.Size = new System.Drawing.Size(613, 486);407 this.runCollectionView.TabIndex = 0;408 395 // 409 396 // logTabPage … … 430 417 this.logView.Size = new System.Drawing.Size(613, 486); 431 418 this.logView.TabIndex = 0; 419 // 420 // runCollectionViewHost 421 // 422 this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 423 | System.Windows.Forms.AnchorStyles.Left) 424 | System.Windows.Forms.AnchorStyles.Right))); 425 this.runCollectionViewHost.Caption = "View"; 426 this.runCollectionViewHost.Content = null; 427 this.runCollectionViewHost.Enabled = false; 428 this.runCollectionViewHost.Location = new System.Drawing.Point(3, 3); 429 this.runCollectionViewHost.Name = "runCollectionViewHost"; 430 this.runCollectionViewHost.ReadOnly = false; 431 this.runCollectionViewHost.Size = new System.Drawing.Size(613, 486); 432 this.runCollectionViewHost.TabIndex = 0; 433 this.runCollectionViewHost.ViewType = null; 432 434 // 433 435 // HiveJobView … … 488 490 private Core.Views.NamedItemView optimizerNamedItemView; 489 491 private System.Windows.Forms.TabPage runsTabPage; 490 private Optimization.Views.RunCollectionView runCollectionView;492 private MainForm.WindowsForms.ViewHost runCollectionViewHost; 491 493 } 492 494 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment.Views/3.3/HiveJobView.cs
r4424 r4557 80 80 if (Content != null && Content.Job != null && Content.Job.Optimizer != null) { 81 81 optimizerNamedItemView.Content = Content.Job.Optimizer; 82 runCollectionView .Content = Content.Job.Optimizer.Runs;82 runCollectionViewHost.Content = Content.Job.Optimizer.Runs; 83 83 } else { 84 84 optimizerNamedItemView.Content = null; 85 runCollectionView .Content = null;85 runCollectionViewHost.Content = null; 86 86 } 87 87 } -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HeuristicLab.Hive.Experiment-3.3.csproj
r4423 r4557 122 122 <Compile Include="HiveJob.cs" /> 123 123 <Compile Include="HiveJobList.cs" /> 124 <Compile Include="Jobs\JobList.cs" /> 125 <Compile Include="Jobs\OptimizerJob.cs" /> 124 126 <Compile Include="Progress\IProgress.cs" /> 125 127 <Compile Include="Progress\IProgressReporter.cs" /> 126 128 <Compile Include="JobResultPoller.cs" /> 127 129 <Compile Include="Exceptions\JobResultPollingException.cs" /> 128 <Compile Include="Jobs\JobList.cs" />129 130 <Compile Include="HiveClient.cs" /> 130 131 <Compile Include="HiveExperimentList.cs" /> 131 <Compile Include="Jobs\OptimizerJob.cs" />132 132 <Compile Include="HeuristicLabHiveExperimentPlugin.cs" /> 133 133 <Compile Include="Exceptions\OptimizerNotFoundException.cs" /> … … 146 146 <SubType>Designer</SubType> 147 147 </None> 148 <None Include="Jobs.cd" /> 148 149 <None Include="HeuristicLab.snk" /> 149 150 <None Include="Properties\AssemblyInfo.frame" /> -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveExperiment.cs
r4424 r4557 556 556 this.ExecutionTime = this.HiveJob.JobDto.DateFinished.Value - this.HiveJob.JobDto.DateCreated.Value; 557 557 this.lastUpdateTime = this.HiveJob.JobDto.DateFinished.Value; 558 this.ExecutionState = Core.ExecutionState.Stopped; 559 OnStopped(); 558 560 } else { 559 561 this.ExecutionTime = DateTime.Now - this.HiveJob.JobDto.DateCreated.Value; 560 562 this.lastUpdateTime = DateTime.Now; 563 this.ExecutionState = Core.ExecutionState.Started; 564 OnStarted(); 561 565 } 562 566 -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/HiveJob.cs
r4424 r4557 180 180 if (Job.Optimizer is Optimization.Experiment) { 181 181 Optimization.Experiment experiment = Job.OptimizerAsExperiment; 182 experiment.Optimizers.ItemsAdded += new Collections.CollectionItemsChangedEventHandler< Collections.IndexedItem<IOptimizer>>(Optimizers_ItemsAdded);183 experiment.Optimizers.ItemsReplaced += new Collections.CollectionItemsChangedEventHandler< Collections.IndexedItem<IOptimizer>>(Optimizers_ItemsReplaced);184 experiment.Optimizers.ItemsRemoved += new Collections.CollectionItemsChangedEventHandler< Collections.IndexedItem<IOptimizer>>(Optimizers_ItemsRemoved);182 experiment.Optimizers.ItemsAdded += new Collections.CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsAdded); 183 experiment.Optimizers.ItemsReplaced += new Collections.CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsReplaced); 184 experiment.Optimizers.ItemsRemoved += new Collections.CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsRemoved); 185 185 experiment.Optimizers.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_CollectionReset); 186 186 } else if (Job.Optimizer is Optimization.BatchRun) { … … 191 191 192 192 Job.ComputeInParallelChanged += new EventHandler(Job_ComputeInParallelChanged); 193 } 194 } 195 196 void batchRun_AlgorithmChanged(object sender, EventArgs e) { 197 if (syncJobsWithOptimizers) { 198 this.childHiveJobs.Clear(); 199 UpdateChildHiveJobs(); 200 } 201 } 202 203 void batchRun_RepetitionsChanged(object sender, EventArgs e) { 204 if (syncJobsWithOptimizers) { 205 UpdateChildHiveJobs(); 206 } 207 } 208 193 Job.ToStringChanged += new EventHandler(Job_ToStringChanged); 194 } 195 } 209 196 private void DergisterOptimizerEvents() { 210 197 if (Job != null && Job.Optimizer is Optimization.Experiment) { 211 198 if (Job.Optimizer is Optimization.Experiment) { 212 199 Optimization.Experiment experiment = Job.OptimizerAsExperiment; 213 experiment.Optimizers.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler< Collections.IndexedItem<IOptimizer>>(Optimizers_ItemsAdded);214 experiment.Optimizers.ItemsReplaced -= new Collections.CollectionItemsChangedEventHandler< Collections.IndexedItem<IOptimizer>>(Optimizers_ItemsReplaced);215 experiment.Optimizers.ItemsRemoved -= new Collections.CollectionItemsChangedEventHandler< Collections.IndexedItem<IOptimizer>>(Optimizers_ItemsRemoved);200 experiment.Optimizers.ItemsAdded -= new Collections.CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsAdded); 201 experiment.Optimizers.ItemsReplaced -= new Collections.CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsReplaced); 202 experiment.Optimizers.ItemsRemoved -= new Collections.CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsRemoved); 216 203 experiment.Optimizers.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_CollectionReset); 217 204 } else if (Job.Optimizer is Optimization.BatchRun) { … … 222 209 223 210 Job.ComputeInParallelChanged -= new EventHandler(Job_ComputeInParallelChanged); 224 } 211 Job.ToStringChanged -= new EventHandler(Job_ToStringChanged); 212 } 213 } 214 215 void batchRun_AlgorithmChanged(object sender, EventArgs e) { 216 if (syncJobsWithOptimizers) { 217 this.childHiveJobs.Clear(); 218 UpdateChildHiveJobs(); 219 } 220 } 221 222 void batchRun_RepetitionsChanged(object sender, EventArgs e) { 223 if (syncJobsWithOptimizers) { 224 UpdateChildHiveJobs(); 225 } 226 } 227 228 void Job_ToStringChanged(object sender, EventArgs e) { 229 this.OnToStringChanged(); 225 230 } 226 231 … … 294 299 public void UpdateChildOptimizer(OptimizerJob optimizerJob, Guid childJobId) { 295 300 syncJobsWithOptimizers = false; // don't sync with optimizers during this method 296 ExecutionState executionState = optimizerJob.Optimizer.ExecutionState; // has to be stored before adding the optimizers, because of the sideeffects of updating the optimizers in experiment/batchrun301 bool childIsFinishedOptimizerDownloaded = false; 297 302 298 303 if (this.Job.Optimizer is Optimization.Experiment) { 299 304 UpdateOptimizerInExperiment(this.Job.OptimizerAsExperiment, optimizerJob); 300 executionState = ExecutionState.Stopped;305 childIsFinishedOptimizerDownloaded = true; 301 306 } else if (this.Job.Optimizer is Optimization.BatchRun) { 302 307 UpdateOptimizerInBatchRun(this.Job.OptimizerAsBatchRun, optimizerJob); 303 executionState = ExecutionState.Stopped; 304 } 308 if (this.Job.OptimizerAsBatchRun.Repetitions == this.Job.Optimizer.Runs.Count) { 309 childIsFinishedOptimizerDownloaded = true; 310 } 311 } else { 312 childIsFinishedOptimizerDownloaded = optimizerJob.Optimizer.ExecutionState == ExecutionState.Stopped; 313 } 314 305 315 HiveJob child = this.ChildHiveJobs.Single(j => j.JobDto.Id == childJobId); 306 316 if (!optimizerJob.ComputeInParallel) { … … 309 319 child.syncJobsWithOptimizers = true; 310 320 } 311 if ( executionState == ExecutionState.Stopped) {321 if (childIsFinishedOptimizerDownloaded) { 312 322 child.IsFinishedOptimizerDownloaded = true; 313 323 } … … 373 383 public override string ToString() { 374 384 if (jobDto != null) { 375 return job. Name;385 return job.ToString(); 376 386 } else { 377 387 return base.ToString(); -
branches/HeuristicLab.Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Experiment/3.3/Jobs/OptimizerJob.cs
r4424 r4557 37 37 set { 38 38 if (value != optimizer) { 39 if (optimizer != null) { 40 DeregisterEvents(); 41 } 39 if (optimizer != null) DeregisterEvents(); 42 40 optimizer = value; 43 if (optimizer != null) { 44 RegisterEvents(); 45 } 41 if (optimizer != null) RegisterEvents(); 46 42 OnOptimizerChanged(); 47 43 } … … 88 84 public OptimizerJob(IOptimizer optimizer) 89 85 : this() { 90 this. optimizer = optimizer;86 this.Optimizer = optimizer; 91 87 92 88 if (optimizer is Optimization.Experiment) { … … 196 192 #endregion 197 193 198 #region Events194 #region Optimizer Events 199 195 protected virtual void RegisterEvents() { 200 196 optimizer.Stopped += new EventHandler(optimizer_Stopped); 201 197 optimizer.ExceptionOccurred += new EventHandler<Common.EventArgs<Exception>>(optimizer_ExceptionOccurred); 202 optimizer.DescriptionChanged += this.DescriptionChanged; 203 optimizer.FilenameChanged += this.FilenameChanged; 204 optimizer.ItemImageChanged += this.ItemImageChanged; 205 optimizer.NameChanged += this.NameChanged; 206 optimizer.NameChanging += this.NameChanging; 207 optimizer.ToStringChanged += this.ToStringChanged; 208 } 209 198 optimizer.DescriptionChanged += new EventHandler(optimizer_DescriptionChanged); 199 optimizer.ItemImageChanged += new EventHandler(optimizer_ItemImageChanged); 200 optimizer.NameChanged += new EventHandler(optimizer_NameChanged); 201 optimizer.NameChanging += new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging); 202 optimizer.ToStringChanged += new EventHandler(optimizer_ToStringChanged); 203 } 210 204 protected virtual void DeregisterEvents() { 211 205 optimizer.Stopped -= new EventHandler(optimizer_Stopped); 212 optimizer.ExceptionOccurred -= new EventHandler< Common.EventArgs<Exception>>(optimizer_ExceptionOccurred);206 optimizer.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred); 213 207 optimizer.DescriptionChanged -= this.DescriptionChanged; 214 optimizer.FilenameChanged -= this.FilenameChanged;215 208 optimizer.ItemImageChanged -= this.ItemImageChanged; 216 209 optimizer.NameChanged -= this.NameChanged; … … 219 212 } 220 213 214 void optimizer_ToStringChanged(object sender, EventArgs e) { 215 this.OnToStringChanged(); 216 } 217 218 void optimizer_NameChanging(object sender, CancelEventArgs<string> e) { 219 this.OnNameChanging(e.Value, e.Cancel); 220 } 221 222 void optimizer_NameChanged(object sender, EventArgs e) { 223 this.OnNameChanged(); 224 } 225 226 void optimizer_ItemImageChanged(object sender, EventArgs e) { 227 this.OnItemImageChanged(); 228 } 229 230 void optimizer_DescriptionChanged(object sender, EventArgs e) { 231 this.OnDescriptionChanged(); 232 } 233 221 234 protected virtual void optimizer_ExceptionOccurred(object sender, Common.EventArgs<Exception> e) { 222 235 OnJobFailed(e); … … 227 240 } 228 241 #endregion 229 230 242 231 243 #region INamedItem Members … … 243 255 set { optimizer.Description = value; } 244 256 } 245 public event EventHandler DescriptionChanged;246 257 247 258 public string Name { … … 249 260 set { optimizer.Name = value; } 250 261 } 262 #endregion 263 264 #region Events 265 public event EventHandler DescriptionChanged; 266 protected virtual void OnDescriptionChanged() { 267 var handler = DescriptionChanged; 268 if(handler != null) handler(this, EventArgs.Empty); 269 } 270 public event EventHandler ItemImageChanged; 271 protected virtual void OnItemImageChanged() { 272 var handler = ItemImageChanged; 273 if (handler != null) handler(this, EventArgs.Empty); 274 } 275 public event EventHandler ToStringChanged; 276 protected virtual void OnToStringChanged() { 277 var handler = ToStringChanged; 278 if (handler != null) handler(this, EventArgs.Empty); 279 } 251 280 public event EventHandler NameChanged; 252 public event EventHandler<Common.CancelEventArgs<string>> NameChanging; 253 281 protected virtual void OnNameChanged() { 282 var handler = NameChanged; 283 if (handler != null) handler(this, EventArgs.Empty); 284 } 285 public event EventHandler<CancelEventArgs<string>> NameChanging; 286 protected virtual void OnNameChanging(string value, bool cancel) { 287 var handler = NameChanging; 288 if (handler != null) handler(this, new CancelEventArgs<string>(value, cancel)); 289 } 254 290 #endregion 255 291 … … 264 300 } 265 301 266 public event EventHandler ItemImageChanged;267 302 public string ItemName { 268 303 get { return optimizer.ItemName; } … … 272 307 get { return optimizer.ItemVersion; } 273 308 } 274 public event EventHandler ToStringChanged;275 276 #endregion277 278 #region IStorableContent Members279 280 public string Filename {281 get;282 set;283 }284 public event EventHandler FilenameChanged;285 309 286 310 #endregion
Note: See TracChangeset
for help on using the changeset viewer.