Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/03/14 16:36:10 (10 years ago)
Author:
ascheibe
Message:

#2117 merged r10130, r10150, r10154, r10170, r11079 into stable

Location:
stable
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj

    r8718 r11083  
    9898    <Compile Include="ExtensionMethods\TreeNodeExtensions.cs" />
    9999    <Compile Include="ListViewItemDateComparer.cs" />
     100    <Compile Include="MenuItems\CreateHiveJobMenuItem.cs" />
     101    <Compile Include="MenuItems\RunInHiveMenuItem.cs" />
    100102    <Compile Include="Plugin.cs" />
    101103    <Compile Include="Views\HiveJobManagerView.cs">
  • stable/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/CreateHiveJobMenuItem.cs

    r10150 r11083  
    2222using System;
    2323using System.Collections.Generic;
    24 using HeuristicLab.Clients.Hive;
    2524using HeuristicLab.Core;
    2625using HeuristicLab.MainForm;
    2726using HeuristicLab.Optimization;
     27using HeuristicLab.Optimizer;
    2828
    29 namespace HeuristicLab.Optimizer.MenuItems {
     29namespace HeuristicLab.Clients.Hive.JobManager {
    3030  public class CreateHiveJobMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    3131    public override string Name {
     
    4848          Type contentType = content.GetType();
    4949          ToolStripItem.Enabled = ItemTask.IsTypeSupported(contentType);
    50         } else {
    51           ToolStripItem.Enabled = false;
     50          return;
    5251        }
    5352      }
     53      ToolStripItem.Enabled = false;
    5454    }
    5555
     
    7474      HiveTask task = hiveTask.CreateHiveTask();
    7575      RefreshableJob rJob = new RefreshableJob();
    76       rJob.Job.Name = content.ItemName;
     76      rJob.Job.Name = content.ToString();
    7777      rJob.HiveTasks.Add(task);
    7878      task.ItemTask.ComputeInParallel = content is Experiment || content is BatchRun;
  • stable/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/JobManagerMenuItem.cs

    r9456 r11083  
    2222using System.Collections.Generic;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Clients.Hive;
    2524using HeuristicLab.MainForm;
     25using HeuristicLab.Optimizer;
    2626
    27 namespace HeuristicLab.Optimizer.MenuItems {
     27namespace HeuristicLab.Clients.Hive.JobManager {
    2828  public class JobManagerMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    2929    public override string Name {
  • stable/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs

    r10150 r11083  
    2323using System.Collections.Generic;
    2424using System.Threading;
    25 using HeuristicLab.Clients.Hive;
    2625using HeuristicLab.Core;
    2726using HeuristicLab.MainForm;
    2827using HeuristicLab.Optimization;
     28using HeuristicLab.Optimizer;
    2929using HeuristicLab.PluginInfrastructure;
    3030
    31 namespace HeuristicLab.Optimizer.MenuItems {
     31namespace HeuristicLab.Clients.Hive.JobManager {
    3232  public class RunInHiveMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    3333    public override string Name {
     
    5050          Type contentType = content.GetType();
    5151          ToolStripItem.Enabled = ItemTask.IsTypeSupported(contentType);
    52         } else {
    53           ToolStripItem.Enabled = false;
     52          return;
    5453        }
    5554      }
     55      ToolStripItem.Enabled = false;
    5656    }
    5757
     
    7878      HiveTask task = hiveTask.CreateHiveTask();
    7979      RefreshableJob rJob = new RefreshableJob();
    80       rJob.Job.Name = content.ItemName;
     80      rJob.Job.Name = content.ToString();
    8181      rJob.HiveTasks.Add(task);
    8282      task.ItemTask.ComputeInParallel = content is Experiment || content is BatchRun;
  • stable/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r9933 r11083  
    468468    private void jobsTreeView_DragEnter(object sender, DragEventArgs e) {
    469469      e.Effect = DragDropEffects.None;
    470       var obj = e.Data.GetData(Constants.DragDropDataFormat);
    471       if (obj is IOptimizer) {
     470      var obj = (IDeepCloneable)e.Data.GetData(Constants.DragDropDataFormat);
     471
     472      Type objType = obj.GetType();
     473      if (ItemTask.IsTypeSupported(objType)) {
    472474        if (Content.Id != Guid.Empty) e.Effect = DragDropEffects.None;
    473475        else if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
     
    478480    private void jobsTreeView_DragDrop(object sender, DragEventArgs e) {
    479481      if (e.Effect != DragDropEffects.None) {
    480         var obj = e.Data.GetData(Constants.DragDropDataFormat);
    481 
    482         var optimizer = obj as IOptimizer;
    483         if (optimizer != null) {
    484           IOptimizer newOptimizer = null;
    485           if (e.Effect.HasFlag(DragDropEffects.Copy)) {
    486             newOptimizer = (IOptimizer)optimizer.Clone();
    487             newOptimizer.Runs.Clear();
    488           } else {
    489             newOptimizer = optimizer;
     482        var obj = (IItem)e.Data.GetData(Constants.DragDropDataFormat);
     483
     484        IItem newObj = null;
     485        if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     486          newObj = (IItem)obj.Clone();
     487        } else {
     488          newObj = obj;
     489        }
     490
     491        //IOptimizer and IExecutables need some special care
     492        if (newObj is IOptimizer) {
     493          ((IOptimizer)newObj).Runs.Clear();
     494        }
     495        if (newObj is IExecutable) {
     496          IExecutable exec = (IExecutable)newObj;
     497          if (exec.ExecutionState != ExecutionState.Prepared) {
     498            exec.Prepare();
    490499          }
    491           if (newOptimizer.ExecutionState != ExecutionState.Prepared) {
    492             newOptimizer.Prepare();
    493           }
    494 
    495           Content.HiveTasks.Add(new OptimizerHiveTask(newOptimizer));
    496         }
     500        }
     501
     502        ItemTask hiveTask = ItemTask.GetItemTaskForItem(newObj);
     503        Content.HiveTasks.Add(hiveTask.CreateHiveTask());
    497504      }
    498505    }
Note: See TracChangeset for help on using the changeset viewer.