- Timestamp:
- 04/19/11 18:58:53 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/EngineJob.cs
r6000 r6033 9 9 namespace HeuristicLab.HiveEngine { 10 10 [StorableClass] 11 public class EngineJob : AbstractJob { 12 [Storable] 13 private IEngine engine; 14 11 public class EngineJob : ItemJob { 15 12 [Storable] 16 13 protected IOperation initialOperation; … … 20 17 } 21 18 19 public new IEngine Item { 20 get { return (IEngine)base.Item; } 21 set { base.Item = value; } 22 } 23 22 24 public override TimeSpan ExecutionTime { 23 get { return engine.ExecutionTime; }25 get { return Item.ExecutionTime; } 24 26 } 25 27 26 28 public override ExecutionState ExecutionState { 27 get { return engine.ExecutionState; }29 get { return Item.ExecutionState; } 28 30 } 29 31 … … 32 34 public EngineJob(IOperation initialOperation, IEngine engine) { 33 35 this.initialOperation = initialOperation; 34 this.engine = engine; 35 RegisterEngineEvents(); 36 this.Item = engine; 36 37 } 37 38 … … 40 41 protected EngineJob(EngineJob original, Cloner cloner) 41 42 : base(original, cloner) { 42 this.engine = cloner.Clone(original.engine);43 43 this.initialOperation = cloner.Clone(original.initialOperation); 44 RegisterEngineEvents();45 44 } 46 45 public override IDeepCloneable Clone(Cloner cloner) { 47 46 return new EngineJob(this, cloner); 48 }49 [StorableHook(HookType.AfterDeserialization)]50 private void AfterDeserialization() {51 RegisterEngineEvents();52 47 } 53 48 #endregion … … 60 55 61 56 public override void Start() { 62 engine.Prepare(initialOperation);63 engine.Start();57 Item.Prepare(initialOperation); 58 Item.Start(); 64 59 } 65 60 66 61 public override void Pause() { 67 engine.Pause();62 Item.Pause(); 68 63 } 69 64 70 65 public override void Stop() { 71 engine.Stop();66 Item.Stop(); 72 67 } 73 68 … … 76 71 } 77 72 78 private void RegisterEngineEvents() { 79 engine.Stopped += new EventHandler(engine_Stopped); 80 engine.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred); 73 protected override void RegisterItemEvents() { 74 Item.Stopped += new EventHandler(engine_Stopped); 75 Item.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred); 76 } 77 78 protected override void DeregisterItemEvents() { 79 Item.Stopped -= new EventHandler(engine_Stopped); 80 Item.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(engine_ExceptionOccurred); 81 81 } 82 82 … … 103 103 104 104 public override string Name { 105 get { return engine.ToString(); }105 get { return Item.ToString(); } 106 106 set { throw new NotSupportedException(); } 107 107 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HeuristicLabHiveEnginePlugin.cs.frame
r5958 r6033 26 26 [PluginFile("HeuristicLab.HiveEngine-3.4.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Clients.Common", "3.3")] 28 [PluginDependency("HeuristicLab.Clients.Hive", "3.4")] 29 [PluginDependency("HeuristicLab.Clients.Hive.Views", "3.4")] 28 30 [PluginDependency("HeuristicLab.Collections", "3.3")] 29 31 [PluginDependency("HeuristicLab.Common", "3.3")] 30 32 [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 31 33 [PluginDependency("HeuristicLab.Core", "3.3")] 32 [PluginDependency("HeuristicLab.DataAccess", "3.3")] 33 [PluginDependency("HeuristicLab.Hive.Contracts", "3.3")] 34 [PluginDependency("HeuristicLab.Hive.ExperimentManager", "3.3")] 35 [PluginDependency("HeuristicLab.Hive.JobBase", "3.3")] 34 [PluginDependency("HeuristicLab.Core.Views", "3.3")] 35 [PluginDependency("HeuristicLab.Hive", "3.4")] 36 [PluginDependency("HeuristicLab.MainForm", "3.3")] 37 [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")] 38 [PluginDependency("HeuristicLab.Optimization.Views", "3.3")] 36 39 [PluginDependency("HeuristicLab.Persistence", "3.3")] 40 [PluginDependency("HeuristicLab.Random", "3.3")] 37 41 [PluginDependency("HeuristicLab.SequentialEngine", "3.3")] 38 42 public class HeuristicLabHiveEnginePlugin : PluginBase { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs
r6006 r6033 54 54 55 55 [Storable] 56 private ItemCollection< HiveExperiment> hiveExperiments;57 public ItemCollection< HiveExperiment> HiveExperiments {56 private ItemCollection<RefreshableHiveExperiment> hiveExperiments; 57 public ItemCollection<RefreshableHiveExperiment> HiveExperiments { 58 58 get { return hiveExperiments; } 59 59 set { hiveExperiments = value; } … … 75 75 public HiveEngine() { 76 76 ResourceNames = "HEAL"; 77 HiveExperiments = new ItemCollection< HiveExperiment>();77 HiveExperiments = new ItemCollection<RefreshableHiveExperiment>(); 78 78 Priority = 0; 79 79 } … … 239 239 hiveExperiment.UseLocalPlugins = this.UseLocalPlugins; 240 240 hiveExperiment.ResourceNames = this.ResourceNames; 241 hiveExperiment.RefreshAutomatically = false;242 241 hiveExperiment.Id = ServiceLocator.Instance.CallHiveService(s => s.AddHiveExperiment(hiveExperiment)); 243 hiveExperiments.Add( hiveExperiment);242 hiveExperiments.Add(new RefreshableHiveExperiment(hiveExperiment)); 244 243 245 244 // create upload-tasks -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/Views/HiveEngineView.Designer.cs
r6006 r6033 222 222 private System.Windows.Forms.TextBox priorityTextBox; 223 223 private System.Windows.Forms.Label label1; 224 pr otectedSystem.Windows.Forms.TextBox executionTimeOnHiveTextBox;224 private System.Windows.Forms.TextBox executionTimeOnHiveTextBox; 225 225 private System.Windows.Forms.TabControl tabControl; 226 226 private System.Windows.Forms.TabPage jobsTabPage; 227 227 private System.Windows.Forms.TabPage logTabPage; 228 228 private System.Windows.Forms.Label executionTimeLabel; 229 pr otectedSystem.Windows.Forms.TextBox executionTimeTextBox;229 private System.Windows.Forms.TextBox executionTimeTextBox; 230 230 private System.Windows.Forms.CheckBox useLocalPluginsCheckBox; 231 231 private HeuristicLab.Core.Views.LogView logView;
Note: See TracChangeset
for help on using the changeset viewer.