- Timestamp:
- 09/08/11 16:38:28 (13 years ago)
- 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 27 27 namespace HeuristicLab.Clients.Hive.Views { 28 28 [View("JobItemList View")] 29 [Content(typeof(IItemList<Hive Job>), false)]30 public partial class HiveJobListView : ItemListView<Hive Job> {29 [Content(typeof(IItemList<HiveTask>), false)] 30 public partial class HiveJobListView : ItemListView<HiveTask> { 31 31 32 32 public HiveJobListView() { … … 35 35 } 36 36 37 protected override Hive JobCreateItem() {37 protected override HiveTask CreateItem() { 38 38 return null; 39 39 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveJobs/HiveJobView.cs
r6721 r6725 26 26 27 27 namespace HeuristicLab.Clients.Hive.Views { 28 [View("Hive JobView")]29 [Content(typeof(Hive Job), true)]30 [Content(typeof(Hive Job<>), false)]28 [View("HiveTask View")] 29 [Content(typeof(HiveTask), true)] 30 [Content(typeof(HiveTask<>), false)] 31 31 public partial class HiveJobView : ItemView { 32 public new Hive JobContent {33 get { return (Hive Job)base.Content; }32 public new HiveTask Content { 33 get { return (HiveTask)base.Content; } 34 34 set { 35 35 if (base.Content != value) { … … 61 61 protected override void OnContentChanged() { 62 62 base.OnContentChanged(); 63 if (Content != null && Content. Job!= null) {64 computeInParallelCheckBox.Checked = Content.Item Job.ComputeInParallel;63 if (Content != null && Content.Task != null) { 64 computeInParallelCheckBox.Checked = Content.ItemTask.ComputeInParallel; 65 65 } else { 66 66 computeInParallelCheckBox.Checked = false; … … 72 72 73 73 protected virtual void RegisterJobEvents() { 74 if (Content != null && Content. Job!= null) {75 Content.Item Job.ComputeInParallelChanged += new EventHandler(OptimizerJob_ComputeInParallelChanged);76 Content.Item Job.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); 77 77 } 78 78 } 79 79 80 80 protected virtual void DeregisterJobEvents() { 81 if (Content != null && Content. Job!= null) {82 Content.Item Job.ComputeInParallelChanged -= new EventHandler(OptimizerJob_ComputeInParallelChanged);83 Content.Item Job.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); 84 84 } 85 85 } … … 90 90 Invoke(new EventHandler(Content_JobChanged), sender, e); 91 91 } 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(); 98 98 } else { 99 99 this.jobIdTextBox.Text = string.Empty; … … 112 112 113 113 protected virtual void Job_ItemChanged(object sender, EventArgs e) { 114 if (Content != null && Content. Job != null && Content.ItemJob.Item != null) {115 optimizerItemView.Content = Content.Item Job.Item;114 if (Content != null && Content.Task != null && Content.ItemTask.Item != null) { 115 optimizerItemView.Content = Content.ItemTask.Item; 116 116 } else { 117 117 optimizerItemView.Content = null; … … 123 123 Invoke(new EventHandler(Content_TaskStateChanged), sender, e); 124 124 } 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(); 132 132 } else { 133 133 this.stateTextBox.Text = string.Empty; … … 148 148 Invoke(new EventHandler(OptimizerJob_ComputeInParallelChanged), sender, e); 149 149 } else { 150 computeInParallelCheckBox.Checked = Content.Item Job.ComputeInParallel;150 computeInParallelCheckBox.Checked = Content.ItemTask.ComputeInParallel; 151 151 } 152 152 } … … 154 154 protected virtual void Content_StateLogChanged(object sender, EventArgs e) { 155 155 if (Content != null) { 156 if (Content.Item Job.ComputeInParallel) {156 if (Content.ItemTask.ComputeInParallel) { 157 157 this.stateLogViewHost.Content = Content.ChildStateLogList; 158 158 } else { … … 167 167 #region Child Control Events 168 168 protected virtual void computeInParallelCheckBox_CheckedChanged(object sender, EventArgs e) { 169 if (Content != null && Content.Item Job!= null) {170 this.Content.Item Job.ComputeInParallel = this.computeInParallelCheckBox.Checked;169 if (Content != null && Content.ItemTask != null) { 170 this.Content.ItemTask.ComputeInParallel = this.computeInParallelCheckBox.Checked; 171 171 } 172 172 } … … 180 180 181 181 protected virtual void modifyItemButton_Click(object sender, EventArgs e) { 182 MainFormManager.MainForm.ShowContent(Content.Item Job.Item);182 MainFormManager.MainForm.ShowContent(Content.ItemTask.Item); 183 183 } 184 184 #endregion … … 199 199 this.coresNeededTextBox.ReadOnly = this.ReadOnly; 200 200 this.memoryNeededTextBox.ReadOnly = this.ReadOnly; 201 this.computeInParallelCheckBox.Enabled = !this.ReadOnly && this.Content != null && this.Content.Item Job != null && this.Content.ItemJob.IsParallelizable;202 203 this.modifyItemButton.Enabled = (Content != null && Content.Item Job.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)); 204 204 205 205 optimizerItemView.ReadOnly = true; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/HiveJobs/OptimizerHiveJobView.cs
r6721 r6725 25 25 26 26 namespace HeuristicLab.Clients.Hive.Views { 27 [View("OptimizerHive JobView")]28 [Content(typeof(OptimizerHive Job), true)]27 [View("OptimizerHiveTask View")] 28 [Content(typeof(OptimizerHiveTask), true)] 29 29 public partial class OptimizerHiveJobView : HiveJobView { 30 public new OptimizerHive JobContent {31 get { return (OptimizerHive Job)base.Content; }30 public new OptimizerHiveTask Content { 31 get { return (OptimizerHiveTask)base.Content; } 32 32 set { 33 33 if (base.Content != value) { … … 42 42 43 43 protected override void Job_ItemChanged(object sender, EventArgs e) { 44 if (Content != null && Content. Job != null && Content.ItemJob.Item != null) {45 runCollectionViewHost.Content = Content.Item Job.Item.Runs;44 if (Content != null && Content.Task != null && Content.ItemTask.Item != null) { 45 runCollectionViewHost.Content = Content.ItemTask.Item.Runs; 46 46 } else { 47 47 runCollectionViewHost.Content = null; … … 82 82 base.SetEnabledStateOfControls(); 83 83 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); 87 87 } 88 88 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/TreeView/DeleteJobTreeNodeAction.cs
r6721 r6725 5 5 using HeuristicLab.Optimization; 6 6 namespace HeuristicLab.Clients.Hive.Views.ExperimentManager.TreeView { 7 public class DeleteJobTreeNodeAction : IItemTreeNodeAction<Hive Job> {8 private ItemCollection<Hive Job> hiveJobs;7 public class DeleteJobTreeNodeAction : IItemTreeNodeAction<HiveTask> { 8 private ItemCollection<HiveTask> hiveJobs; 9 9 10 public DeleteJobTreeNodeAction(ItemCollection<Hive Job> hiveJobs) {10 public DeleteJobTreeNodeAction(ItemCollection<HiveTask> hiveJobs) { 11 11 this.hiveJobs = hiveJobs; 12 12 } … … 20 20 } 21 21 22 public void Execute(Hive Job item, HiveJobparentItem) {22 public void Execute(HiveTask item, HiveTask parentItem) { 23 23 if (parentItem == null) { 24 24 hiveJobs.Remove(item); 25 25 } else { 26 var experiment = parentItem.Item Job.Item as Experiment;26 var experiment = parentItem.ItemTask.Item as Experiment; 27 27 if (experiment != null) { 28 experiment.Optimizers.Remove(((Optimizer Job)item.ItemJob).Item);28 experiment.Optimizers.Remove(((OptimizerTask)item.ItemTask).Item); 29 29 } 30 30 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/TreeView/HiveJobItemTreeView.cs
r6479 r6725 30 30 31 31 namespace HeuristicLab.Clients.Hive.Views.ExperimentManager { 32 [View("Hive JobItemTreeView")]33 [Content(typeof(ItemCollection<Hive Job>), IsDefaultView = false)]34 public partial class HiveJobItemTreeView : ItemTreeView<Hive Job> {35 public new ItemCollection<Hive Job> Content {36 get { return (ItemCollection<Hive Job>)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; } 37 37 set { base.Content = value; } 38 38 } … … 76 76 if (optimizer != null) { 77 77 if (treeView.SelectedNode == null) { 78 Content.Add(new OptimizerHive Job(optimizer));78 Content.Add(new OptimizerHiveTask(optimizer)); 79 79 } else { 80 var experiment = ((Hive Job)treeView.SelectedNode.Tag).ItemJob.Item as Experiment;80 var experiment = ((HiveTask)treeView.SelectedNode.Tag).ItemTask.Item as Experiment; 81 81 if (experiment != null) { 82 82 experiment.Optimizers.Add(optimizer); … … 88 88 protected override void removeButton_Click(object sender, EventArgs e) { 89 89 if (treeView.SelectedNode != null) { 90 var selectedItem = (Hive Job)treeView.SelectedNode.Tag;90 var selectedItem = (HiveTask)treeView.SelectedNode.Tag; 91 91 var parentItem = GetParentItem(selectedItem); 92 92 if (parentItem == null) { 93 Content.Remove((Hive Job)treeView.SelectedNode.Tag);93 Content.Remove((HiveTask)treeView.SelectedNode.Tag); 94 94 } else { 95 var experiment = parentItem.Item Job.Item as Experiment;95 var experiment = parentItem.ItemTask.Item as Experiment; 96 96 if (experiment != null) { 97 experiment.Optimizers.Remove(((Optimizer Job)selectedItem.ItemJob).Item);97 experiment.Optimizers.Remove(((OptimizerTask)selectedItem.ItemTask).Item); 98 98 } 99 99 } … … 102 102 #endregion 103 103 104 protected override ICollection<IItemTreeNodeAction<Hive Job>> GetTreeNodeItemActions(HiveJobselectedItem) {104 protected override ICollection<IItemTreeNodeAction<HiveTask>> GetTreeNodeItemActions(HiveTask selectedItem) { 105 105 return base.GetTreeNodeItemActions(selectedItem); 106 106 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.3/TreeView/NewExperimentTreeNodeAction.cs
r6382 r6725 25 25 26 26 namespace HeuristicLab.Clients.Hive { 27 public class NewExperimentTreeNodeAction : IItemTreeNodeAction<Hive Job> {28 private ItemCollection<Hive Job> hiveJobs;27 public class NewExperimentTreeNodeAction : IItemTreeNodeAction<HiveTask> { 28 private ItemCollection<HiveTask> hiveJobs; 29 29 30 public NewExperimentTreeNodeAction(ItemCollection<Hive Job> hiveJobs) {30 public NewExperimentTreeNodeAction(ItemCollection<HiveTask> hiveJobs) { 31 31 this.hiveJobs = hiveJobs; 32 32 } … … 40 40 } 41 41 42 public void Execute(Hive Job item, HiveJobparentItem) {42 public void Execute(HiveTask item, HiveTask parentItem) { 43 43 if (item != null) { 44 var experiment = item.Item Job.Item as Experiment;44 var experiment = item.ItemTask.Item as Experiment; 45 45 experiment.Optimizers.Add(new Experiment()); 46 46 } else { 47 hiveJobs.Add(new OptimizerHive Job(new Experiment()));47 hiveJobs.Add(new OptimizerHiveTask(new Experiment())); 48 48 } 49 49 }
Note: See TracChangeset
for help on using the changeset viewer.