Changeset 6033


Ignore:
Timestamp:
04/19/11 18:58:53 (9 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
Files:
21 added
11 deleted
32 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.4/app_services.config

    r6008 r6033  
    2121      </service>
    2222    </services>
    23 
     23 
    2424   <client>
    2525     <endpoint name="SlaveCommunicationServiceEndpoint" address="net.pipe://localhost/HeuristicLabSlaveCom" binding="netNamedPipeBinding" contract="HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts.ISlaveCommunication"/>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveCommListener.cs

    r6004 r6033  
    5656
    5757    public void Close() {
    58       if (pipeFactory.State != CommunicationState.Closed) {
     58      if (pipeFactory.State != CommunicationState.Closed && pipeFactory.State != CommunicationState.Closing) {
    5959        pipeProxy.Unsubscribe();
    6060        pipeFactory.Close();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/HeuristicLab.Clients.Hive.Slave.Views-3.4.csproj

    r5852 r6033  
    7171  </PropertyGroup>
    7272  <ItemGroup>
    73     <Reference Include="HeuristicLab.Algorithms.GeneticAlgorithm-3.3">
    74       <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Algorithms.GeneticAlgorithm-3.3.dll</HintPath>
    75     </Reference>
    7673    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    7774      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/HeuristicLabClientsHiveSlaveViewsPlugin.cs.frame

    r5599 r6033  
    2929  [Plugin("HeuristicLab.Clients.Hive.Slave.Views", "3.4.0.$WCREV$")]
    3030  [PluginFile("HeuristicLab.Clients.Hive.Slave.Views-3.4.dll", PluginFileType.Assembly)]
     31  [PluginDependency("HeuristicLab.Clients.Hive.SlaveCore", "3.4")]
     32  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3133  [PluginDependency("HeuristicLab.Common", "3.3")]
     34  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3235  [PluginDependency("HeuristicLab.Core", "3.3")]
     36  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
     37  [PluginDependency("HeuristicLab.Data", "3.3")]
     38  [PluginDependency("HeuristicLab.Data.Views", "3.3")]
     39  [PluginDependency("HeuristicLab.MainForm", "3.3")]
     40  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
     41  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     42  [PluginDependency("HeuristicLab.Optimizer", "3.3")]
    3343  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    34   [PluginDependency("HeuristicLab.Clients.Hive.SlaveCore", "3.4")]
    3544  public class HeuristicLabClientsHiveSlaveViewsPlugin : PluginBase {
    3645  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/HeuristicLabClientsHiveSlavePlugin.cs.frame

    r5599 r6033  
    88  [Plugin("HeuristicLab.Clients.Hive.SlaveCore", "3.4.0.$WCREV$")]
    99  [PluginFile("HeuristicLab.Clients.Hive.SlaveCore-3.4.dll", PluginFileType.Assembly)]
     10 
     11  [PluginDependency("HeuristicLab.Clients.Common", "3.3")]
     12  [PluginDependency("HeuristicLab.Clients.Hive", "3.4")]
    1013  [PluginDependency("HeuristicLab.Common", "3.3")]
    1114  [PluginDependency("HeuristicLab.Core", "3.3")]
     15  [PluginDependency("HeuristicLab.Hive", "3.4")]
    1216  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    1317  public class HeuristicLabClientsHiveSlavePlugin : PluginBase {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/StatusCommons.cs

    r5599 r6033  
    4848    [DataMember]
    4949    public List<JobStatus> Jobs { get; set; }
     50
     51    public override string ToString() {
     52      return string.Format("Status: {0}, Fetched/Done/Aborted: {1},{2},{3}", Status, JobsFetched, JobsDone, JobsAborted);
     53    }
    5054  }
    5155}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveExperimentListView.cs

    r5955 r6033  
    2020#endregion
    2121
     22using System;
    2223using System.Windows.Forms;
    2324using HeuristicLab.Core;
     
    2728namespace HeuristicLab.Clients.Hive.Views {
    2829  [View("HiveExperimentList View")]
    29   [Content(typeof(ItemCollection<HiveExperiment>), false)]
    30   public partial class HiveExperimentListView : ItemCollectionView<HiveExperiment> {
     30  [Content(typeof(ItemCollection<RefreshableHiveExperiment>), false)]
     31  public partial class HiveExperimentListView : ItemCollectionView<RefreshableHiveExperiment> {
    3132
    3233    public HiveExperimentListView() {
     
    3435    }
    3536
    36     protected override HiveExperiment CreateItem() {
    37       return new HiveExperiment();
     37    protected override RefreshableHiveExperiment CreateItem() {
     38      return new RefreshableHiveExperiment();
     39    }
     40
     41    protected override void removeButton_Click(object sender, EventArgs e) {
     42      DialogResult result = MessageBox.Show("This action will permanently delete this experiment (also on the hive server). Continue?", "Delete Experiment", MessageBoxButtons.OKCancel);
     43      if (result == DialogResult.OK) {
     44        base.removeButton_Click(sender, e);
     45      }
    3846    }
    3947  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveExperimentManagerView.cs

    r5955 r6033  
    2121
    2222using System;
     23using System.Linq;
    2324using System.Windows.Forms;
     25using HeuristicLab.Collections;
    2426using HeuristicLab.MainForm;
    2527using HeuristicLab.MainForm.WindowsForms;
     
    5052      Content.Refreshing += new EventHandler(Content_Refreshing);
    5153      Content.Refreshed += new EventHandler(Content_Refreshed);
     54      Content.HiveExperimentsChanged += new EventHandler(Content_HiveExperimentsChanged);
     55     
    5256    }
    5357
     
    5559      Content.Refreshing -= new EventHandler(Content_Refreshing);
    5660      Content.Refreshed -= new EventHandler(Content_Refreshed);
     61      Content.HiveExperimentsChanged -= new EventHandler(Content_HiveExperimentsChanged);
    5762      base.DeregisterContentEvents();
    5863    }
     
    101106    protected override void OnClosing(FormClosingEventArgs e) {
    102107      base.OnClosing(e);
    103       if (Content != null) {
    104         foreach (var exp in Content.HiveExperiments) {
     108      if (Content != null && Content.HiveExperiments != null) {
     109        foreach (var exp in Content.HiveExperiments.OfType<RefreshableHiveExperiment>()) {
    105110          if (exp.RefreshAutomatically) {
    106111            exp.RefreshAutomatically = false; // stop result polling
     
    109114      }
    110115    }
     116
     117    private void HiveExperiments_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<RefreshableHiveExperiment> e) {
     118      foreach (var item in e.Items) {
     119        ExperimentManagerClient.Delete(item);
     120      }
     121    }
     122
     123    private void Content_HiveExperimentsChanged(object sender, EventArgs e) {
     124      Content.HiveExperiments.ItemsRemoved += new CollectionItemsChangedEventHandler<RefreshableHiveExperiment>(HiveExperiments_ItemsRemoved);
     125    }
    111126  }
    112127}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.cs

    r5793 r6033  
    2929  [View("HiveJob View")]
    3030  [Content(typeof(HiveJob), true)]
     31  [Content(typeof(HiveJob<>), false)]
    3132  public partial class HiveJobView : ItemView {
    3233    public new HiveJob Content {
     
    4546    protected override void RegisterContentEvents() {
    4647      base.RegisterContentEvents();
    47       Content.OptimizerJobChanged += new EventHandler(Content_OptimizerJobChanged);
     48      Content.JobItemChanged += new EventHandler(Content_JobItemChanged);
    4849      Content.JobChanged += new EventHandler(Content_JobChanged);
    4950      Content.JobStateChanged += new EventHandler(Content_JobStateChanged);
     
    5152
    5253    protected override void DeregisterContentEvents() {
    53       Content.OptimizerJobChanged -= new EventHandler(Content_OptimizerJobChanged);
     54      Content.JobItemChanged -= new EventHandler(Content_JobItemChanged);
    5455      Content.JobChanged -= new EventHandler(Content_JobChanged);
    5556      Content.JobStateChanged -= new EventHandler(Content_JobStateChanged);
     
    6061      base.OnContentChanged();
    6162      if (Content != null && Content.Job != null) {
    62         logView.Content = Content.OptimizerJob.Log;
    63         computeInParallelCheckBox.Checked = Content.OptimizerJob.ComputeInParallel;
     63        computeInParallelCheckBox.Checked = Content.JobItem.ComputeInParallel;
    6464      } else {
    65         logView.Content = null;
    6665        computeInParallelCheckBox.Checked = false;
    6766      }
    68       Content_OptimizerJobChanged(this, EventArgs.Empty);
     67      Content_JobItemChanged(this, EventArgs.Empty);
    6968      Content_JobChanged(this, EventArgs.Empty);
    7069      Content_JobStateChanged(this, EventArgs.Empty);
    7170    }
    7271
    73     protected void Content_OptimizerJobChanged(object sender, EventArgs e) {
    74       RegisterJobEvents();
    75       Job_OptimizerChanged(this, e);
    76     }
    77 
    78     protected void Job_OptimizerChanged(object sender, EventArgs e) {
    79       if (Content != null && Content.Job != null && Content.OptimizerJob.Optimizer != null) {
    80         optimizerNamedItemView.Content = Content.OptimizerJob.Optimizer;
    81         runCollectionViewHost.Content = Content.OptimizerJob.Optimizer.Runs;
    82       } else {
    83         optimizerNamedItemView.Content = null;
    84         runCollectionViewHost.Content = null;
     72    protected virtual void RegisterJobEvents() {
     73      if (Content != null && Content.Job != null) {
     74        Content.JobItem.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged);
     75        Content.JobItem.ItemChanged += new EventHandler(Job_ItemChanged);
    8576      }
    8677    }
    8778
    88     private void RegisterJobEvents() {
     79    protected virtual void DeregisterJobEvents() {
    8980      if (Content != null && Content.Job != null) {
    90         Content.OptimizerJob.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged);
    91         Content.OptimizerJob.OptimizerChanged += new EventHandler(Job_OptimizerChanged);
    92       }
    93     }
    94 
    95     private void DeregisterJobEvents() {
    96       if (Content != null && Content.Job != null) {
    97         Content.OptimizerJob.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged);
    98         Content.OptimizerJob.OptimizerChanged -= new EventHandler(Job_OptimizerChanged);
     81        Content.JobItem.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged);
     82        Content.JobItem.ItemChanged -= new EventHandler(Job_ItemChanged);
    9983      }
    10084    }
    10185
    10286    #region Content Events
    103     private void Content_JobChanged(object sender, EventArgs e) {
     87    protected virtual void Content_JobChanged(object sender, EventArgs e) {
    10488      if (InvokeRequired) {
    10589        Invoke(new EventHandler(Content_JobChanged), sender, e);
     
    121105    }
    122106
    123     private void Content_JobStateChanged(object sender, EventArgs e) {
     107    protected virtual void Content_JobItemChanged(object sender, EventArgs e) {
     108      RegisterJobEvents();
     109      Job_ItemChanged(this, e);
     110    }
     111
     112    protected virtual void Job_ItemChanged(object sender, EventArgs e) {
     113      if (Content != null && Content.Job != null && Content.JobItem.Item != null) {
     114        optimizerItemView.Content = Content.JobItem.Item;
     115      } else {
     116        optimizerItemView.Content = null;
     117      }
     118    }
     119
     120    protected virtual void Content_JobStateChanged(object sender, EventArgs e) {
    124121      if (InvokeRequired) {
    125122        Invoke(new EventHandler(Content_JobStateChanged), sender, e);
     
    131128          this.exceptionTextBox.Text = Content.Job.CurrentStateLog != null ? Content.Job.CurrentStateLog.Exception : string.Empty;
    132129          this.lastUpdatedTextBox.Text = Content.Job.LastJobDataUpdate.ToString();
    133           if (Content.OptimizerJob.ComputeInParallel) {
     130          if (Content.JobItem.ComputeInParallel) {
    134131            this.stateLogViewHost.Content = new StateLogListList(
    135132                this.Content.ChildHiveJobs.Select(child => new StateLogList(child.Job.StateLog)
     
    165162      this.coresNeededTextBox.ReadOnly = this.ReadOnly;
    166163      this.memoryNeededTextBox.ReadOnly = this.ReadOnly;
    167       this.computeInParallelCheckBox.Enabled = !this.ReadOnly && this.Content != null && this.Content.OptimizerJob != null && this.Content.OptimizerJob.IsParallelizable;
     164      this.computeInParallelCheckBox.Enabled = !this.ReadOnly && this.Content != null && this.Content.JobItem != null && this.Content.JobItem.IsParallelizable;
    168165
    169       this.restartButton.Enabled = Content != null && Content.Job.State == JobState.Paused;
    170       this.pauseButton.Enabled = Content != null && Content.Job.State == JobState.Calculating;
    171       this.stopButton.Enabled = Content != null && (Content.Job.State == JobState.Calculating || Content.Job.State == JobState.Waiting || Content.Job.State == JobState.Paused);
    172       this.showOptimizerButton.Enabled = Content != null && Content.Job.State == JobState.Paused && Content.OptimizerJob != null && Content.OptimizerJob.Optimizer != null;
     166      this.modifyItemButton.Enabled = (Content != null && Content.JobItem.Item != null && (Content.Job.State == JobState.Paused || Content.Job.State == JobState.Offline || Content.Job.State == JobState.Finished || Content.Job.State == JobState.Failed || Content.Job.State == JobState.Aborted));
    173167
    174       optimizerNamedItemView.ReadOnly = true;
     168      optimizerItemView.ReadOnly = true;
    175169    }
    176170
    177     void OptimizerJob_ComputeInParallelChanged(object sender, EventArgs e) {
     171    protected virtual void OptimizerJob_ComputeInParallelChanged(object sender, EventArgs e) {
    178172      if (InvokeRequired) {
    179173        Invoke(new EventHandler(OptimizerJob_ComputeInParallelChanged), sender, e);
    180174      } else {
    181         computeInParallelCheckBox.Checked = Content.OptimizerJob.ComputeInParallel;
     175        computeInParallelCheckBox.Checked = Content.JobItem.ComputeInParallel;
    182176      }
    183177    }
    184178    #endregion
    185179
    186     private void computeInParallelCheckBox_CheckedChanged(object sender, EventArgs e) {
    187       if (Content != null && Content.OptimizerJob != null) {
    188         this.Content.OptimizerJob.ComputeInParallel = this.computeInParallelCheckBox.Checked;
     180    #region Child Control Events
     181     protected virtual void computeInParallelCheckBox_CheckedChanged(object sender, EventArgs e) {
     182      if (Content != null && Content.JobItem != null) {
     183        this.Content.JobItem.ComputeInParallel = this.computeInParallelCheckBox.Checked;
    189184      }
    190185    }
    191186
    192     private void exceptionTextBox_DoubleClick(object sender, EventArgs e) {
     187    protected virtual void exceptionTextBox_DoubleClick(object sender, EventArgs e) {
    193188      using (TextDialog dialog = new TextDialog("Exception", exceptionTextBox.Text, ReadOnly || !Content.CanChangeDescription)) {
    194189        if (dialog.ShowDialog(this) == DialogResult.OK)
     
    197192    }
    198193
    199     private void restartButton_Click(object sender, EventArgs e) {
    200       Content.Restart();
     194    protected virtual void modifyItemButton_Click(object sender, EventArgs e) {
     195      MainFormManager.MainForm.ShowContent(Content.JobItem.Item);
    201196    }
    202 
    203     private void pauseButton_Click(object sender, EventArgs e) {
    204       Content.Pause();
    205     }
    206 
    207     private void stopButton_Click(object sender, EventArgs e) {
    208       Content.Stop();
    209     }
    210     private void showOptimizerButton_Click(object sender, EventArgs e) {
    211       MainFormManager.MainForm.ShowContent(Content.OptimizerJob.Optimizer);
    212     }
     197    #endregion
    213198  }
    214199}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.designer.cs

    r5797 r6033  
    2424    /// </summary>
    2525    private void InitializeComponent() {
    26       System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HiveJobView));
    27       this.logTabPage = new System.Windows.Forms.TabPage();
    28       this.logView = new HeuristicLab.Core.Views.LogView();
    2926      this.stateLogTabPage = new System.Windows.Forms.TabPage();
    3027      this.stateLogViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    31       this.runsTabPage = new System.Windows.Forms.TabPage();
    32       this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    3328      this.detailsTabPage = new System.Windows.Forms.TabPage();
    34       this.restartButton = new System.Windows.Forms.Button();
    35       this.pauseButton = new System.Windows.Forms.Button();
    36       this.stopButton = new System.Windows.Forms.Button();
    37       this.optimizerGroupBox = new System.Windows.Forms.GroupBox();
    38       this.showOptimizerButton = new System.Windows.Forms.Button();
    39       this.lastUpdatedTextBox = new System.Windows.Forms.TextBox();
    40       this.lastUpdatedLabel = new System.Windows.Forms.Label();
    41       this.optimizerNamedItemView = new HeuristicLab.Core.Views.NamedItemView();
     29      this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    4230      this.configurationGroupBox = new System.Windows.Forms.GroupBox();
    4331      this.priorityTextBox = new System.Windows.Forms.TextBox();
     
    4937      this.computeInParallelLabel = new System.Windows.Forms.Label();
    5038      this.computeInParallelCheckBox = new System.Windows.Forms.CheckBox();
    51       this.jobIdLabel = new System.Windows.Forms.Label();
    52       this.jobIdTextBox = new System.Windows.Forms.TextBox();
    5339      this.jobStatusGroupBox = new System.Windows.Forms.GroupBox();
    5440      this.stateTextBox = new System.Windows.Forms.TextBox();
     
    6450      this.dateFinishedLabel = new System.Windows.Forms.Label();
    6551      this.exceptionTextBox = new System.Windows.Forms.TextBox();
     52      this.optimizerGroupBox = new System.Windows.Forms.GroupBox();
     53      this.modifyItemButton = new System.Windows.Forms.Button();
     54      this.lastUpdatedTextBox = new System.Windows.Forms.TextBox();
     55      this.lastUpdatedLabel = new System.Windows.Forms.Label();
     56      this.optimizerItemView = new HeuristicLab.Core.Views.ItemView();
     57      this.jobIdLabel = new System.Windows.Forms.Label();
     58      this.jobIdTextBox = new System.Windows.Forms.TextBox();
    6659      this.tabControl = new System.Windows.Forms.TabControl();
    67       this.splitContainer1 = new System.Windows.Forms.SplitContainer();
    68       this.logTabPage.SuspendLayout();
    6960      this.stateLogTabPage.SuspendLayout();
    70       this.runsTabPage.SuspendLayout();
    7161      this.detailsTabPage.SuspendLayout();
    72       this.optimizerGroupBox.SuspendLayout();
    73       this.configurationGroupBox.SuspendLayout();
    74       this.jobStatusGroupBox.SuspendLayout();
    75       this.tabControl.SuspendLayout();
    7662      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
    7763      this.splitContainer1.Panel1.SuspendLayout();
    7864      this.splitContainer1.Panel2.SuspendLayout();
    7965      this.splitContainer1.SuspendLayout();
     66      this.configurationGroupBox.SuspendLayout();
     67      this.jobStatusGroupBox.SuspendLayout();
     68      this.optimizerGroupBox.SuspendLayout();
     69      this.tabControl.SuspendLayout();
    8070      this.SuspendLayout();
    81       //
    82       // logTabPage
    83       //
    84       this.logTabPage.Controls.Add(this.logView);
    85       this.logTabPage.Location = new System.Drawing.Point(4, 22);
    86       this.logTabPage.Name = "logTabPage";
    87       this.logTabPage.Padding = new System.Windows.Forms.Padding(3);
    88       this.logTabPage.Size = new System.Drawing.Size(611, 492);
    89       this.logTabPage.TabIndex = 1;
    90       this.logTabPage.Text = "Log";
    91       this.logTabPage.UseVisualStyleBackColor = true;
    92       //
    93       // logView
    94       //
    95       this.logView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    96                   | System.Windows.Forms.AnchorStyles.Left)
    97                   | System.Windows.Forms.AnchorStyles.Right)));
    98       this.logView.Caption = "Log View";
    99       this.logView.Content = null;
    100       this.logView.Location = new System.Drawing.Point(3, 3);
    101       this.logView.Name = "logView";
    102       this.logView.ReadOnly = false;
    103       this.logView.Size = new System.Drawing.Size(613, 486);
    104       this.logView.TabIndex = 0;
    10571      //
    10672      // stateLogTabPage
     
    10975      this.stateLogTabPage.Location = new System.Drawing.Point(4, 22);
    11076      this.stateLogTabPage.Name = "stateLogTabPage";
    111       this.stateLogTabPage.Size = new System.Drawing.Size(611, 492);
     77      this.stateLogTabPage.Size = new System.Drawing.Size(563, 375);
    11278      this.stateLogTabPage.TabIndex = 5;
    11379      this.stateLogTabPage.Text = "State";
     
    12389      this.stateLogViewHost.Name = "stateLogViewHost";
    12490      this.stateLogViewHost.ReadOnly = false;
    125       this.stateLogViewHost.Size = new System.Drawing.Size(611, 492);
     91      this.stateLogViewHost.Size = new System.Drawing.Size(563, 375);
    12692      this.stateLogViewHost.TabIndex = 0;
    12793      this.stateLogViewHost.ViewsLabelVisible = true;
    12894      this.stateLogViewHost.ViewType = null;
    12995      //
    130       // runsTabPage
    131       //
    132       this.runsTabPage.Controls.Add(this.runCollectionViewHost);
    133       this.runsTabPage.Location = new System.Drawing.Point(4, 22);
    134       this.runsTabPage.Name = "runsTabPage";
    135       this.runsTabPage.Size = new System.Drawing.Size(611, 492);
    136       this.runsTabPage.TabIndex = 4;
    137       this.runsTabPage.Text = "Runs";
    138       this.runsTabPage.UseVisualStyleBackColor = true;
    139       //
    140       // runCollectionViewHost
    141       //
    142       this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    143                   | System.Windows.Forms.AnchorStyles.Left)
    144                   | System.Windows.Forms.AnchorStyles.Right)));
    145       this.runCollectionViewHost.Caption = "View";
    146       this.runCollectionViewHost.Content = null;
    147       this.runCollectionViewHost.Enabled = false;
    148       this.runCollectionViewHost.Location = new System.Drawing.Point(3, 3);
    149       this.runCollectionViewHost.Name = "runCollectionViewHost";
    150       this.runCollectionViewHost.ReadOnly = false;
    151       this.runCollectionViewHost.Size = new System.Drawing.Size(613, 486);
    152       this.runCollectionViewHost.TabIndex = 0;
    153       this.runCollectionViewHost.ViewsLabelVisible = true;
    154       this.runCollectionViewHost.ViewType = null;
    155       //
    15696      // detailsTabPage
    15797      //
    15898      this.detailsTabPage.Controls.Add(this.splitContainer1);
    159       this.detailsTabPage.Controls.Add(this.restartButton);
    160       this.detailsTabPage.Controls.Add(this.pauseButton);
    161       this.detailsTabPage.Controls.Add(this.stopButton);
    16299      this.detailsTabPage.Controls.Add(this.optimizerGroupBox);
    163100      this.detailsTabPage.Controls.Add(this.jobIdLabel);
     
    171108      this.detailsTabPage.UseVisualStyleBackColor = true;
    172109      //
    173       // restartButton
    174       //
    175       this.restartButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    176       this.restartButton.Image = ((System.Drawing.Image)(resources.GetObject("restartButton.Image")));
    177       this.restartButton.Location = new System.Drawing.Point(3, 348);
    178       this.restartButton.Name = "restartButton";
    179       this.restartButton.Size = new System.Drawing.Size(24, 24);
    180       this.restartButton.TabIndex = 30;
    181       this.restartButton.UseVisualStyleBackColor = true;
    182       this.restartButton.Click += new System.EventHandler(this.restartButton_Click);
    183       //
    184       // pauseButton
    185       //
    186       this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    187       this.pauseButton.Enabled = false;
    188       this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image")));
    189       this.pauseButton.Location = new System.Drawing.Point(33, 348);
    190       this.pauseButton.Name = "pauseButton";
    191       this.pauseButton.Size = new System.Drawing.Size(24, 24);
    192       this.pauseButton.TabIndex = 31;
    193       this.pauseButton.UseVisualStyleBackColor = true;
    194       this.pauseButton.Click += new System.EventHandler(this.pauseButton_Click);
    195       //
    196       // stopButton
    197       //
    198       this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    199       this.stopButton.Image = ((System.Drawing.Image)(resources.GetObject("stopButton.Image")));
    200       this.stopButton.Location = new System.Drawing.Point(63, 348);
    201       this.stopButton.Name = "stopButton";
    202       this.stopButton.Size = new System.Drawing.Size(24, 24);
    203       this.stopButton.TabIndex = 32;
    204       this.stopButton.UseVisualStyleBackColor = true;
    205       this.stopButton.Click += new System.EventHandler(this.stopButton_Click);
    206       //
    207       // optimizerGroupBox
    208       //
    209       this.optimizerGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    210                   | System.Windows.Forms.AnchorStyles.Right)));
    211       this.optimizerGroupBox.Controls.Add(this.showOptimizerButton);
    212       this.optimizerGroupBox.Controls.Add(this.lastUpdatedTextBox);
    213       this.optimizerGroupBox.Controls.Add(this.lastUpdatedLabel);
    214       this.optimizerGroupBox.Controls.Add(this.optimizerNamedItemView);
    215       this.optimizerGroupBox.Location = new System.Drawing.Point(6, 29);
    216       this.optimizerGroupBox.Name = "optimizerGroupBox";
    217       this.optimizerGroupBox.Size = new System.Drawing.Size(551, 129);
    218       this.optimizerGroupBox.TabIndex = 28;
    219       this.optimizerGroupBox.TabStop = false;
    220       this.optimizerGroupBox.Text = "Optimizer";
    221       //
    222       // showOptimizerButton
    223       //
    224       this.showOptimizerButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    225                   | System.Windows.Forms.AnchorStyles.Right)));
    226       this.showOptimizerButton.Location = new System.Drawing.Point(78, 99);
    227       this.showOptimizerButton.Name = "showOptimizerButton";
    228       this.showOptimizerButton.Size = new System.Drawing.Size(467, 23);
    229       this.showOptimizerButton.TabIndex = 3;
    230       this.showOptimizerButton.Text = "Show Optimizer";
    231       this.showOptimizerButton.UseVisualStyleBackColor = true;
    232       this.showOptimizerButton.Click += new System.EventHandler(this.showOptimizerButton_Click);
    233       //
    234       // lastUpdatedTextBox
    235       //
    236       this.lastUpdatedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    237                   | System.Windows.Forms.AnchorStyles.Right)));
    238       this.lastUpdatedTextBox.Location = new System.Drawing.Point(78, 73);
    239       this.lastUpdatedTextBox.Name = "lastUpdatedTextBox";
    240       this.lastUpdatedTextBox.Size = new System.Drawing.Size(467, 20);
    241       this.lastUpdatedTextBox.TabIndex = 2;
    242       //
    243       // lastUpdatedLabel
    244       //
    245       this.lastUpdatedLabel.AutoSize = true;
    246       this.lastUpdatedLabel.Location = new System.Drawing.Point(9, 76);
    247       this.lastUpdatedLabel.Name = "lastUpdatedLabel";
    248       this.lastUpdatedLabel.Size = new System.Drawing.Size(71, 13);
    249       this.lastUpdatedLabel.TabIndex = 1;
    250       this.lastUpdatedLabel.Text = "LastUpdated:";
    251       //
    252       // optimizerNamedItemView
    253       //
    254       this.optimizerNamedItemView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    255                   | System.Windows.Forms.AnchorStyles.Right)));
    256       this.optimizerNamedItemView.Caption = "NamedItem View";
    257       this.optimizerNamedItemView.Content = null;
    258       this.optimizerNamedItemView.Location = new System.Drawing.Point(6, 20);
    259       this.optimizerNamedItemView.Name = "optimizerNamedItemView";
    260       this.optimizerNamedItemView.ReadOnly = false;
    261       this.optimizerNamedItemView.Size = new System.Drawing.Size(539, 51);
    262       this.optimizerNamedItemView.TabIndex = 0;
     110      // splitContainer1
     111      //
     112      this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     113                  | System.Windows.Forms.AnchorStyles.Right)));
     114      this.splitContainer1.Location = new System.Drawing.Point(6, 110);
     115      this.splitContainer1.Name = "splitContainer1";
     116      //
     117      // splitContainer1.Panel1
     118      //
     119      this.splitContainer1.Panel1.Controls.Add(this.configurationGroupBox);
     120      //
     121      // splitContainer1.Panel2
     122      //
     123      this.splitContainer1.Panel2.Controls.Add(this.jobStatusGroupBox);
     124      this.splitContainer1.Size = new System.Drawing.Size(551, 155);
     125      this.splitContainer1.SplitterDistance = 275;
     126      this.splitContainer1.TabIndex = 33;
    263127      //
    264128      // configurationGroupBox
     
    352216      this.computeInParallelCheckBox.UseVisualStyleBackColor = true;
    353217      this.computeInParallelCheckBox.CheckedChanged += new System.EventHandler(this.computeInParallelCheckBox_CheckedChanged);
    354       //
    355       // jobIdLabel
    356       //
    357       this.jobIdLabel.AutoSize = true;
    358       this.jobIdLabel.Location = new System.Drawing.Point(3, 6);
    359       this.jobIdLabel.Name = "jobIdLabel";
    360       this.jobIdLabel.Size = new System.Drawing.Size(36, 13);
    361       this.jobIdLabel.TabIndex = 25;
    362       this.jobIdLabel.Text = "JobId:";
    363       //
    364       // jobIdTextBox
    365       //
    366       this.jobIdTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    367                   | System.Windows.Forms.AnchorStyles.Right)));
    368       this.jobIdTextBox.Location = new System.Drawing.Point(91, 6);
    369       this.jobIdTextBox.Name = "jobIdTextBox";
    370       this.jobIdTextBox.Size = new System.Drawing.Size(466, 20);
    371       this.jobIdTextBox.TabIndex = 26;
    372218      //
    373219      // jobStatusGroupBox
     
    502348      this.exceptionTextBox.DoubleClick += new System.EventHandler(this.exceptionTextBox_DoubleClick);
    503349      //
     350      // optimizerGroupBox
     351      //
     352      this.optimizerGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     353                  | System.Windows.Forms.AnchorStyles.Right)));
     354      this.optimizerGroupBox.Controls.Add(this.modifyItemButton);
     355      this.optimizerGroupBox.Controls.Add(this.lastUpdatedTextBox);
     356      this.optimizerGroupBox.Controls.Add(this.lastUpdatedLabel);
     357      this.optimizerGroupBox.Controls.Add(this.optimizerItemView);
     358      this.optimizerGroupBox.Location = new System.Drawing.Point(6, 29);
     359      this.optimizerGroupBox.Name = "optimizerGroupBox";
     360      this.optimizerGroupBox.Size = new System.Drawing.Size(551, 75);
     361      this.optimizerGroupBox.TabIndex = 28;
     362      this.optimizerGroupBox.TabStop = false;
     363      this.optimizerGroupBox.Text = "JobItem";
     364      //
     365      // modifyItemButton
     366      //
     367      this.modifyItemButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     368                  | System.Windows.Forms.AnchorStyles.Right)));
     369      this.modifyItemButton.Location = new System.Drawing.Point(78, 45);
     370      this.modifyItemButton.Name = "modifyItemButton";
     371      this.modifyItemButton.Size = new System.Drawing.Size(467, 23);
     372      this.modifyItemButton.TabIndex = 3;
     373      this.modifyItemButton.Text = "Modify Item";
     374      this.modifyItemButton.UseVisualStyleBackColor = true;
     375      this.modifyItemButton.Click += new System.EventHandler(this.modifyItemButton_Click);
     376      //
     377      // lastUpdatedTextBox
     378      //
     379      this.lastUpdatedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     380                  | System.Windows.Forms.AnchorStyles.Right)));
     381      this.lastUpdatedTextBox.Location = new System.Drawing.Point(78, 19);
     382      this.lastUpdatedTextBox.Name = "lastUpdatedTextBox";
     383      this.lastUpdatedTextBox.Size = new System.Drawing.Size(467, 20);
     384      this.lastUpdatedTextBox.TabIndex = 2;
     385      //
     386      // lastUpdatedLabel
     387      //
     388      this.lastUpdatedLabel.AutoSize = true;
     389      this.lastUpdatedLabel.Location = new System.Drawing.Point(3, 22);
     390      this.lastUpdatedLabel.Name = "lastUpdatedLabel";
     391      this.lastUpdatedLabel.Size = new System.Drawing.Size(71, 13);
     392      this.lastUpdatedLabel.TabIndex = 1;
     393      this.lastUpdatedLabel.Text = "LastUpdated:";
     394      //
     395      // optimizerItemView
     396      //
     397      this.optimizerItemView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     398                  | System.Windows.Forms.AnchorStyles.Right)));
     399      this.optimizerItemView.Caption = "NamedItem View";
     400      this.optimizerItemView.Content = null;
     401      this.optimizerItemView.Location = new System.Drawing.Point(6, 20);
     402      this.optimizerItemView.Name = "optimizerItemView";
     403      this.optimizerItemView.ReadOnly = false;
     404      this.optimizerItemView.Size = new System.Drawing.Size(539, 51);
     405      this.optimizerItemView.TabIndex = 0;
     406      //
     407      // jobIdLabel
     408      //
     409      this.jobIdLabel.AutoSize = true;
     410      this.jobIdLabel.Location = new System.Drawing.Point(3, 6);
     411      this.jobIdLabel.Name = "jobIdLabel";
     412      this.jobIdLabel.Size = new System.Drawing.Size(36, 13);
     413      this.jobIdLabel.TabIndex = 25;
     414      this.jobIdLabel.Text = "JobId:";
     415      //
     416      // jobIdTextBox
     417      //
     418      this.jobIdTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     419                  | System.Windows.Forms.AnchorStyles.Right)));
     420      this.jobIdTextBox.Location = new System.Drawing.Point(91, 6);
     421      this.jobIdTextBox.Name = "jobIdTextBox";
     422      this.jobIdTextBox.Size = new System.Drawing.Size(466, 20);
     423      this.jobIdTextBox.TabIndex = 26;
     424      //
    504425      // tabControl
    505426      //
     
    509430      this.tabControl.Controls.Add(this.detailsTabPage);
    510431      this.tabControl.Controls.Add(this.stateLogTabPage);
    511       this.tabControl.Controls.Add(this.runsTabPage);
    512       this.tabControl.Controls.Add(this.logTabPage);
    513432      this.tabControl.Location = new System.Drawing.Point(3, 3);
    514433      this.tabControl.Name = "tabControl";
     
    517436      this.tabControl.TabIndex = 25;
    518437      //
    519       // splitContainer1
    520       //
    521       this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    522                   | System.Windows.Forms.AnchorStyles.Right)));
    523       this.splitContainer1.Location = new System.Drawing.Point(6, 164);
    524       this.splitContainer1.Name = "splitContainer1";
    525       //
    526       // splitContainer1.Panel1
    527       //
    528       this.splitContainer1.Panel1.Controls.Add(this.configurationGroupBox);
    529       //
    530       // splitContainer1.Panel2
    531       //
    532       this.splitContainer1.Panel2.Controls.Add(this.jobStatusGroupBox);
    533       this.splitContainer1.Size = new System.Drawing.Size(551, 155);
    534       this.splitContainer1.SplitterDistance = 275;
    535       this.splitContainer1.TabIndex = 33;
    536       //
    537438      // HiveJobView
    538439      //
     
    542443      this.Name = "HiveJobView";
    543444      this.Size = new System.Drawing.Size(577, 407);
    544       this.logTabPage.ResumeLayout(false);
    545445      this.stateLogTabPage.ResumeLayout(false);
    546       this.runsTabPage.ResumeLayout(false);
    547446      this.detailsTabPage.ResumeLayout(false);
    548447      this.detailsTabPage.PerformLayout();
    549       this.optimizerGroupBox.ResumeLayout(false);
    550       this.optimizerGroupBox.PerformLayout();
     448      this.splitContainer1.Panel1.ResumeLayout(false);
     449      this.splitContainer1.Panel2.ResumeLayout(false);
     450      ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
     451      this.splitContainer1.ResumeLayout(false);
    551452      this.configurationGroupBox.ResumeLayout(false);
    552453      this.configurationGroupBox.PerformLayout();
    553454      this.jobStatusGroupBox.ResumeLayout(false);
    554455      this.jobStatusGroupBox.PerformLayout();
     456      this.optimizerGroupBox.ResumeLayout(false);
     457      this.optimizerGroupBox.PerformLayout();
    555458      this.tabControl.ResumeLayout(false);
    556       this.splitContainer1.Panel1.ResumeLayout(false);
    557       this.splitContainer1.Panel2.ResumeLayout(false);
    558       ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
    559       this.splitContainer1.ResumeLayout(false);
    560459      this.ResumeLayout(false);
    561460
     
    564463    #endregion
    565464
    566     private System.Windows.Forms.TabPage logTabPage;
    567     private Core.Views.LogView logView;
    568     private System.Windows.Forms.TabPage stateLogTabPage;
    569     private MainForm.WindowsForms.ViewHost stateLogViewHost;
    570     private System.Windows.Forms.TabPage runsTabPage;
    571     private MainForm.WindowsForms.ViewHost runCollectionViewHost;
    572     private System.Windows.Forms.TabPage detailsTabPage;
    573     private System.Windows.Forms.GroupBox optimizerGroupBox;
    574     private Core.Views.NamedItemView optimizerNamedItemView;
    575     private System.Windows.Forms.GroupBox configurationGroupBox;
    576     private System.Windows.Forms.TextBox priorityTextBox;
    577     private System.Windows.Forms.Label priorityLabel;
    578     private System.Windows.Forms.TextBox coresNeededTextBox;
    579     private System.Windows.Forms.TextBox memoryNeededTextBox;
    580     private System.Windows.Forms.Label memoryNeededLabel;
    581     private System.Windows.Forms.Label coresNeededLabel;
    582     private System.Windows.Forms.Label computeInParallelLabel;
    583     private System.Windows.Forms.CheckBox computeInParallelCheckBox;
    584     private System.Windows.Forms.Label jobIdLabel;
    585     private System.Windows.Forms.TextBox jobIdTextBox;
    586     private System.Windows.Forms.GroupBox jobStatusGroupBox;
    587     private System.Windows.Forms.TextBox stateTextBox;
    588     private System.Windows.Forms.Label stateLabel;
    589     private System.Windows.Forms.TextBox dateFinishedTextBox;
    590     private System.Windows.Forms.TextBox executionTimeTextBox;
    591     private System.Windows.Forms.Label executionTimeLabel;
    592     private System.Windows.Forms.Label exceptionLabel;
    593     private System.Windows.Forms.Label dateFinishedLabel;
    594     private System.Windows.Forms.TextBox exceptionTextBox;
    595     private System.Windows.Forms.TabControl tabControl;
    596     private System.Windows.Forms.Button restartButton;
    597     private System.Windows.Forms.Button pauseButton;
    598     private System.Windows.Forms.Button stopButton;
    599     private System.Windows.Forms.Button showOptimizerButton;
    600     private System.Windows.Forms.TextBox lastUpdatedTextBox;
    601     private System.Windows.Forms.Label lastUpdatedLabel;
    602     private System.Windows.Forms.Label dateCalculatedLabel;
    603     private System.Windows.Forms.TextBox dateCalculatedText;
    604     private System.Windows.Forms.TextBox dateCreatedTextBox;
    605     private System.Windows.Forms.Label dateCreatedLabel;
    606     private System.Windows.Forms.SplitContainer splitContainer1;
     465    protected System.Windows.Forms.TabPage stateLogTabPage;
     466    protected MainForm.WindowsForms.ViewHost stateLogViewHost;
     467    protected System.Windows.Forms.TabPage detailsTabPage;
     468    protected System.Windows.Forms.GroupBox optimizerGroupBox;
     469    protected Core.Views.ItemView optimizerItemView;
     470    protected System.Windows.Forms.GroupBox configurationGroupBox;
     471    protected System.Windows.Forms.TextBox priorityTextBox;
     472    protected System.Windows.Forms.Label priorityLabel;
     473    protected System.Windows.Forms.TextBox coresNeededTextBox;
     474    protected System.Windows.Forms.TextBox memoryNeededTextBox;
     475    protected System.Windows.Forms.Label memoryNeededLabel;
     476    protected System.Windows.Forms.Label coresNeededLabel;
     477    protected System.Windows.Forms.Label computeInParallelLabel;
     478    protected System.Windows.Forms.CheckBox computeInParallelCheckBox;
     479    protected System.Windows.Forms.Label jobIdLabel;
     480    protected System.Windows.Forms.TextBox jobIdTextBox;
     481    protected System.Windows.Forms.GroupBox jobStatusGroupBox;
     482    protected System.Windows.Forms.TextBox stateTextBox;
     483    protected System.Windows.Forms.Label stateLabel;
     484    protected System.Windows.Forms.TextBox dateFinishedTextBox;
     485    protected System.Windows.Forms.TextBox executionTimeTextBox;
     486    protected System.Windows.Forms.Label executionTimeLabel;
     487    protected System.Windows.Forms.Label exceptionLabel;
     488    protected System.Windows.Forms.Label dateFinishedLabel;
     489    protected System.Windows.Forms.TextBox exceptionTextBox;
     490    protected System.Windows.Forms.TabControl tabControl;
     491    protected System.Windows.Forms.Button modifyItemButton;
     492    protected System.Windows.Forms.TextBox lastUpdatedTextBox;
     493    protected System.Windows.Forms.Label lastUpdatedLabel;
     494    protected System.Windows.Forms.Label dateCalculatedLabel;
     495    protected System.Windows.Forms.TextBox dateCalculatedText;
     496    protected System.Windows.Forms.TextBox dateCreatedTextBox;
     497    protected System.Windows.Forms.Label dateCreatedLabel;
     498    protected System.Windows.Forms.SplitContainer splitContainer1;
    607499
    608500  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.resx

    r5779 r6033  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
    120   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    121   <data name="restartButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    122     <value>
    123         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
    124         YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/wAA
    125         Cv8BNGKaggAAALBJREFUOE9j+P//PwMlGKvmsv3ZbsQaitWAhBkR/4k1BKcBlmX6RBmC1YCoKUH/N9xa
    126         /J8YQ7AaEDzBG2Q7UYZgNcCnyxlsAAhHLQrA6xKsBjg2W/zP2BAL1mzbrP9fp1jhv0QaN4hWQ48drAaY
    127         1+ihaOZPYMGqGWQYVgP0SpXhNuPTjNMAlXwpsLMJacZpgHSGIFGacRogksyJ089EBSK20MaVNyjKiTi9
    128         QGxOBKkDACT9xOni1RbMAAAAAElFTkSuQmCC
    129 </value>
    130   </data>
    131   <data name="pauseButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    132     <value>
    133         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
    134         YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/wAA
    135         Cv8BNGKaggAAAL5JREFUOE9j+P//PwMlmCLNIIsHoQG9m//+79rw63/e1EefQE5E56OHF4YXQJqvPvzz
    136         Xzd0FVDtfwZ0PkED2tZ++3/r6e//qn6LwAag8wka0Lji8//LD3//l3ObBTYAnU/QgNrF7/+fuP77v5jd
    137         JLAB6HyCBlTMe/V/94Wf//nNusEGoPMJGlAy+/n/9Sd//uc0aAUbgM4naEDB9Mf/F+z5/J9VpxFsADqf
    138         oAGg+GfTbYIbgM4naACpGWvg8wIAkX3yJyVePz4AAAAASUVORK5CYII=
    139 </value>
    140   </data>
    141   <data name="stopButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    142     <value>
    143         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
    144         YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAK/wAA
    145         Cv8BNGKaggAAAWtJREFUOE/Nkz9IAmEYxl0KGqKtMVpaIiEoipYIgnByCSGhSQiCNBqCMiqwsr8clChF
    146         YmYSSikeWEbZH2qwEhKhwhAXjQwKEbw0zyue7nO7hgtyqOEbf7/ne5+XVwJAUsorCSbB/0xAeT+xSBcw
    147         685B52QwYU9jdOMFw+ZnDK0+YtCUyHzvSzACge/jH7hLcAg8FHB4w8IbZOEKsLD4s5AqdnheWLpAQJKj
    148         TxyCUa4IOi/yWPPlsOJlMGePoU6+JS4g376NczgKsdg+y8PIg3pnBmPWV6ipMGq61sUFZOarCAf3JZ98
    149         8I75XQKnoDEmoRg5RXW7QVxACvOHWdhO8lim36C1ptFvSEI5E4NsYA9VLUviAtK255qFcT+LSXsKahMP
    150         66OQa0Po7HOholEvLiCr2jxmMG2LQEOFoBw/55M96FA50NpjRlmDTlxA9tym8qGpl0Z9twO1Mktx7srm
    151         BZRLp34W/Oao/v4WvgBcI/R+TmAaZAAAAABJRU5ErkJggg==
    152 </value>
    153   </data>
    154120</root>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/StateLogView.cs

    r5636 r6033  
    2727namespace HeuristicLab.Clients.Hive.Views {
    2828  [View("StateLog View")]
    29   [Content(typeof(StateLog), IsDefaultView = false)]
     29  [Content(typeof(StateLog), IsDefaultView = true)]
    3030  public sealed partial class StateLogView : ItemView {
    3131    public new StateLog Content {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/HeuristicLab.Clients.Hive.Views-3.4.csproj

    r6006 r6033  
    7474      <HintPath>C:\Program Files\HeuristicLab 3.3\Calendar.DayView.dll</HintPath>
    7575    </Reference>
    76     <Reference Include="HeuristicLab.Clients.Hive.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    7776    <Reference Include="HeuristicLab.Collections-3.3">
    7877      <HintPath>C:\Program Files\HeuristicLab 3.3\HeuristicLab.Collections-3.3.dll</HintPath>
     
    158157      <DependentUpon>UpdateControl.cs</DependentUpon>
    159158    </Compile>
    160     <Compile Include="ExperimentManager\HiveExperimentView.cs">
    161       <SubType>UserControl</SubType>
    162     </Compile>
    163     <Compile Include="ExperimentManager\HiveExperimentView.Designer.cs">
    164       <DependentUpon>HiveExperimentView.cs</DependentUpon>
     159    <Compile Include="ExperimentManager\OptimizerHiveJobView.cs">
     160      <SubType>UserControl</SubType>
     161    </Compile>
     162    <Compile Include="ExperimentManager\OptimizerHiveJobView.designer.cs">
     163      <DependentUpon>OptimizerHiveJobView.cs</DependentUpon>
     164    </Compile>
     165    <Compile Include="ExperimentManager\RefreshableHiveExperimentView.cs">
     166      <SubType>UserControl</SubType>
     167    </Compile>
     168    <Compile Include="ExperimentManager\RefreshableHiveExperimentView.Designer.cs">
     169      <DependentUpon>RefreshableHiveExperimentView.cs</DependentUpon>
    165170    </Compile>
    166171    <Compile Include="ExperimentManager\HiveItemView.cs">
     
    171176    </Compile>
    172177    <Compile Include="ExperimentManager\StateLogListList.cs" />
    173     <Compile Include="ExperimentManager\ItemTreeView.cs">
    174       <SubType>UserControl</SubType>
    175     </Compile>
    176     <Compile Include="ExperimentManager\ItemTreeView.designer.cs">
     178    <Compile Include="ExperimentManager\TreeView\NewExperimentTreeNodeAction.cs" />
     179    <Compile Include="ExperimentManager\TreeView\DeleteJobTreeNodeAction.cs" />
     180    <Compile Include="ExperimentManager\TreeView\HiveJobItemTreeView.cs">
     181      <SubType>UserControl</SubType>
     182    </Compile>
     183    <Compile Include="ExperimentManager\TreeView\HiveJobItemTreeView.Designer.cs">
     184      <DependentUpon>HiveJobItemTreeView.cs</DependentUpon>
     185    </Compile>
     186    <Compile Include="ExperimentManager\TreeView\ItemTreeView.cs">
     187      <SubType>UserControl</SubType>
     188    </Compile>
     189    <Compile Include="ExperimentManager\TreeView\ItemTreeView.designer.cs">
    177190      <DependentUpon>ItemTreeView.cs</DependentUpon>
    178191    </Compile>
     
    283296      <DependentUpon>UpdateControl.cs</DependentUpon>
    284297    </EmbeddedResource>
    285     <EmbeddedResource Include="ExperimentManager\HiveExperimentView.resx">
    286       <DependentUpon>HiveExperimentView.cs</DependentUpon>
    287     </EmbeddedResource>
    288     <EmbeddedResource Include="ExperimentManager\ItemTreeView.resx">
     298    <EmbeddedResource Include="ExperimentManager\OptimizerHiveJobView.resx">
     299      <DependentUpon>OptimizerHiveJobView.cs</DependentUpon>
     300    </EmbeddedResource>
     301    <EmbeddedResource Include="ExperimentManager\RefreshableHiveExperimentView.resx">
     302      <DependentUpon>RefreshableHiveExperimentView.cs</DependentUpon>
     303    </EmbeddedResource>
     304    <EmbeddedResource Include="ExperimentManager\TreeView\ItemTreeView.resx">
    289305      <DependentUpon>ItemTreeView.cs</DependentUpon>
    290306    </EmbeddedResource>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/HeuristicLabClientsHiveViewsPlugin.cs.frame

    r5591 r6033  
    88  [Plugin("HeuristicLab.Clients.Hive.Views", "3.4.0.$WCREV$")]
    99  [PluginFile("HeuristicLab.Clients.Hive.Views-3.4.dll", PluginFileType.Assembly)]
     10  [PluginDependency("HeuristicLab.Clients.Hive", "3.4")]
     11  [PluginDependency("HeuristicLab.Collections", "3.3")]
    1012  [PluginDependency("HeuristicLab.Common", "3.3")]
     13  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    1114  [PluginDependency("HeuristicLab.Core", "3.3")]
     15  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
     16  [PluginDependency("HeuristicLab.Data", "3.3")]
     17  [PluginDependency("HeuristicLab.DayView", "1.0")]
     18  [PluginDependency("HeuristicLab.Hive", "3.4")]
     19  [PluginDependency("HeuristicLab.MainForm", "3.3")]
     20  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
     21  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     22  [PluginDependency("HeuristicLab.Optimizer", "3.3")]
    1223  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    13   [PluginDependency("HeuristicLab.DayView", "1.0")]
     24  [PluginDependency("HeuristicLab.Services.Hive.Common", "3.4")]
     25  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")]
    1426  public class HeuristicLabClientsHiveViewsPlugin : PluginBase {
    1527  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/ExperimentManagerClient.cs

    r6006 r6033  
    2626using System.Linq;
    2727using System.Threading;
     28using HeuristicLab.Clients.Hive.ExperimentManager;
    2829using HeuristicLab.Clients.Hive.Jobs;
    2930using HeuristicLab.Common;
     
    4445
    4546    #region Properties
    46     private ItemCollection<HiveExperiment> hiveExperiments;
    47     public ItemCollection<HiveExperiment> HiveExperiments {
     47    private ItemCollection<RefreshableHiveExperiment> hiveExperiments;
     48    public ItemCollection<RefreshableHiveExperiment> HiveExperiments {
    4849      get { return hiveExperiments; }
    49       set { hiveExperiments = value; }
    50     }
    51 
     50      set {
     51        if (value != hiveExperiments) {
     52          hiveExperiments = value;
     53          OnHiveExperimentsChanged();
     54        }
     55      }
     56    }
     57   
    5258    private List<Plugin> onlinePlugins;
    5359    public List<Plugin> OnlinePlugins {
     
    6975      OnRefreshing();
    7076
    71       hiveExperiments = new HiveItemCollection<HiveExperiment>();
    72 
    7377      try {
    74         hiveExperiments.AddRange(ServiceLocator.Instance.CallHiveService<List<HiveExperiment>>(s => s.GetHiveExperiments()).OrderBy(x => x.Name));
     78        hiveExperiments = new HiveItemCollection<RefreshableHiveExperiment>();
     79        var he = ServiceLocator.Instance.CallHiveService<IEnumerable<HiveExperiment>>(s => s.GetHiveExperiments());
     80        hiveExperiments.AddRange(he.Select(x => new RefreshableHiveExperiment(x)).OrderBy(x => x.HiveExperiment.Name));
     81      }
     82      catch {
     83        hiveExperiments = null;
     84        throw;
    7585      }
    7686      finally {
     
    98108    public static void Store(IHiveItem item) {
    99109      if (item.Id == Guid.Empty) {
    100         if (item is HiveExperiment) {
    101           ExperimentManagerClient.Instance.UploadExperiment((HiveExperiment)item);
     110        if (item is RefreshableHiveExperiment) {
     111          ExperimentManagerClient.Instance.UploadExperiment((RefreshableHiveExperiment)item);
    102112        }
    103113      } else {
     114
    104115        if (item is HiveExperiment)
    105116          ServiceLocator.Instance.CallHiveService(s => s.UpdateHiveExperiment((HiveExperiment)item));
     
    127138      if (item is HiveExperiment)
    128139        ServiceLocator.Instance.CallHiveService(s => s.DeleteHiveExperiment(item.Id));
     140      if (item is RefreshableHiveExperiment)
     141        ServiceLocator.Instance.CallHiveService(s => s.DeleteHiveExperiment(item.Id));
    129142      item.Id = Guid.Empty;
    130143    }
     
    142155      if (handler != null) handler(this, EventArgs.Empty);
    143156    }
    144     #endregion
    145 
    146     public static void StartExperiment(Action<Exception> exceptionCallback, HiveExperiment hiveExperiment) {
     157    public event EventHandler HiveExperimentsChanged;
     158    private void OnHiveExperimentsChanged() {
     159      var handler = HiveExperimentsChanged;
     160      if (handler != null) handler(this, EventArgs.Empty);
     161    }
     162    #endregion
     163
     164    public static void StartExperiment(Action<Exception> exceptionCallback, RefreshableHiveExperiment refreshableHiveExperiment) {
    147165      ExperimentManagerClient.StoreAsync(
    148166        new Action<Exception>((Exception ex) => {
    149           hiveExperiment.ExecutionState = ExecutionState.Prepared;
     167          refreshableHiveExperiment.HiveExperiment.ExecutionState = ExecutionState.Prepared;
    150168          exceptionCallback(ex);
    151         }), hiveExperiment);
    152       hiveExperiment.ExecutionState = ExecutionState.Started;
     169        }), refreshableHiveExperiment);
     170      refreshableHiveExperiment.HiveExperiment.ExecutionState = ExecutionState.Started;
    153171    }
    154172
     
    174192
    175193    #region Upload Experiment
    176     private void UploadExperiment(HiveExperiment hiveExperiment) {
     194    private void UploadExperiment(RefreshableHiveExperiment optimizerHiveExperiment) {
    177195      try {
    178         hiveExperiment.Progress = new Progress("Connecting to server...");
    179         hiveExperiment.IsProgressing = true;
     196        optimizerHiveExperiment.HiveExperiment.Progress = new Progress("Connecting to server...");
     197        optimizerHiveExperiment.HiveExperiment.IsProgressing = true;
    180198        ServiceLocator.Instance.CallHiveService(service => {
    181           IEnumerable<string> resourceNames = ToResourceNameList(hiveExperiment.ResourceNames);
     199          IEnumerable<string> resourceNames = ToResourceNameList(optimizerHiveExperiment.HiveExperiment.ResourceNames);
    182200          var resourceIds = new List<Guid>();
    183201          foreach (var resourceName in resourceNames) {
     
    189207          }
    190208
    191           foreach (HiveJob hiveJob in hiveExperiment.HiveJobs) {
     209          foreach (OptimizerHiveJob hiveJob in optimizerHiveExperiment.HiveExperiment.HiveJobs.OfType<OptimizerHiveJob>()) {
    192210            hiveJob.SetIndexInParentOptimizerList(null);
    193211          }
    194212
    195213          // upload HiveExperiment
    196           hiveExperiment.Progress.Status = "Uploading HiveExperiment...";
    197           hiveExperiment.Id = service.AddHiveExperiment(hiveExperiment);
    198 
    199           int totalJobCount = hiveExperiment.GetAllHiveJobs().Count();
     214          optimizerHiveExperiment.HiveExperiment.Progress.Status = "Uploading HiveExperiment...";
     215          optimizerHiveExperiment.HiveExperiment.Id = service.AddHiveExperiment(optimizerHiveExperiment.HiveExperiment);
     216
     217          int totalJobCount = optimizerHiveExperiment.HiveExperiment.GetAllHiveJobs().Count();
    200218          int jobCount = 0;
    201219
    202220          // upload plugins
    203           hiveExperiment.Progress.Status = "Uploading plugins...";
     221          optimizerHiveExperiment.HiveExperiment.Progress.Status = "Uploading plugins...";
    204222          this.OnlinePlugins = service.GetPlugins();
    205223          this.AlreadyUploadedPlugins = new List<Plugin>();
     
    208226
    209227          // upload jobs
    210           hiveExperiment.Progress.Status = "Uploading jobs...";
    211 
    212           foreach (HiveJob hiveJob in hiveExperiment.HiveJobs) {
    213             UploadJobWithChildren(hiveExperiment.Progress, service, hiveJob, null, resourceIds, ref jobCount, totalJobCount, configFilePlugin.Id, hiveExperiment.UseLocalPlugins, hiveExperiment.Id);
     228          optimizerHiveExperiment.HiveExperiment.Progress.Status = "Uploading jobs...";
     229
     230          foreach (HiveJob hiveJob in optimizerHiveExperiment.HiveExperiment.HiveJobs) {
     231            UploadJobWithChildren(optimizerHiveExperiment.HiveExperiment.Progress, service, hiveJob, null, resourceIds, ref jobCount, totalJobCount, configFilePlugin.Id, optimizerHiveExperiment.HiveExperiment.UseLocalPlugins, optimizerHiveExperiment.HiveExperiment.Id);
    214232          }
    215233
    216           if (hiveExperiment.RefreshAutomatically) hiveExperiment.StartResultPolling();
     234          if (optimizerHiveExperiment.RefreshAutomatically) optimizerHiveExperiment.StartResultPolling();
    217235        });
    218236      }
    219237      finally {
    220         hiveExperiment.IsProgressing = false;
     238        optimizerHiveExperiment.HiveExperiment.IsProgressing = false;
    221239      }
    222240    }
     
    256274      List<IPluginDescription> plugins;
    257275
    258       if (hiveJob.OptimizerJob.ComputeInParallel &&
    259         (hiveJob.OptimizerJob.Optimizer is Optimization.Experiment || hiveJob.OptimizerJob.Optimizer is Optimization.BatchRun)) {
     276      if (hiveJob.JobItem.ComputeInParallel &&
     277        (hiveJob.JobItem.Item is Optimization.Experiment || hiveJob.JobItem.Item is Optimization.BatchRun)) {
    260278        hiveJob.Job.IsParentJob = true;
    261279        hiveJob.Job.FinishWhenChildJobsFinished = true;
    262         hiveJob.OptimizerJob.CollectChildJobs = false; // don't collect child-jobs on slaves
     280        hiveJob.JobItem.CollectChildJobs = false; // don't collect child-jobs on slaves
    263281        jobData = hiveJob.GetAsJobData(true, out plugins);
    264282      } else {
     
    312330
    313331        hiveExperiment.HiveJobs = new ItemCollection<HiveJob>(allHiveJobs.Values.Where(x => !x.Job.ParentJobId.HasValue));
    314         //hiveExperiment.HiveJobs = allHiveJobs[hiveExperiment.RootJobId];
    315332
    316333        if (hiveExperiment.IsFinished()) {
    317           //hiveExperiment.ExecutionTime = hiveExperiment.HiveJobs.Max(.Job.DateFinished.Value - hiveExperiment.HiveJobs.Job.DateCreated.Value;
    318           //hiveExperiment.lastUpdateTime = hiveExperiment.HiveJob.Job.DateFinished.Value;
    319334          hiveExperiment.ExecutionState = Core.ExecutionState.Stopped;
    320           //OnStopped(); // todo: stop timer
    321335        } else {
    322           //hiveExperiment.ExecutionTime = hiveExperiment.HiveJobs.Job.DateCreated.HasValue ? DateTime.Now - hiveExperiment.HiveJobs.Job.DateCreated.Value : TimeSpan.Zero;
    323           //hiveExperiment.lastUpdateTime = DateTime.Now;
    324336          hiveExperiment.ExecutionState = Core.ExecutionState.Started;
    325           //OnStarted(); // todo: start timer
    326         }
    327         hiveExperiment.UpdateTotalExecutionTime();
     337        }
    328338
    329339        // build child-job tree
     
    331341          BuildHiveJobTree(hiveJob, allJobs, allHiveJobs);
    332342        }
    333         hiveExperiment.UpdateTotalExecutionTime();
    334 
    335         if (hiveExperiment.ExecutionState != ExecutionState.Stopped) {
    336           hiveExperiment.RefreshAutomatically = true;
    337         }
     343
     344        hiveExperiment.OnLoaded();
    338345      }
    339346      finally {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJob.cs

    r6006 r6033  
    2424using System.Drawing;
    2525using System.Linq;
    26 using HeuristicLab.Clients.Hive.Jobs;
    2726using HeuristicLab.Collections;
    2827using HeuristicLab.Common;
    2928using HeuristicLab.Core;
    30 using HeuristicLab.Optimization;
     29using HeuristicLab.Hive;
    3130using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3231using HeuristicLab.PluginInfrastructure;
     
    3635  [Item("Hive Job", "Represents a hive job.")]
    3736  [StorableClass]
    38   public class HiveJob : NamedItem, IItemTree {
    39     private static object locker = new object();
     37  public class HiveJob : NamedItem, IItemTree<HiveJob> {
     38    protected static object locker = new object();
    4039
    4140    public override Image ItemImage {
     
    5655    }
    5756
    58     private Job job;
     57    protected Job job;
    5958    public Job Job {
    6059      get { return job; }
     
    7069
    7170    [Storable]
    72     private OptimizerJob optimizerJob;
    73     public OptimizerJob OptimizerJob {
    74       get { return optimizerJob; }
     71    protected ItemJob jobItem;
     72    public ItemJob JobItem {
     73      get { return jobItem; }
    7574      internal set {
    76         if (optimizerJob != null && syncJobsWithOptimizers) {
     75        if (jobItem != null && syncJobsWithOptimizers) {
    7776          this.childHiveJobs.Clear();
    7877        }
    79         if (optimizerJob != value) {
    80           DergisterOptimizerEvents();
    81           optimizerJob = value;
    82           RegisterOptimizerEvents();
    83           OnOptimizerJobChanged();
     78        if (jobItem != value) {
     79          DergisterJobItemsEvents();
     80          jobItem = value;
     81          RegisterJobItemEvents();
     82          OnJobItemChanged();
    8483        }
    8584      }
     
    8786
    8887    [Storable]
    89     private ItemList<HiveJob> childHiveJobs;
    90     public ReadOnlyItemList<HiveJob> ChildHiveJobs {
     88    protected ItemList<HiveJob> childHiveJobs;
     89    public virtual ReadOnlyItemList<HiveJob> ChildHiveJobs {
    9190      get { return childHiveJobs.AsReadOnly(); }
    9291    }
    9392
    9493    [Storable]
    95     private bool syncJobsWithOptimizers = true;
    96 
     94    protected bool syncJobsWithOptimizers = true;
     95
     96    #region Constructors and Cloning
    9797    public HiveJob() {
    9898      this.Job = new Job() {
     
    106106    }
    107107
    108     public HiveJob(OptimizerJob optimizerJob, bool autoCreateChildHiveJobs)
     108    public HiveJob(ItemJob jobItem, bool autoCreateChildHiveJobs)
    109109      : this() {
    110110      this.syncJobsWithOptimizers = autoCreateChildHiveJobs;
    111       this.OptimizerJob = optimizerJob;
     111      this.JobItem = jobItem;
    112112      this.syncJobsWithOptimizers = true;
    113     }
    114 
    115     public HiveJob(IOptimizer optimizer)
    116       : this() {
    117       this.OptimizerJob = new OptimizerJob(optimizer);
    118113    }
    119114
     
    122117      this.Job = job;
    123118      try {
    124         this.OptimizerJob = PersistenceUtil.Deserialize<OptimizerJob>(jobData.Data);
     119        this.JobItem = PersistenceUtil.Deserialize<ItemJob>(jobData.Data);
    125120      }
    126121      catch {
    127         this.OptimizerJob = null;
     122        this.JobItem = null;
    128123      }
    129124      this.childHiveJobs = new ItemList<HiveJob>();
     
    135130      : base(original, cloner) {
    136131      this.Job = cloner.Clone(original.job);
    137       this.OptimizerJob = cloner.Clone(original.OptimizerJob);
     132      this.JobItem = cloner.Clone(original.JobItem);
     133      this.childHiveJobs = cloner.Clone(original.childHiveJobs);
     134      this.syncJobsWithOptimizers = original.syncJobsWithOptimizers;
    138135    }
    139136    public override IDeepCloneable Clone(Cloner cloner) {
    140137      return new HiveJob(this, cloner);
    141138    }
    142 
    143     /// <summary>
    144     /// if this.Optimizer is an experiment
    145     ///   Uses the child-optimizers of this.HiveJob and creates HiveJob-childs
    146     /// if this.Optimizer is a batchrun
    147     ///   Creates a number of child-jobs according to repetitions
    148     /// </summary>
    149     private void UpdateChildHiveJobs() {
    150       if (Job != null && syncJobsWithOptimizers) {
    151         if (!OptimizerJob.ComputeInParallel) {
    152           this.childHiveJobs.Clear();
    153         } else {
    154           if (OptimizerJob.Optimizer is Optimization.Experiment) {
    155             Optimization.Experiment experiment = (Optimization.Experiment)OptimizerJob.Optimizer;
    156             foreach (IOptimizer childOpt in experiment.Optimizers) {
    157               this.childHiveJobs.Add(new HiveJob(childOpt));
    158             }
    159           } else if (OptimizerJob.Optimizer is Optimization.BatchRun) {
    160             Optimization.BatchRun batchRun = OptimizerJob.OptimizerAsBatchRun;
    161             if (batchRun.Optimizer != null) {
    162               while (this.childHiveJobs.Count < batchRun.Repetitions) {
    163                 this.childHiveJobs.Add(new HiveJob(batchRun.Optimizer));
    164               }
    165               while (this.childHiveJobs.Count > batchRun.Repetitions) {
    166                 this.childHiveJobs.Remove(this.childHiveJobs.Last());
    167               }
    168             }
    169           }
    170         }
    171       }
    172     }
    173 
    174     private void RegisterOptimizerEvents() {
    175       if (OptimizerJob != null) {
    176         if (OptimizerJob.Optimizer is Optimization.Experiment) {
    177           Optimization.Experiment experiment = OptimizerJob.OptimizerAsExperiment;
    178           experiment.Optimizers.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsAdded);
    179           experiment.Optimizers.ItemsReplaced += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsReplaced);
    180           experiment.Optimizers.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsRemoved);
    181           experiment.Optimizers.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_CollectionReset);
    182         } else if (OptimizerJob.Optimizer is Optimization.BatchRun) {
    183           Optimization.BatchRun batchRun = OptimizerJob.OptimizerAsBatchRun;
    184           batchRun.RepetitionsChanged += new EventHandler(batchRun_RepetitionsChanged);
    185           batchRun.OptimizerChanged += new EventHandler(batchRun_OptimizerChanged);
    186         }
    187         OptimizerJob.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged);
    188         OptimizerJob.ToStringChanged += new EventHandler(OptimizerJob_ToStringChanged);
    189       }
    190     }
    191     private void DergisterOptimizerEvents() {
    192       if (OptimizerJob != null) {
    193         if (OptimizerJob.Optimizer is Optimization.Experiment) {
    194           Optimization.Experiment experiment = OptimizerJob.OptimizerAsExperiment;
    195           experiment.Optimizers.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsAdded);
    196           experiment.Optimizers.ItemsReplaced -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsReplaced);
    197           experiment.Optimizers.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_ItemsRemoved);
    198           experiment.Optimizers.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<IOptimizer>>(Optimizers_CollectionReset);
    199         } else if (OptimizerJob.Optimizer is Optimization.BatchRun) {
    200           Optimization.BatchRun batchRun = OptimizerJob.OptimizerAsBatchRun;
    201           batchRun.RepetitionsChanged -= new EventHandler(batchRun_RepetitionsChanged);
    202           batchRun.OptimizerChanged -= new EventHandler(batchRun_OptimizerChanged);
    203         }
    204         OptimizerJob.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged);
    205         OptimizerJob.ToStringChanged -= new EventHandler(OptimizerJob_ToStringChanged);
    206       }
    207     }
    208 
    209     private void RegisterChildHiveJobEvents() {
     139    #endregion
     140
     141    protected virtual void UpdateChildHiveJobs() { }
     142
     143    protected virtual void RegisterJobItemEvents() {
     144      if (JobItem != null) {
     145        JobItem.ComputeInParallelChanged += new EventHandler(JobItem_ComputeInParallelChanged);
     146        JobItem.ToStringChanged += new EventHandler(JobItem_ToStringChanged);
     147      }
     148    }
     149    protected virtual void DergisterJobItemsEvents() {
     150      if (JobItem != null) {
     151        JobItem.ComputeInParallelChanged -= new EventHandler(JobItem_ComputeInParallelChanged);
     152        JobItem.ToStringChanged -= new EventHandler(JobItem_ToStringChanged);
     153      }
     154    }
     155
     156    protected virtual void RegisterChildHiveJobEvents() {
    210157      this.childHiveJobs.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsAdded);
    211158      this.childHiveJobs.ItemsRemoved += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsRemoved);
    212159      this.childHiveJobs.CollectionReset += new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnCollectionReset);
    213160    }
    214     private void DeregisterChildHiveJobEvents() {
     161    protected virtual void DeregisterChildHiveJobEvents() {
    215162      this.childHiveJobs.ItemsAdded -= new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsAdded);
    216163      this.childHiveJobs.ItemsRemoved -= new CollectionItemsChangedEventHandler<IndexedItem<HiveJob>>(OnItemsRemoved);
     
    218165    }
    219166
    220     private void batchRun_OptimizerChanged(object sender, EventArgs e) {
    221       if (syncJobsWithOptimizers) {
    222         UpdateChildHiveJobs();
    223       }
    224     }
    225 
    226     private void batchRun_RepetitionsChanged(object sender, EventArgs e) {
    227       if (syncJobsWithOptimizers) {
    228         UpdateChildHiveJobs();
    229       }
    230     }
    231 
    232     private void OptimizerJob_ToStringChanged(object sender, EventArgs e) {
     167    protected virtual void JobItem_ToStringChanged(object sender, EventArgs e) {
    233168      this.OnToStringChanged();
    234169    }
    235 
    236     private void Optimizers_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
    237       if (syncJobsWithOptimizers && this.OptimizerJob.ComputeInParallel) {
    238         foreach (var item in e.Items) {
    239           if (GetChildByOptimizer(item.Value) == null && item.Value.Name != "Placeholder") {
    240             this.childHiveJobs.Add(new HiveJob(item.Value));
    241           }
    242         }
    243       }
    244     }
    245     private void Optimizers_ItemsReplaced(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
    246       if (syncJobsWithOptimizers && this.OptimizerJob.ComputeInParallel) {
    247         foreach (var item in e.OldItems) {
    248           this.childHiveJobs.Remove(this.GetChildByOptimizer(item.Value));
    249         }
    250         foreach (var item in e.Items) {
    251           if (GetChildByOptimizer(item.Value) == null && item.Value.Name != "Placeholder") {
    252             this.childHiveJobs.Add(new HiveJob(item.Value));
    253           }
    254         }
    255       }
    256     }
    257     private void Optimizers_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
    258       if (syncJobsWithOptimizers && this.OptimizerJob.ComputeInParallel) {
    259         foreach (var item in e.Items) {
    260           this.childHiveJobs.Remove(this.GetChildByOptimizer(item.Value));
    261         }
    262       }
    263     }
    264     private void Optimizers_CollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<IOptimizer>> e) {
    265       if (syncJobsWithOptimizers && this.OptimizerJob.ComputeInParallel) {
    266         foreach (var item in e.Items) {
    267           this.childHiveJobs.Remove(this.GetChildByOptimizer(item.Value));
    268         }
    269       }
    270     }
    271 
    272     private void OptimizerJob_ComputeInParallelChanged(object sender, EventArgs e) {
    273       if (OptimizerJob != null && syncJobsWithOptimizers) {
     170   
     171    protected virtual void JobItem_ComputeInParallelChanged(object sender, EventArgs e) {
     172      if (JobItem != null && syncJobsWithOptimizers) {
    274173        this.UpdateChildHiveJobs();
    275174      }
    276175    }
    277176
    278     public void AddChildHiveJob(HiveJob hiveJob) {
     177    public virtual void AddChildHiveJob(HiveJob hiveJob) {
    279178      this.childHiveJobs.Add(hiveJob);
    280       syncJobsWithOptimizers = false;
    281       if (this.OptimizerJob != null && hiveJob.OptimizerJob != null) {
    282         // if job is in state Paused, it has to preserve its ResultCollection, which is cleared when a optimizer is added to an experiment
    283         OptimizerJob optimizerJobClone = null;
    284         if (hiveJob.Job.State == JobState.Paused) {
    285           optimizerJobClone = (OptimizerJob)hiveJob.OptimizerJob.Clone();
    286         }
    287 
    288         if (this.OptimizerJob.Optimizer is Optimization.Experiment) {
    289           if (!this.OptimizerJob.OptimizerAsExperiment.Optimizers.Contains(hiveJob.OptimizerJob.Optimizer)) {
    290             UpdateOptimizerInExperiment(this.OptimizerJob.OptimizerAsExperiment, hiveJob.OptimizerJob);
    291           }
    292         } else if (this.OptimizerJob.Optimizer is Optimization.BatchRun) {
    293           UpdateOptimizerInBatchRun(this.OptimizerJob.OptimizerAsBatchRun, hiveJob.OptimizerJob);
    294         }
    295 
    296         if (hiveJob.Job.State == JobState.Paused) {
    297           hiveJob.OptimizerJob = optimizerJobClone;
    298         }
    299       }
    300       syncJobsWithOptimizers = true;
    301     }
    302 
    303     /// <summary>
    304     /// if this.Optimizer is Experiment
    305     ///   replace the child-optimizer in the experiment
    306     /// if this.Optimizer is BatchRun
    307     ///   add the runs from the optimizerJob to the batchrun and replace the Optimizer
    308     /// </summary>
    309     public void UpdateChildOptimizer(OptimizerJob optimizerJob, Guid childJobId) {
    310       syncJobsWithOptimizers = false; // don't sync with optimizers during this method
    311       bool childIsFinishedOptimizerDownloaded = false;
    312 
    313       if (this.OptimizerJob != null && this.OptimizerJob.Optimizer != null) {
    314         if (this.OptimizerJob.Optimizer is Optimization.Experiment) {
    315           UpdateOptimizerInExperiment(this.OptimizerJob.OptimizerAsExperiment, optimizerJob);
    316           childIsFinishedOptimizerDownloaded = true;
    317         } else if (this.OptimizerJob.Optimizer is Optimization.BatchRun) {
    318           UpdateOptimizerInBatchRun(this.OptimizerJob.OptimizerAsBatchRun, optimizerJob);
    319           if (this.OptimizerJob.OptimizerAsBatchRun.Repetitions == this.OptimizerJob.Optimizer.Runs.Count) {
    320             childIsFinishedOptimizerDownloaded = true;
    321           }
    322         } else {
    323           childIsFinishedOptimizerDownloaded = optimizerJob.Optimizer.ExecutionState == ExecutionState.Stopped;
    324         }
    325       }
    326 
    327       HiveJob child = this.ChildHiveJobs.Single(j => j.Job.Id == childJobId);
    328       if (!optimizerJob.ComputeInParallel) {
    329         child.syncJobsWithOptimizers = false;
    330         child.OptimizerJob = optimizerJob;
    331         child.syncJobsWithOptimizers = true;
    332       }
    333       if (childIsFinishedOptimizerDownloaded) {
    334         //child.IsFinishedOptimizerDownloaded = true; // todo: clean up with childIsFinishedOptimizerDownloaded
    335       }
    336       syncJobsWithOptimizers = true;
    337     }
    338 
    339     /// <summary>
    340     /// Adds the runs from the optimizerJob to the batchrun and replaces the Optimizer
    341     /// Sideeffect: the optimizerJob.Optimizer will be prepared (scopes are deleted and executionstate will be reset)
    342     /// </summary>
    343     private void UpdateOptimizerInBatchRun(BatchRun batchRun, OptimizerJob optimizerJob) {
    344       if (batchRun.Optimizer == null) {
    345         batchRun.Optimizer = (IOptimizer)optimizerJob.Optimizer; // only set the first optimizer as Optimizer. if every time the Optimizer would be set, the runs would be cleared each time
    346       }
    347       foreach (IRun run in optimizerJob.Optimizer.Runs) {
    348         if (!batchRun.Runs.Contains(run)) {
    349           run.Name = GetNewRunName(run, batchRun.Runs);
    350           batchRun.Runs.Add(run);
    351         }
    352       }
    353     }
    354 
    355     /// <summary>
    356     /// Parses the run numbers out of runs and renames the run to the next number
    357     /// </summary>
    358     private static string GetNewRunName(IRun run, RunCollection runs) {
    359       int idx = run.Name.IndexOf("Run ") + 4;
    360 
    361       if (idx == -1 || runs.Count == 0)
    362         return run.Name;
    363 
    364       int maxRunNumber = int.MinValue;
    365       foreach (IRun r in runs) {
    366         int number = GetRunNumber(r.Name);
    367         maxRunNumber = Math.Max(maxRunNumber, number);
    368       }
    369 
    370       return run.Name.Substring(0, idx) + (maxRunNumber + 1).ToString();
    371     }
    372 
    373     /// <summary>
    374     /// Parses the number of a Run out of its name. Example "Genetic Algorithm Run 3" -> 3
    375     /// </summary>
    376     private static int GetRunNumber(string runName) {
    377       int idx = runName.IndexOf("Run ") + 4;
    378       if (idx == -1) {
    379         return 0;
    380       } else {
    381         return int.Parse(runName.Substring(idx, runName.Length - idx));
    382       }
    383     }
    384 
    385     /// <summary>
    386     /// replace the child-optimizer in the experiment
    387     /// Sideeffect: the optimizerJob.Optimizer will be prepared (scopes are deleted and executionstate will be reset)
    388     /// </summary>
    389     private void UpdateOptimizerInExperiment(Optimization.Experiment experiment, OptimizerJob optimizerJob) {
    390       if (optimizerJob.IndexInParentOptimizerList < 0)
    391         throw new IndexOutOfRangeException("IndexInParentOptimizerList must be equal or greater than zero! The Job is invalid and the optimizer-tree cannot be reassembled.");
    392 
    393       while (experiment.Optimizers.Count < optimizerJob.IndexInParentOptimizerList) {
    394         experiment.Optimizers.Add(new UserDefinedAlgorithm("Placeholder")); // add dummy-entries to Optimizers so that its possible to insert the optimizerJob at the correct position
    395       }
    396       if (experiment.Optimizers.Count < optimizerJob.IndexInParentOptimizerList + 1) {
    397         experiment.Optimizers.Add(optimizerJob.Optimizer);
    398       } else {
    399         // if ComputeInParallel==true, don't replace the optimizer (except it is still a Placeholder)
    400         // this is because Jobs with ComputeInParallel get submitted to hive with their child-optimizers deleted
    401         if (!optimizerJob.ComputeInParallel || experiment.Optimizers[optimizerJob.IndexInParentOptimizerList].Name == "Placeholder") {
    402           experiment.Optimizers[optimizerJob.IndexInParentOptimizerList] = optimizerJob.Optimizer;
    403         }
    404       }
    405     }
    406 
    407     /// <summary>
    408     /// Sets the IndexInParentOptimizerList property of the OptimizerJob
    409     /// according to the position in the OptimizerList of the parentHiveJob.Job
    410     /// Recursively updates all the child-jobs as well
    411     /// </summary>
    412     internal void SetIndexInParentOptimizerList(HiveJob parentHiveJob) {
    413       if (parentHiveJob != null) {
    414         if (parentHiveJob.OptimizerJob.Optimizer is Optimization.Experiment) {
    415           this.OptimizerJob.IndexInParentOptimizerList = parentHiveJob.OptimizerJob.OptimizerAsExperiment.Optimizers.IndexOf(this.OptimizerJob.Optimizer);
    416         } else if (parentHiveJob.OptimizerJob.Optimizer is Optimization.BatchRun) {
    417           this.OptimizerJob.IndexInParentOptimizerList = 0;
    418         } else {
    419           throw new NotSupportedException("Only Experiment and BatchRuns are supported");
    420         }
    421       }
    422       foreach (HiveJob child in childHiveJobs) {
    423         child.SetIndexInParentOptimizerList(this);
    424       }
    425179    }
    426180
    427181    public override string ToString() {
    428       if (optimizerJob != null) {
    429         return optimizerJob.ToString();
     182      if (jobItem != null) {
     183        return jobItem.ToString();
    430184      } else {
    431185        return base.ToString();
     
    433187    }
    434188
    435     public void UpdateFromLightweightJob(LightweightJob lightweightJob) {
     189    public virtual void UpdateFromLightweightJob(LightweightJob lightweightJob) {
    436190      if (lightweightJob != null) {
    437191        job.Id = lightweightJob.Id;
     
    455209    ///   if true the Child-Optimizers will not be serialized (if the job contains an Experiment)
    456210    /// </param>
    457     public JobData GetAsJobData(bool withoutChildOptimizers, out List<IPluginDescription> plugins) {
    458       plugins = new List<IPluginDescription>();
    459       if (this.optimizerJob == null || this.optimizerJob.Optimizer == null)
    460         return null;
    461 
    462       IEnumerable<Type> usedTypes;
    463       byte[] jobByteArray;
    464       if (withoutChildOptimizers && this.OptimizerJob.Optimizer is Optimization.Experiment) {
    465         OptimizerJob clonedJob = (OptimizerJob)this.OptimizerJob.Clone(); // use a cloned job, so that the childHiveJob don't get confused
    466         clonedJob.OptimizerAsExperiment.Optimizers.Clear();
    467         jobByteArray = PersistenceUtil.Serialize(clonedJob, out usedTypes);
    468       } else if (withoutChildOptimizers && this.OptimizerJob.Optimizer is Optimization.BatchRun) {
    469         OptimizerJob clonedJob = (OptimizerJob)this.OptimizerJob.Clone();
    470         clonedJob.OptimizerAsBatchRun.Optimizer = null;
    471         jobByteArray = PersistenceUtil.Serialize(clonedJob, out usedTypes);
    472       } else if (this.OptimizerJob.Optimizer is IAlgorithm) {
    473         ((IAlgorithm)this.OptimizerJob.Optimizer).StoreAlgorithmInEachRun = false; // avoid storing the algorithm in runs to reduce size
    474         jobByteArray = PersistenceUtil.Serialize(this.OptimizerJob, out usedTypes);
    475       } else {
    476         jobByteArray = PersistenceUtil.Serialize(this.OptimizerJob, out usedTypes);
    477       }
    478 
    479       JobData jobData = new JobData() {
    480         JobId = job.Id,
    481         Data = jobByteArray
    482       };
    483 
    484       PluginUtil.CollectDeclaringPlugins(plugins, usedTypes);
    485 
    486       return jobData;
    487     }
    488 
     211    public virtual JobData GetAsJobData(bool withoutChildOptimizers, out List<IPluginDescription> plugins) {
     212      plugins = null;
     213      return null;
     214    }
    489215
    490216    #region Events
    491217    public event EventHandler JobChanged;
    492218    private void OnJobChanged() {
    493       LogMessage("JobChanged");
    494219      EventHandler handler = JobChanged;
    495220      if (handler != null) handler(this, EventArgs.Empty);
     
    498223    public event EventHandler JobStateChanged;
    499224    private void OnJobStateChanged() {
    500       LogMessage("JobStateChanged (State: " + this.Job.State + ", ExecutionTime: " + this.Job.ExecutionTime.ToString() + ")");
    501225      EventHandler handler = JobStateChanged;
    502226      if (handler != null) handler(this, EventArgs.Empty);
    503227    }
    504228
    505     public event EventHandler OptimizerJobChanged;
    506     private void OnOptimizerJobChanged() {
    507       OptimizerJob_ComputeInParallelChanged(this, EventArgs.Empty);
    508       var handler = OptimizerJobChanged;
     229    public event EventHandler JobItemChanged;
     230    private void OnJobItemChanged() {
     231      JobItem_ComputeInParallelChanged(this, EventArgs.Empty);
     232      var handler = JobItemChanged;
    509233      if (handler != null) handler(this, EventArgs.Empty);
    510234    }
     
    516240    }
    517241    #endregion
    518 
    519     public void LogMessage(string message) {
    520       lock (locker) {
    521         if (optimizerJob != null) {
    522           optimizerJob.Log.LogMessage(message);
    523         }
    524       }
    525     }
    526 
     242   
    527243    /// <summary>
    528244    /// Returns a list of HiveJobs including this and all its child-jobs recursively
    529245    /// </summary>
    530246    public IEnumerable<HiveJob> GetAllHiveJobs() {
    531       List<HiveJob> jobs = new List<HiveJob>();
     247      var jobs = new List<HiveJob>();
    532248      jobs.Add(this);
    533249      foreach (HiveJob child in this.ChildHiveJobs) {
     
    544260        if (result != null)
    545261          return result;
    546       }
    547       return null;
    548     }
    549 
    550 
    551     public HiveJob GetChildByOptimizerJob(OptimizerJob optimizerJob) {
    552       foreach (var child in ChildHiveJobs) {
    553         if (child.OptimizerJob == optimizerJob)
    554           return child;
    555       }
    556       return null;
    557     }
    558 
    559 
    560     public HiveJob GetChildByOptimizer(IOptimizer optimizer) {
    561       foreach (var child in ChildHiveJobs) {
    562         if (child.OptimizerJob.Optimizer == optimizer)
    563           return child;
    564262      }
    565263      return null;
     
    582280    }
    583281
    584 
    585282    public void RemoveByJobId(Guid jobId) {
    586283      IEnumerable<HiveJob> jobs = ChildHiveJobs.Where(j => j.Job.Id == jobId).ToList(); // if Guid.Empty needs to be removed, there could be more than one with this jobId
     
    593290    }
    594291
    595     public IEnumerable<IItemTree> GetChildItems() {
     292    public IEnumerable<IItemTree<HiveJob>> GetChildItems() {
    596293      return this.childHiveJobs;
    597294    }
     
    599296    #region INotifyObservableCollectionItemsChanged<IItemTree> Members
    600297
    601     public event CollectionItemsChangedEventHandler<IItemTree> CollectionReset;
     298    public event CollectionItemsChangedEventHandler<IItemTree<HiveJob>> CollectionReset;
    602299    private void OnCollectionReset(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
    603300      var handler = CollectionReset;
     
    605302    }
    606303
    607     public event CollectionItemsChangedEventHandler<IItemTree> ItemsAdded;
     304    public event CollectionItemsChangedEventHandler<IItemTree<HiveJob>> ItemsAdded;
    608305    private void OnItemsAdded(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
    609306      var handler = ItemsAdded;
     
    611308    }
    612309
    613     public event CollectionItemsChangedEventHandler<IItemTree> ItemsRemoved;
     310    public event CollectionItemsChangedEventHandler<IItemTree<HiveJob>> ItemsRemoved;
    614311    private void OnItemsRemoved(object sender, CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
    615312      var handler = ItemsRemoved;
     
    617314    }
    618315
    619     private static CollectionItemsChangedEventArgs<IItemTree> ToCollectionItemsChangedEventArgs(CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
    620       return new CollectionItemsChangedEventArgs<IItemTree>(e.Items.Select(x => x.Value), e.OldItems == null ? null : e.OldItems.Select(x => x.Value));
     316    private static CollectionItemsChangedEventArgs<IItemTree<HiveJob>> ToCollectionItemsChangedEventArgs(CollectionItemsChangedEventArgs<IndexedItem<HiveJob>> e) {
     317      return new CollectionItemsChangedEventArgs<IItemTree<HiveJob>>(e.Items.Select(x => x.Value), e.OldItems == null ? null : e.OldItems.Select(x => x.Value));
    621318    }
    622319    #endregion
     
    634331        JobData jobData = new JobData();
    635332        jobData.JobId = this.job.Id;
    636         jobData.Data = PersistenceUtil.Serialize(this.optimizerJob);
     333        jobData.Data = PersistenceUtil.Serialize(this.jobItem);
    637334        service.UpdateJobData(this.Job, jobData);
    638335        service.RestartJob(this.job.Id);
     
    641338      });
    642339    }
     340   
     341    public ICollection<IItemTreeNodeAction<HiveJob>> Actions {
     342      get {
     343        return new List<IItemTreeNodeAction<HiveJob>>();
     344      }
     345    }
     346  }
     347
     348  [Item("Hive Job", "Represents a hive job.")]
     349  [StorableClass]
     350  public class HiveJob<T> : HiveJob where T : ItemJob {
     351
     352    public new T JobItem {
     353      get { return (T)base.JobItem; }
     354      internal set { base.JobItem = value; }
     355    }
     356
     357    #region Constructors and Cloning
     358    public HiveJob() : base() { }
     359    protected HiveJob(HiveJob original, Cloner cloner)
     360      : base(original, cloner) {
     361    }
     362    public override IDeepCloneable Clone(Cloner cloner) {
     363      return new HiveJob<T>(this, cloner);
     364    }
     365    #endregion
    643366  }
    644367}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJobDownloader.cs

    r5793 r6033  
    44using System.Threading;
    55using System.Threading.Tasks;
     6using HeuristicLab.Clients.Hive.ExperimentManager;
     7using HeuristicLab.Clients.Hive.Jobs;
     8using HeuristicLab.Hive;
    69
    710namespace HeuristicLab.Clients.Hive {
     
    8689        Job job = ServiceLocator.Instance.CallHiveService(s => s.GetJob(jobData.JobId));
    8790        if (abort || job == null || jobData == null) return null;
    88         HiveJob hiveJob = new HiveJob(job, jobData, false);
     91
     92        HiveJob hiveJob;
     93        var itemJob = PersistenceUtil.Deserialize<ItemJob>(jobData.Data);
     94        if (itemJob is OptimizerJob) {
     95          hiveJob = new OptimizerHiveJob((OptimizerJob)itemJob);
     96        } else {
     97          hiveJob = new HiveJob(itemJob, true);
     98        }
    8999        jobData.Data = null; // reduce memory consumption.
    90100        hiveJob.Job = job;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj

    r6006 r6033  
    122122    <Compile Include="ExperimentManager\ExperimentManagerClient.cs" />
    123123    <Compile Include="ExperimentManager\HiveJobDownloader.cs" />
    124     <Compile Include="ExperimentManager\IItemTree.cs" />
     124    <Compile Include="ExperimentManager\TreeView\IItemTree.cs" />
     125    <Compile Include="ExperimentManager\TreeView\IItemTreeAction.cs" />
     126    <Compile Include="ExperimentManager\OptimizerHiveJob.cs">
     127      <SubType>Code</SubType>
     128    </Compile>
    125129    <Compile Include="ExperimentManager\PluginClient.cs" />
    126130    <Compile Include="Exceptions\ResourceNotFoundException.cs" />
     
    146150    <Compile Include="ServiceClients\HiveItem.cs" />
    147151    <Compile Include="ServiceClients\JobData.cs" />
     152    <Compile Include="ServiceClients\OperationJob.cs" />
     153    <Compile Include="ExperimentManager\RefreshableHiveExperiment.cs" />
    148154    <Compile Include="ServiceClients\Plugin.cs" />
    149155    <Compile Include="ServiceClients\PluginData.cs" />
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLabClientsHivePlugin.cs.frame

    r5043 r6033  
    88  [Plugin("HeuristicLab.Clients.Hive", "3.4.0.$WCREV$")]
    99  [PluginFile("HeuristicLab.Clients.Hive-3.4.dll", PluginFileType.Assembly)]
     10  [PluginDependency("HeuristicLab.Clients.Common", "3.3")]
     11  [PluginDependency("HeuristicLab.Collections", "3.3")]
    1012  [PluginDependency("HeuristicLab.Common", "3.3")]
     13  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    1114  [PluginDependency("HeuristicLab.Core", "3.3")]
     15  [PluginDependency("HeuristicLab.Data", "3.3")]
     16  [PluginDependency("HeuristicLab.Hive", "3.4")]
     17  [PluginDependency("HeuristicLab.Optimization", "3.3")]
    1218  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    1319  public class HeuristicLabClientsHivePlugin : PluginBase {
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Jobs/OptimizerJob.cs

    r5958 r6033  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Drawing;
    2524using HeuristicLab.Common;
    2625using HeuristicLab.Core;
     
    3231  [Item("Optimizer Job", "Represents Job which executes a IOptimizer object.")]
    3332  [StorableClass]
    34   public class OptimizerJob : AbstractJob {
     33  public class OptimizerJob : ItemJob {
    3534    public override bool IsParallelizable {
    36       get { return this.Optimizer is Optimization.Experiment || this.Optimizer is BatchRun; }
     35      get { return this.Item is Experiment || this.Item is BatchRun; }
    3736    }
    3837
    39     [Storable]
    40     protected IOptimizer optimizer;
    41     public IOptimizer Optimizer {
    42       get { return optimizer; }
    43       set {
    44         if (value != optimizer) {
    45           if (optimizer != null) DeregisterOptimizerEvents();
    46           optimizer = value;
    47           if (optimizer != null) RegisterOptimizerEvents();
    48           OnOptimizerChanged();
    49         }
    50       }
     38    public new IOptimizer Item {
     39      get { return (IOptimizer)base.Item; }
     40      set { base.Item = value; }
    5141    }
    5242
     
    5848    }
    5949
    60     public OptimizerJob() : base() {
    61      
    62     }
     50    public OptimizerJob() : base() { }
    6351    public OptimizerJob(IOptimizer optimizer)
    6452      : this() {
    65       this.Optimizer = optimizer;
     53        this.Item = optimizer;
    6654
    67       if (optimizer is Optimization.Experiment) {
     55      if (optimizer is Experiment) {
    6856        this.ComputeInParallel = true;
    69       } else if (optimizer is Optimization.BatchRun) {
     57      } else if (optimizer is BatchRun) {
    7058        this.ComputeInParallel = false;
    7159      } else {
     
    7765    protected OptimizerJob(OptimizerJob original, Cloner cloner)
    7866      : base(original, cloner) {
    79       this.Optimizer = cloner.Clone(original.Optimizer);
    8067      this.IndexInParentOptimizerList = original.IndexInParentOptimizerList;
    8168      this.CollectChildJobs = original.CollectChildJobs;
    82       this.RegisterOptimizerEvents();
    8369    }
    8470    public override IDeepCloneable Clone(Cloner cloner) {
     
    8672    }
    8773
    88     [StorableHook(HookType.AfterDeserialization)]
    89     protected virtual void AfterDeserialization() {
    90       RegisterOptimizerEvents();
    91     }
    92 
    9374    /// <summary>
    9475    /// Casts the Optimizer to an Experiment. Returns null if cast was not successfull.
    9576    /// </summary>
    96     public Optimization.Experiment OptimizerAsExperiment {
    97       get { return Optimizer as Optimization.Experiment; }
     77    public Experiment OptimizerAsExperiment {
     78      get { return Item as Experiment; }
    9879    }
    9980
     
    10182    /// Casts the Optimizer to an BatchRun. Returns null if cast was not successfull.
    10283    /// </summary>
    103     public Optimization.BatchRun OptimizerAsBatchRun {
    104       get { return Optimizer as Optimization.BatchRun; }
     84    public BatchRun OptimizerAsBatchRun {
     85      get { return Item as BatchRun; }
    10586    }
    10687
     
    10889
    10990    public override ExecutionState ExecutionState {
    110       get { return optimizer.ExecutionState; }
     91      get { return Item.ExecutionState; }
    11192    }
    11293
    11394    public override TimeSpan ExecutionTime {
    114       get { return optimizer.ExecutionTime; }
     95      get { return Item.ExecutionTime; }
    11596    }
    11697
    11798    public override void Prepare() {
    118       optimizer.Prepare();
     99      Item.Prepare();
    119100    }
    120101
    121102    public override void Start() {
    122       if ((optimizer is Optimization.Experiment && OptimizerAsExperiment.Optimizers.Count == 0) || // experiment would not fire OnStopped if it has 0 optimizers
    123           (optimizer is Optimization.BatchRun && OptimizerAsBatchRun.Optimizer == null)) { // batchrun would not fire OnStopped if algorithm == null
     103      if ((Item is Experiment && OptimizerAsExperiment.Optimizers.Count == 0) || // experiment would not fire OnStopped if it has 0 optimizers
     104          (Item is BatchRun && OptimizerAsBatchRun.Optimizer == null)) { // batchrun would not fire OnStopped if algorithm == null
    124105        OnJobStopped();
    125106      } else {
    126         optimizer.Start();
     107        Item.Start();
    127108      }
    128109    }
    129110
    130111    public override void Pause() {
    131       optimizer.Pause();
     112      Item.Pause();
    132113    }
    133114
    134115    public override void Stop() {
    135       optimizer.Stop();
     116      Item.Stop();
    136117    }
    137118
     
    142123
    143124    #region Optimizer Events
    144     protected virtual void RegisterOptimizerEvents() {
    145       optimizer.Stopped += new EventHandler(optimizer_Stopped);
    146       optimizer.Paused += new EventHandler(optimizer_Paused);
    147       optimizer.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred);
    148       optimizer.DescriptionChanged += new EventHandler(optimizer_DescriptionChanged);
    149       optimizer.ItemImageChanged += new EventHandler(optimizer_ItemImageChanged);
    150       optimizer.NameChanged += new EventHandler(optimizer_NameChanged);
    151       optimizer.NameChanging += new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging);
    152       optimizer.ToStringChanged += new EventHandler(optimizer_ToStringChanged);
     125    protected override void RegisterItemEvents() {
     126      base.RegisterItemEvents();
     127      Item.Stopped += new EventHandler(optimizer_Stopped);
     128      Item.Paused += new EventHandler(optimizer_Paused);
     129      Item.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred);
     130      Item.DescriptionChanged += new EventHandler(optimizer_DescriptionChanged);
     131      Item.NameChanged += new EventHandler(optimizer_NameChanged);
     132      Item.NameChanging += new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging);
    153133    }
    154134
    155135    protected virtual void DeregisterOptimizerEvents() {
    156       optimizer.Stopped -= new EventHandler(optimizer_Stopped);
    157       optimizer.Paused -= new EventHandler(optimizer_Paused);
    158       optimizer.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred);
    159       optimizer.DescriptionChanged -= new EventHandler(optimizer_DescriptionChanged);
    160       optimizer.ItemImageChanged -= new EventHandler(optimizer_ItemImageChanged);
    161       optimizer.NameChanged -= new EventHandler(optimizer_NameChanged);
    162       optimizer.NameChanging -= new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging);
    163       optimizer.ToStringChanged -= new EventHandler(optimizer_ToStringChanged);
    164     }
    165 
    166     protected void optimizer_ToStringChanged(object sender, EventArgs e) {
    167       this.OnToStringChanged();
     136      Item.Stopped -= new EventHandler(optimizer_Stopped);
     137      Item.Paused -= new EventHandler(optimizer_Paused);
     138      Item.ExceptionOccurred -= new EventHandler<EventArgs<Exception>>(optimizer_ExceptionOccurred);
     139      Item.DescriptionChanged -= new EventHandler(optimizer_DescriptionChanged);
     140      Item.NameChanged -= new EventHandler(optimizer_NameChanged);
     141      Item.NameChanging -= new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging);
     142      base.DeregisterItemEvents();
    168143    }
    169144
     
    174149    protected void optimizer_NameChanged(object sender, EventArgs e) {
    175150      this.OnNameChanged();
    176     }
    177 
    178     protected void optimizer_ItemImageChanged(object sender, EventArgs e) {
    179       this.OnItemImageChanged();
    180151    }
    181152
     
    198169
    199170    #region INamedItem Members
    200 
    201171    public override bool CanChangeDescription {
    202       get { return optimizer.CanChangeDescription; }
     172      get { return Item.CanChangeDescription; }
    203173    }
    204174
    205175    public override bool CanChangeName {
    206       get { return optimizer.CanChangeName; }
     176      get { return Item.CanChangeName; }
    207177    }
    208178
    209179    public override string Description {
    210       get { return optimizer.Description; }
    211       set { optimizer.Description = value; }
     180      get { return Item.Description; }
     181      set { Item.Description = value; }
    212182    }
    213183
    214184    public override string Name {
    215       get { return optimizer.Name; }
    216       set { optimizer.Name = value; }
    217     }
    218     #endregion
    219    
    220     #region IItem Members
    221 
    222     public override string ItemDescription {
    223       get { return optimizer.ItemDescription; }
    224     }
    225 
    226     public override Image ItemImage {
    227       get { return optimizer.ItemImage; }
    228     }
    229 
    230     public override string ItemName {
    231       get { return optimizer.ItemName; }
    232     }
    233 
    234     public override Version ItemVersion {
    235       get { return optimizer.ItemVersion; }
     185      get { return Item.Name; }
     186      set { Item.Name = value; }
    236187    }
    237188    #endregion
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs

    r6006 r6033  
    2424using System.ComponentModel;
    2525using System.Linq;
    26 using HeuristicLab.Clients.Hive.Jobs;
    2726using HeuristicLab.Common;
    2827using HeuristicLab.Core;
    29 using HeuristicLab.Optimization;
    3028using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3129
     
    3331  [StorableClass]
    3432  public partial class HiveExperiment : IDeepCloneable, IContent, IProgressReporter {
    35     private JobResultPoller jobResultPoller;
    36 
    3733    [Storable]
    3834    private bool useLocalPlugins;
     
    7167      get { return hiveJobs; }
    7268      set {
    73         DeregisterHiveJobsEvents();
    7469        if (hiveJobs != value) {
    7570          hiveJobs = value;
    76           RegisterHiveJobsEvents();
    7771          OnHiveJobsChanged();
    7872        }
     
    9286    }
    9387
    94     /** include jobs when refreshing **/
    95     [Storable]
    96     private bool includeJobs;
    97     public bool IncludeJobs {
    98       get { return includeJobs; }
    99       set { includeJobs = value; }
    100     }
    101 
    102     [Storable]
    103     private bool refreshAutomatically;
    104     public bool RefreshAutomatically {
    105       get { return refreshAutomatically; }
    106       set {
    107         if (refreshAutomatically != value) {
    108           refreshAutomatically = value;
    109           OnRefreshAutomaticallyChanged();
    110           if (RefreshAutomatically) {
    111             StartResultPolling();
    112           } else {
    113             StopResultPolling();
    114           }
    115         }
    116       }
    117     }
    118 
    11988    [Storable]
    12089    private IProgress progress;
     
    12796    public HiveExperiment() {
    12897      this.ResourceNames = "HEAL";
    129       this.includeJobs = true;
    130       this.refreshAutomatically = true;
     98      this.HiveJobs = new ItemCollection<HiveJob>();
    13199    }
    132100
     
    140108      this.Description = original.Description;
    141109      this.Id = original.Id;
    142 
     110      this.HiveJobs = cloner.Clone(original.HiveJobs);
    143111      this.UseLocalPlugins = original.UseLocalPlugins;
    144112      this.ExecutionTime = original.ExecutionTime;
     
    148116    }
    149117    #endregion
    150 
    151     public override string ToString() {
    152       return Name;
    153     }
    154118
    155119    #region Events
     
    167131
    168132    public event EventHandler HiveJobsChanged;
    169     private void OnHiveJobsChanged() {
    170       if (jobResultPoller != null && jobResultPoller.IsPolling) {
    171         jobResultPoller.Stop();
    172         DeregisterResultPollingEvents();
    173       }
    174       if (HiveJobs != null && HiveJobs.Count > 0 && GetAllHiveJobs().All(x => x.Job.Id != Guid.Empty)) {
    175         if (this.RefreshAutomatically)
    176           StartResultPolling();
    177       }
     133    protected virtual void OnHiveJobsChanged() {
    178134      EventHandler handler = HiveJobsChanged;
    179135      if (handler != null) handler(this, EventArgs.Empty);
     
    185141      if (handler != null) handler(this, EventArgs.Empty);
    186142    }
    187 
    188     public event EventHandler RefreshAutomaticallyChanged;
    189     private void OnRefreshAutomaticallyChanged() {
    190       EventHandler handler = RefreshAutomaticallyChanged;
    191       if (handler != null) handler(this, EventArgs.Empty);
    192     }
    193143    #endregion
    194 
    195     private void RegisterHiveJobsEvents() {
    196       //if (HiveJobs != null) {
    197       //  HiveJobs.JobStateChanged += new EventHandler(HiveJob_JobStateChanged);
    198       //}
    199     }
    200 
    201     private void DeregisterHiveJobsEvents() {
    202       //if (HiveJobs != null) {
    203       //  HiveJobs.JobStateChanged -= new EventHandler(HiveJob_JobStateChanged);
    204       //}
    205     }
    206 
    207     private void HiveJob_JobStateChanged(object sender, EventArgs e) {
    208       //if (this.HiveJobs != null) {
    209       //  this.RootJobId = HiveJobs.Job.Id;
    210       //}
    211     }
    212 
    213     public Experiment GetExperiment(int idx) {
    214       if (this.HiveJobs != null) {
    215         var hj = HiveJobs.ElementAtOrDefault(idx);
    216         if (hj != null)
    217           return hj.OptimizerJob.OptimizerAsExperiment;
    218       }
    219       return null;
    220     }
    221 
    222     public void AddExperiment(Experiment experiment) {
    223       if (this.HiveJobs == null)
    224         this.HiveJobs = new ItemCollection<HiveJob>();
    225       this.HiveJobs.Add(new HiveJob(experiment));
    226     }
    227 
    228     public void SetExperiment(Experiment experiment) {
    229       if (this.HiveJobs == null)
    230         this.HiveJobs = new ItemCollection<HiveJob>();
    231       else
    232         this.HiveJobs.Clear();
    233       this.HiveJobs.Add(new HiveJob(experiment));
    234     }
    235 
     144   
    236145    protected override void OnPropertyChanged(PropertyChangedEventArgs e) {
    237146      base.OnPropertyChanged(e);
     
    240149      }
    241150    }
    242 
    243     #region JobResultPoller Events
    244 
    245     public void StartResultPolling() {
    246       if (jobResultPoller == null) {
    247         jobResultPoller = new JobResultPoller(HiveJobs, /*ApplicationConstants.ResultPollingInterval*/new TimeSpan(0, 0, 5)); //TODO: find a better place for ApplicationConstants
    248         RegisterResultPollingEvents();
    249       }
    250 
    251       if (!jobResultPoller.IsPolling) {
    252         jobResultPoller.Start();
    253       }
    254     }
    255 
    256     public void StopResultPolling() {
    257       if (jobResultPoller != null && jobResultPoller.IsPolling) {
    258         jobResultPoller.Stop();
    259       }
    260     }
    261 
    262     private void RegisterResultPollingEvents() {
    263       jobResultPoller.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured);
    264       jobResultPoller.JobResultsReceived += new EventHandler<EventArgs<IEnumerable<LightweightJob>>>(jobResultPoller_JobResultReceived);
    265       jobResultPoller.IsPollingChanged += new EventHandler(jobResultPoller_IsPollingChanged);
    266     }
    267     private void DeregisterResultPollingEvents() {
    268       jobResultPoller.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(jobResultPoller_ExceptionOccured);
    269       jobResultPoller.JobResultsReceived -= new EventHandler<EventArgs<IEnumerable<LightweightJob>>>(jobResultPoller_JobResultReceived);
    270       jobResultPoller.IsPollingChanged -= new EventHandler(jobResultPoller_IsPollingChanged);
    271     }
    272     private void jobResultPoller_IsPollingChanged(object sender, EventArgs e) {
    273       this.refreshAutomatically = jobResultPoller.IsPolling;
    274       OnRefreshAutomaticallyChanged();
    275     }
    276     private void jobResultPoller_JobResultReceived(object sender, EventArgs<IEnumerable<LightweightJob>> e) {
    277       foreach (LightweightJob lightweightJob in e.Value) {
    278         HiveJob hj = GetHiveJobById(lightweightJob.Id);
    279         if (hj != null) {
    280           DateTime lastJobDataUpdate = hj.Job.LastJobDataUpdate;
    281           hj.UpdateFromLightweightJob(lightweightJob);
    282 
    283           // lastJobDataUpdate equals DateTime.MinValue right after it was uploaded. When the first results are polled, this value is updated
    284           if (lastJobDataUpdate != DateTime.MinValue && lastJobDataUpdate < hj.Job.LastJobDataUpdate) {
    285             OptimizerJob optimizerJob = ExperimentManagerClient.LoadOptimizerJob(hj.Job.Id);
    286             if (optimizerJob == null) {
    287               // something bad happened to this job. bad job, BAAAD job!
    288             } else {
    289               // if the job is paused, download but don't integrate into parent optimizer (to avoid Prepare)
    290               if (hj.Job.State == JobState.Paused) {
    291                 hj.OptimizerJob = optimizerJob;
    292               } else {
    293                 if (lightweightJob.ParentJobId.HasValue) {
    294                   HiveJob parentHiveJob = GetHiveJobById(lightweightJob.ParentJobId.Value);
    295                   parentHiveJob.UpdateChildOptimizer(optimizerJob, hj.Job.Id);
    296                 }
    297               }
    298             }
    299           }
    300         }
    301       }
    302       GC.Collect(); // force GC, because .NET is too lazy here (deserialization takes a lot of memory)
    303       if (AllJobsFinished()) {
    304         this.ExecutionState = Core.ExecutionState.Stopped;
    305         StopResultPolling();
    306         //OnStopped();
    307       }
    308       UpdateTotalExecutionTime();
    309       UpdateStats();
    310     }
    311 
    312     public HiveJob GetHiveJobById(Guid jobId) {
    313       foreach (HiveJob job in HiveJobs) {
    314         HiveJob hj = job.GetHiveJobByJobId(jobId);
    315         if (hj != null)
    316           return hj;
    317       }
    318       return null;
    319     }
    320 
    321     private void UpdateStats() {
    322       var jobs = GetAllHiveJobs();
    323       this.JobCount = jobs.Count();
    324       this.CalculatingCount = jobs.Count(j => j.Job.State == JobState.Calculating);
    325       this.FinishedCount = jobs.Count(j => j.Job.State == JobState.Finished);
    326     }
    327 
    328     public IEnumerable<HiveJob> GetAllHiveJobs() {
    329       var jobs = new List<HiveJob>();
    330       foreach (HiveJob job in HiveJobs) {
    331         jobs.AddRange(job.GetAllHiveJobs());
    332       }
    333       return jobs;
    334     }
    335 
    336     public bool AllJobsFinished() {
    337       return GetAllHiveJobs().All(j => j.Job.State == JobState.Finished
    338                                             || j.Job.State == JobState.Aborted
    339                                             || j.Job.State == JobState.Failed);
    340     }
    341 
    342     private void jobResultPoller_ExceptionOccured(object sender, EventArgs<Exception> e) {
    343       //OnExceptionOccured(e.Value);
    344     }
    345 
    346     public void UpdateTotalExecutionTime() {
    347       this.ExecutionTime = TimeSpan.FromMilliseconds(GetAllHiveJobs().Sum(x => x.Job.ExecutionTime.HasValue ? x.Job.ExecutionTime.Value.TotalMilliseconds : 0));
    348     }
    349     #endregion
    350 
     151   
    351152    protected override void RaisePropertyChanged(string propertyName) {
    352153      if (!(propertyName == "ExecutionTime")
     
    362163        && HiveJobs.All(x => x.Job.DateFinished.HasValue && x.Job.DateCreated.HasValue);
    363164    }
     165
     166    public IEnumerable<HiveJob> GetAllHiveJobs() {
     167      var jobs = new List<HiveJob>();
     168      foreach (HiveJob job in HiveJobs) {
     169        jobs.AddRange(job.GetAllHiveJobs());
     170      }
     171      return jobs;
     172    }
     173
     174    public override string ToString() {
     175      return Name;
     176    }
     177
     178    public virtual void OnLoaded() { }
    364179  }
    365180}
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Hive/3.4/HeuristicLab.Hive-3.4.csproj

    r5958 r6033  
    9696    <Compile Include="HeuristicLabHivePlugin.cs" />
    9797    <Compile Include="IJob.cs" />
    98     <Compile Include="AbstractJob.cs" />
     98    <Compile Include="ItemJob.cs" />
    9999    <Compile Include="Properties\AssemblyInfo.cs" />
    100100  </ItemGroup>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Test/HeuristicLab.HiveEngine.Test.csproj

    r6006 r6033  
    124124      <Name>HeuristicLab.HiveEngine-3.4</Name>
    125125    </ProjectReference>
     126    <ProjectReference Include="..\HeuristicLab.Hive\3.4\HeuristicLab.Hive-3.4.csproj">
     127      <Project>{F98A1740-9AC9-4D36-A582-6A2D0D06978D}</Project>
     128      <Name>HeuristicLab.Hive-3.4</Name>
     129    </ProjectReference>
    126130  </ItemGroup>
    127131  <ItemGroup>
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Test/Program.cs

    r6006 r6033  
    1111using HeuristicLab.PluginInfrastructure.Manager;
    1212using HeuristicLab.Problems.TestFunctions;
     13using HeuristicLab.Clients.Hive.Jobs;
     14using HeuristicLab.Optimization;
    1315
    1416namespace HeuristicLab.HiveEngine.Test {
     
    3032    public override void Run() {
    3133      ContentManager.Initialize(new PersistenceContentManager());
     34
     35
     36      OptimizerJob job = new OptimizerJob(new Experiment());
     37      job.IndexInParentOptimizerList = 15;
     38
     39      byte[] data = PersistenceUtil.Serialize(job);
     40
     41      var job2 = PersistenceUtil.Deserialize<OptimizerJob>(data);
     42
     43
    3244
    3345      #region Credentials
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine.Test/app.config

    r6000 r6033  
    1 <?xml version="1.0" encoding="utf-8"?>
     1<?xml version="1.0" encoding="utf-8"?>
    22<configuration>
    33  <configSections>
     
    7373        </identity>
    7474      </endpoint>
    75       <endpoint address="http://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService">
     75      <endpoint address="http://localhost/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService">
    7676        <identity>
    77           <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ==" />
     77          <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac=" />
    7878        </identity>
    7979      </endpoint>
  • 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;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/HeuristicLabServicesHiveDataAccessPlugin.cs.frame

    r5043 r6033  
    88  [Plugin("HeuristicLab.Services.Hive.DataAccess", "3.4.0.$WCREV$")]
    99  [PluginFile("HeuristicLab.Services.Hive.DataAccess-3.4.dll", PluginFileType.Assembly)]
     10  [PluginDependency("HeuristicLab.Clients.Common", "3.3")]
    1011  [PluginDependency("HeuristicLab.Common", "3.3")]
    1112  [PluginDependency("HeuristicLab.Core", "3.3")]
    1213  [PluginDependency("HeuristicLab.Persistence", "3.3")]
     14  [PluginDependency("HeuristicLab.Services.Hive.Common", "3.4")]
    1315  public class HeuristicLabServicesHiveDataAccessPlugin : PluginBase {
    1416  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.DataAccess/3.4/Tools/prepareHiveDatabase.sql

    r6006 r6033  
    5555GO
    5656
    57 --ALTER TABLE [dbo].[Job]  DROP  CONSTRAINT [HiveExperiment_Job]
    58 --ALTER TABLE [dbo].[Job]  WITH CHECK ADD CONSTRAINT [HiveExperiment_Job] FOREIGN KEY([HiveExperimentId])
    59 --REFERENCES [dbo].[HiveExperiment] ([HiveExperimentId])
    60 --ON UPDATE CASCADE
    61 --ON DELETE CASCADE
    62 --GO
    63 
    6457ALTER TABLE dbo.Plugin ALTER COLUMN PluginId ADD ROWGUIDCOL;
    6558ALTER TABLE dbo.Plugin WITH NOCHECK ADD CONSTRAINT [DF_Plugin_PluginId] DEFAULT (newid()) FOR PluginId;
     
    6760ALTER TABLE dbo.PluginData ALTER COLUMN PluginDataId ADD ROWGUIDCOL;
    6861ALTER TABLE dbo.PluginData WITH NOCHECK ADD CONSTRAINT [DF_PluginData_PluginDataId] DEFAULT (newid()) FOR PluginDataId;
     62
     63ALTER TABLE [dbo].[PluginData]  DROP  CONSTRAINT [Plugin_PluginData]
     64ALTER TABLE [dbo].[PluginData]  WITH CHECK ADD  CONSTRAINT [Plugin_PluginData] FOREIGN KEY([PluginId])
     65REFERENCES [dbo].[Plugin] ([PluginId])
     66ON UPDATE CASCADE
     67ON DELETE CASCADE
     68GO
    6969
    7070ALTER TABLE dbo.RequiredPlugins ALTER COLUMN RequiredPluginId ADD ROWGUIDCOL;
     
    108108
    109109/* triggers */
     110USE [HeuristicLab.Hive-3.4]
     111GO
     112/****** Object:  Trigger [dbo].[tr_HiveExperimentDeleteCascade]    Script Date: 04/19/2011 16:31:53 ******/
    110113SET ANSI_NULLS ON
    111114GO
     
    114117-- =============================================
    115118-- Author:    cneumuel
    116 -- Create date: 11.04.2011
     119-- Create date: 19.04.2011
    117120-- Description: Deletes all associated jobs. This cannot be done with cascading delete,
    118121--              because the job table defines a INSTEAD OF DELETE trigger itself, which
    119122--              is not compatible with cascading deletes.
    120123-- =============================================
    121 ALTER TRIGGER [dbo].[tr_HiveExperimentDeleteCascade] ON [dbo].[HiveExperiment] INSTEAD OF DELETE AS
     124CREATE TRIGGER [dbo].[tr_HiveExperimentDeleteCascade] ON [dbo].[HiveExperiment] INSTEAD OF DELETE AS
    122125BEGIN
    123   DELETE Job FROM Job WHERE Job.HiveExperimentId = HiveExperimentId
     126  DELETE Job FROM deleted, Job WHERE deleted.HiveExperimentId = Job.HiveExperimentId
     127  DELETE HiveExperiment FROM deleted, HiveExperiment WHERE deleted.HiveExperimentId = HiveExperiment.HiveExperimentId
    124128END
     129GO
    125130
    126 SET ANSI_NULLS ON
    127 GO
    128 SET QUOTED_IDENTIFIER ON
    129 GO
    130131-- =============================================
    131132-- Author:    cneumuel
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HeuristicLabServicesHivePlugin.cs.frame

    r5043 r6033  
    88  [Plugin("HeuristicLab.Services.Hive", "3.4.0.$WCREV$")]
    99  [PluginFile("HeuristicLab.Services.Hive-3.4.dll", PluginFileType.Assembly)]
     10  [PluginDependency("HeuristicLab.Clients.Common", "3.3")]
    1011  [PluginDependency("HeuristicLab.Common", "3.3")]
     12  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    1113  [PluginDependency("HeuristicLab.Core", "3.3")]
    1214  [PluginDependency("HeuristicLab.Persistence", "3.3")]
     15  [PluginDependency("HeuristicLab.Services.Hive.Common", "3.4")]
     16  [PluginDependency("HeuristicLab.Services.Hive.DataAccess", "3.4")]
    1317  public class HeuristicLabServicesHivePlugin : PluginBase {
    1418  }
Note: See TracChangeset for help on using the changeset viewer.