Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/19/11 18:58:53 (13 years ago)
Author:
cneumuel
Message:

#1233

  • created baseclass for jobs (ItemJob) which derives OperatorJobs and EngineJobs
  • created special view for OptimizerJobs which derives from a more general view
  • removed logic from domain class HiveExperiment and moved it into RefreshableHiveExperiment
  • improved ItemTreeView
  • corrected plugin dependencies
  • fixed bug in database trigger when deleting HiveExperiments
  • added delete cascade for Plugin and PluginData
  • lots of fixes
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  
    99namespace HeuristicLab.HiveEngine {
    1010  [StorableClass]
    11   public class EngineJob : AbstractJob {
    12     [Storable]
    13     private IEngine engine;
    14 
     11  public class EngineJob : ItemJob {
    1512    [Storable]
    1613    protected IOperation initialOperation;
     
    2017    }
    2118
     19    public new IEngine Item {
     20      get { return (IEngine)base.Item; }
     21      set { base.Item = value; }
     22    }
     23
    2224    public override TimeSpan ExecutionTime {
    23       get { return engine.ExecutionTime; }
     25      get { return Item.ExecutionTime; }
    2426    }
    2527
    2628    public override ExecutionState ExecutionState {
    27       get { return engine.ExecutionState; }
     29      get { return Item.ExecutionState; }
    2830    }
    2931
     
    3234    public EngineJob(IOperation initialOperation, IEngine engine) {
    3335      this.initialOperation = initialOperation;
    34       this.engine = engine;
    35       RegisterEngineEvents();
     36      this.Item = engine;
    3637    }
    3738
     
    4041    protected EngineJob(EngineJob original, Cloner cloner)
    4142      : base(original, cloner) {
    42       this.engine = cloner.Clone(original.engine);
    4343      this.initialOperation = cloner.Clone(original.initialOperation);
    44       RegisterEngineEvents();
    4544    }
    4645    public override IDeepCloneable Clone(Cloner cloner) {
    4746      return new EngineJob(this, cloner);
    48     }
    49     [StorableHook(HookType.AfterDeserialization)]
    50     private void AfterDeserialization() {
    51       RegisterEngineEvents();
    5247    }
    5348    #endregion
     
    6055
    6156    public override void Start() {
    62       engine.Prepare(initialOperation);
    63       engine.Start();
     57      Item.Prepare(initialOperation);
     58      Item.Start();
    6459    }
    6560   
    6661    public override void Pause() {
    67       engine.Pause();
     62      Item.Pause();
    6863    }
    6964
    7065    public override void Stop() {
    71       engine.Stop();
     66      Item.Stop();
    7267    }
    7368   
     
    7671    }
    7772
    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);
    8181    }
    8282
     
    103103
    104104    public override string Name {
    105       get { return engine.ToString(); }
     105      get { return Item.ToString(); }
    106106      set { throw new NotSupportedException(); }
    107107    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HeuristicLabHiveEnginePlugin.cs.frame

    r5958 r6033  
    2626  [PluginFile("HeuristicLab.HiveEngine-3.4.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.Clients.Common", "3.3")]
     28  [PluginDependency("HeuristicLab.Clients.Hive", "3.4")]
     29  [PluginDependency("HeuristicLab.Clients.Hive.Views", "3.4")]
    2830  [PluginDependency("HeuristicLab.Collections", "3.3")]
    2931  [PluginDependency("HeuristicLab.Common", "3.3")]
    3032  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3133  [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")]
    3639  [PluginDependency("HeuristicLab.Persistence", "3.3")]
     40  [PluginDependency("HeuristicLab.Random", "3.3")]
    3741  [PluginDependency("HeuristicLab.SequentialEngine", "3.3")]
    3842  public class HeuristicLabHiveEnginePlugin : PluginBase {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs

    r6006 r6033  
    5454
    5555    [Storable]
    56     private ItemCollection<HiveExperiment> hiveExperiments;
    57     public ItemCollection<HiveExperiment> HiveExperiments {
     56    private ItemCollection<RefreshableHiveExperiment> hiveExperiments;
     57    public ItemCollection<RefreshableHiveExperiment> HiveExperiments {
    5858      get { return hiveExperiments; }
    5959      set { hiveExperiments = value; }
     
    7575    public HiveEngine() {
    7676      ResourceNames = "HEAL";
    77       HiveExperiments = new ItemCollection<HiveExperiment>();
     77      HiveExperiments = new ItemCollection<RefreshableHiveExperiment>();
    7878      Priority = 0;
    7979    }
     
    239239        hiveExperiment.UseLocalPlugins = this.UseLocalPlugins;
    240240        hiveExperiment.ResourceNames = this.ResourceNames;
    241         hiveExperiment.RefreshAutomatically = false;
    242241        hiveExperiment.Id = ServiceLocator.Instance.CallHiveService(s => s.AddHiveExperiment(hiveExperiment));
    243         hiveExperiments.Add(hiveExperiment);
     242        hiveExperiments.Add(new RefreshableHiveExperiment(hiveExperiment));
    244243
    245244        // create upload-tasks
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/Views/HiveEngineView.Designer.cs

    r6006 r6033  
    222222    private System.Windows.Forms.TextBox priorityTextBox;
    223223    private System.Windows.Forms.Label label1;
    224     protected System.Windows.Forms.TextBox executionTimeOnHiveTextBox;
     224    private System.Windows.Forms.TextBox executionTimeOnHiveTextBox;
    225225    private System.Windows.Forms.TabControl tabControl;
    226226    private System.Windows.Forms.TabPage jobsTabPage;
    227227    private System.Windows.Forms.TabPage logTabPage;
    228228    private System.Windows.Forms.Label executionTimeLabel;
    229     protected System.Windows.Forms.TextBox executionTimeTextBox;
     229    private System.Windows.Forms.TextBox executionTimeTextBox;
    230230    private System.Windows.Forms.CheckBox useLocalPluginsCheckBox;
    231231    private HeuristicLab.Core.Views.LogView logView;
Note: See TracChangeset for help on using the changeset viewer.