Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/11 16:38:28 (13 years ago)
Author:
ascheibe
Message:

#1233 more renaming for more consistency

Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveJobs/HiveJobListView.cs

    r6373 r6725  
    2727namespace HeuristicLab.Clients.Hive.Views {
    2828  [View("JobItemList View")]
    29   [Content(typeof(IItemList<HiveJob>), false)]
    30   public partial class HiveJobListView : ItemListView<HiveJob> {
     29  [Content(typeof(IItemList<HiveTask>), false)]
     30  public partial class HiveJobListView : ItemListView<HiveTask> {
    3131
    3232    public HiveJobListView() {
     
    3535    }
    3636
    37     protected override HiveJob CreateItem() {
     37    protected override HiveTask CreateItem() {
    3838      return null;
    3939    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveJobs/HiveJobView.cs

    r6721 r6725  
    2626
    2727namespace HeuristicLab.Clients.Hive.Views {
    28   [View("HiveJob View")]
    29   [Content(typeof(HiveJob), true)]
    30   [Content(typeof(HiveJob<>), false)]
     28  [View("HiveTask View")]
     29  [Content(typeof(HiveTask), true)]
     30  [Content(typeof(HiveTask<>), false)]
    3131  public partial class HiveJobView : ItemView {
    32     public new HiveJob Content {
    33       get { return (HiveJob)base.Content; }
     32    public new HiveTask Content {
     33      get { return (HiveTask)base.Content; }
    3434      set {
    3535        if (base.Content != value) {
     
    6161    protected override void OnContentChanged() {
    6262      base.OnContentChanged();
    63       if (Content != null && Content.Job != null) {
    64         computeInParallelCheckBox.Checked = Content.ItemJob.ComputeInParallel;
     63      if (Content != null && Content.Task != null) {
     64        computeInParallelCheckBox.Checked = Content.ItemTask.ComputeInParallel;
    6565      } else {
    6666        computeInParallelCheckBox.Checked = false;
     
    7272
    7373    protected virtual void RegisterJobEvents() {
    74       if (Content != null && Content.Job != null) {
    75         Content.ItemJob.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged);
    76         Content.ItemJob.ItemChanged += new EventHandler(Job_ItemChanged);
     74      if (Content != null && Content.Task != null) {
     75        Content.ItemTask.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged);
     76        Content.ItemTask.ItemChanged += new EventHandler(Job_ItemChanged);
    7777      }
    7878    }
    7979
    8080    protected virtual void DeregisterJobEvents() {
    81       if (Content != null && Content.Job != null) {
    82         Content.ItemJob.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged);
    83         Content.ItemJob.ItemChanged -= new EventHandler(Job_ItemChanged);
     81      if (Content != null && Content.Task != null) {
     82        Content.ItemTask.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged);
     83        Content.ItemTask.ItemChanged -= new EventHandler(Job_ItemChanged);
    8484      }
    8585    }
     
    9090        Invoke(new EventHandler(Content_JobChanged), sender, e);
    9191      } else {
    92         if (Content != null && Content.Job != null) {
    93           this.jobIdTextBox.Text = Content.Job.Id.ToString();
    94           this.dateCreatedTextBox.Text = Content.Job.DateCreated.HasValue ? Content.Job.DateCreated.ToString() : string.Empty;
    95           this.priorityTextBox.Text = Content.Job.Priority.ToString();
    96           this.coresNeededTextBox.Text = Content.Job.CoresNeeded.ToString();
    97           this.memoryNeededTextBox.Text = Content.Job.MemoryNeeded.ToString();
     92        if (Content != null && Content.Task != null) {
     93          this.jobIdTextBox.Text = Content.Task.Id.ToString();
     94          this.dateCreatedTextBox.Text = Content.Task.DateCreated.HasValue ? Content.Task.DateCreated.ToString() : string.Empty;
     95          this.priorityTextBox.Text = Content.Task.Priority.ToString();
     96          this.coresNeededTextBox.Text = Content.Task.CoresNeeded.ToString();
     97          this.memoryNeededTextBox.Text = Content.Task.MemoryNeeded.ToString();
    9898        } else {
    9999          this.jobIdTextBox.Text = string.Empty;
     
    112112
    113113    protected virtual void Job_ItemChanged(object sender, EventArgs e) {
    114       if (Content != null && Content.Job != null && Content.ItemJob.Item != null) {
    115         optimizerItemView.Content = Content.ItemJob.Item;
     114      if (Content != null && Content.Task != null && Content.ItemTask.Item != null) {
     115        optimizerItemView.Content = Content.ItemTask.Item;
    116116      } else {
    117117        optimizerItemView.Content = null;
     
    123123        Invoke(new EventHandler(Content_TaskStateChanged), sender, e);
    124124      } else {
    125         if (Content != null && Content.Job != null) {
    126           this.stateTextBox.Text = Content.Job.State.ToString();
    127           this.commandTextBox.Text = Content.Job.Command.ToString();
    128           this.executionTimeTextBox.Text = Content.Job.ExecutionTime.ToString();
    129           this.dateFinishedTextBox.Text = Content.Job.DateFinished.ToString();
    130           this.exceptionTextBox.Text = Content.Job.CurrentStateLog != null ? Content.Job.CurrentStateLog.Exception : string.Empty;
    131           this.lastUpdatedTextBox.Text = Content.Job.LastJobDataUpdate.ToString();
     125        if (Content != null && Content.Task != null) {
     126          this.stateTextBox.Text = Content.Task.State.ToString();
     127          this.commandTextBox.Text = Content.Task.Command.ToString();
     128          this.executionTimeTextBox.Text = Content.Task.ExecutionTime.ToString();
     129          this.dateFinishedTextBox.Text = Content.Task.DateFinished.ToString();
     130          this.exceptionTextBox.Text = Content.Task.CurrentStateLog != null ? Content.Task.CurrentStateLog.Exception : string.Empty;
     131          this.lastUpdatedTextBox.Text = Content.Task.LastJobDataUpdate.ToString();
    132132        } else {
    133133          this.stateTextBox.Text = string.Empty;
     
    148148        Invoke(new EventHandler(OptimizerJob_ComputeInParallelChanged), sender, e);
    149149      } else {
    150         computeInParallelCheckBox.Checked = Content.ItemJob.ComputeInParallel;
     150        computeInParallelCheckBox.Checked = Content.ItemTask.ComputeInParallel;
    151151      }
    152152    }
     
    154154    protected virtual void Content_StateLogChanged(object sender, EventArgs e) {
    155155      if (Content != null) {
    156         if (Content.ItemJob.ComputeInParallel) {
     156        if (Content.ItemTask.ComputeInParallel) {
    157157          this.stateLogViewHost.Content = Content.ChildStateLogList;
    158158        } else {
     
    167167    #region Child Control Events
    168168    protected virtual void computeInParallelCheckBox_CheckedChanged(object sender, EventArgs e) {
    169       if (Content != null && Content.ItemJob != null) {
    170         this.Content.ItemJob.ComputeInParallel = this.computeInParallelCheckBox.Checked;
     169      if (Content != null && Content.ItemTask != null) {
     170        this.Content.ItemTask.ComputeInParallel = this.computeInParallelCheckBox.Checked;
    171171      }
    172172    }
     
    180180
    181181    protected virtual void modifyItemButton_Click(object sender, EventArgs e) {
    182       MainFormManager.MainForm.ShowContent(Content.ItemJob.Item);
     182      MainFormManager.MainForm.ShowContent(Content.ItemTask.Item);
    183183    }
    184184    #endregion
     
    199199      this.coresNeededTextBox.ReadOnly = this.ReadOnly;
    200200      this.memoryNeededTextBox.ReadOnly = this.ReadOnly;
    201       this.computeInParallelCheckBox.Enabled = !this.ReadOnly && this.Content != null && this.Content.ItemJob != null && this.Content.ItemJob.IsParallelizable;
    202 
    203       this.modifyItemButton.Enabled = (Content != null && Content.ItemJob.Item != null && (Content.Job.State == TaskState.Paused || Content.Job.State == TaskState.Offline || Content.Job.State == TaskState.Finished || Content.Job.State == TaskState.Failed || Content.Job.State == TaskState.Aborted));
     201      this.computeInParallelCheckBox.Enabled = !this.ReadOnly && this.Content != null && this.Content.ItemTask != null && this.Content.ItemTask.IsParallelizable;
     202
     203      this.modifyItemButton.Enabled = (Content != null && Content.ItemTask.Item != null && (Content.Task.State == TaskState.Paused || Content.Task.State == TaskState.Offline || Content.Task.State == TaskState.Finished || Content.Task.State == TaskState.Failed || Content.Task.State == TaskState.Aborted));
    204204
    205205      optimizerItemView.ReadOnly = true;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveJobs/OptimizerHiveJobView.cs

    r6721 r6725  
    2525
    2626namespace HeuristicLab.Clients.Hive.Views {
    27   [View("OptimizerHiveJob View")]
    28   [Content(typeof(OptimizerHiveJob), true)]
     27  [View("OptimizerHiveTask View")]
     28  [Content(typeof(OptimizerHiveTask), true)]
    2929  public partial class OptimizerHiveJobView : HiveJobView {
    30     public new OptimizerHiveJob Content {
    31       get { return (OptimizerHiveJob)base.Content; }
     30    public new OptimizerHiveTask Content {
     31      get { return (OptimizerHiveTask)base.Content; }
    3232      set {
    3333        if (base.Content != value) {
     
    4242
    4343    protected override void Job_ItemChanged(object sender, EventArgs e) {
    44       if (Content != null && Content.Job != null && Content.ItemJob.Item != null) {
    45         runCollectionViewHost.Content = Content.ItemJob.Item.Runs;
     44      if (Content != null && Content.Task != null && Content.ItemTask.Item != null) {
     45        runCollectionViewHost.Content = Content.ItemTask.Item.Runs;
    4646      } else {
    4747        runCollectionViewHost.Content = null;
     
    8282      base.SetEnabledStateOfControls();
    8383
    84       this.restartButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && (Content.Job.State == TaskState.Paused || Content.Job.State == TaskState.Failed || Content.Job.State == TaskState.Aborted);
    85       this.pauseButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && Content.Job.State == TaskState.Calculating;
    86       this.stopButton.Enabled = Content != null && Content.IsControllable && !Content.Job.Command.HasValue && (Content.Job.State == TaskState.Calculating || Content.Job.State == TaskState.Waiting || Content.Job.State == TaskState.Paused);
     84      this.restartButton.Enabled = Content != null && Content.IsControllable && !Content.Task.Command.HasValue && (Content.Task.State == TaskState.Paused || Content.Task.State == TaskState.Failed || Content.Task.State == TaskState.Aborted);
     85      this.pauseButton.Enabled = Content != null && Content.IsControllable && !Content.Task.Command.HasValue && Content.Task.State == TaskState.Calculating;
     86      this.stopButton.Enabled = Content != null && Content.IsControllable && !Content.Task.Command.HasValue && (Content.Task.State == TaskState.Calculating || Content.Task.State == TaskState.Waiting || Content.Task.State == TaskState.Paused);
    8787    }
    8888  }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/TreeView/DeleteJobTreeNodeAction.cs

    r6721 r6725  
    55using HeuristicLab.Optimization;
    66namespace HeuristicLab.Clients.Hive.Views.ExperimentManager.TreeView {
    7   public class DeleteJobTreeNodeAction : IItemTreeNodeAction<HiveJob> {
    8     private ItemCollection<HiveJob> hiveJobs;
     7  public class DeleteJobTreeNodeAction : IItemTreeNodeAction<HiveTask> {
     8    private ItemCollection<HiveTask> hiveJobs;
    99   
    10     public DeleteJobTreeNodeAction(ItemCollection<HiveJob> hiveJobs) {
     10    public DeleteJobTreeNodeAction(ItemCollection<HiveTask> hiveJobs) {
    1111      this.hiveJobs = hiveJobs;
    1212    }
     
    2020    }
    2121
    22     public void Execute(HiveJob item, HiveJob parentItem) {
     22    public void Execute(HiveTask item, HiveTask parentItem) {
    2323      if (parentItem == null) {
    2424        hiveJobs.Remove(item);
    2525      } else {
    26         var experiment = parentItem.ItemJob.Item as Experiment;
     26        var experiment = parentItem.ItemTask.Item as Experiment;
    2727        if (experiment != null) {
    28           experiment.Optimizers.Remove(((OptimizerJob)item.ItemJob).Item);
     28          experiment.Optimizers.Remove(((OptimizerTask)item.ItemTask).Item);
    2929        }
    3030      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/TreeView/HiveJobItemTreeView.cs

    r6479 r6725  
    3030
    3131namespace HeuristicLab.Clients.Hive.Views.ExperimentManager {
    32   [View("HiveJob ItemTreeView")]
    33   [Content(typeof(ItemCollection<HiveJob>), IsDefaultView = false)]
    34   public partial class HiveJobItemTreeView : ItemTreeView<HiveJob> {
    35     public new ItemCollection<HiveJob> Content {
    36       get { return (ItemCollection<HiveJob>)base.Content; }
     32  [View("HiveTask ItemTreeView")]
     33  [Content(typeof(ItemCollection<HiveTask>), IsDefaultView = false)]
     34  public partial class HiveJobItemTreeView : ItemTreeView<HiveTask> {
     35    public new ItemCollection<HiveTask> Content {
     36      get { return (ItemCollection<HiveTask>)base.Content; }
    3737      set { base.Content = value; }
    3838    }
     
    7676      if (optimizer != null) {
    7777        if (treeView.SelectedNode == null) {
    78           Content.Add(new OptimizerHiveJob(optimizer));
     78          Content.Add(new OptimizerHiveTask(optimizer));
    7979        } else {
    80           var experiment = ((HiveJob)treeView.SelectedNode.Tag).ItemJob.Item as Experiment;
     80          var experiment = ((HiveTask)treeView.SelectedNode.Tag).ItemTask.Item as Experiment;
    8181          if (experiment != null) {
    8282            experiment.Optimizers.Add(optimizer);
     
    8888    protected override void removeButton_Click(object sender, EventArgs e) {
    8989      if (treeView.SelectedNode != null) {
    90         var selectedItem = (HiveJob)treeView.SelectedNode.Tag;
     90        var selectedItem = (HiveTask)treeView.SelectedNode.Tag;
    9191        var parentItem = GetParentItem(selectedItem);
    9292        if (parentItem == null) {
    93           Content.Remove((HiveJob)treeView.SelectedNode.Tag);
     93          Content.Remove((HiveTask)treeView.SelectedNode.Tag);
    9494        } else {
    95           var experiment = parentItem.ItemJob.Item as Experiment;
     95          var experiment = parentItem.ItemTask.Item as Experiment;
    9696          if (experiment != null) {
    97             experiment.Optimizers.Remove(((OptimizerJob)selectedItem.ItemJob).Item);
     97            experiment.Optimizers.Remove(((OptimizerTask)selectedItem.ItemTask).Item);
    9898          }
    9999        }
     
    102102    #endregion
    103103
    104     protected override ICollection<IItemTreeNodeAction<HiveJob>> GetTreeNodeItemActions(HiveJob selectedItem) {
     104    protected override ICollection<IItemTreeNodeAction<HiveTask>> GetTreeNodeItemActions(HiveTask selectedItem) {
    105105      return base.GetTreeNodeItemActions(selectedItem);
    106106    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/TreeView/NewExperimentTreeNodeAction.cs

    r6382 r6725  
    2525
    2626namespace HeuristicLab.Clients.Hive {
    27   public class NewExperimentTreeNodeAction : IItemTreeNodeAction<HiveJob> {
    28     private ItemCollection<HiveJob> hiveJobs;
     27  public class NewExperimentTreeNodeAction : IItemTreeNodeAction<HiveTask> {
     28    private ItemCollection<HiveTask> hiveJobs;
    2929
    30     public NewExperimentTreeNodeAction(ItemCollection<HiveJob> hiveJobs) {
     30    public NewExperimentTreeNodeAction(ItemCollection<HiveTask> hiveJobs) {
    3131      this.hiveJobs = hiveJobs;
    3232    }
     
    4040    }
    4141
    42     public void Execute(HiveJob item, HiveJob parentItem) {
     42    public void Execute(HiveTask item, HiveTask parentItem) {
    4343      if (item != null) {
    44         var experiment = item.ItemJob.Item as Experiment;
     44        var experiment = item.ItemTask.Item as Experiment;
    4545        experiment.Optimizers.Add(new Experiment());
    4646      } else {
    47         hiveJobs.Add(new OptimizerHiveJob(new Experiment()));
     47        hiveJobs.Add(new OptimizerHiveTask(new Experiment()));
    4848      }
    4949    }
Note: See TracChangeset for help on using the changeset viewer.