- Timestamp:
- 09/26/11 18:26:02 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs
r6792 r6834 52 52 53 53 protected override void removeButton_Click(object sender, EventArgs e) { 54 DialogResult result = MessageBox.Show("This action will permanently delete this experiment (also on the hive server). Continue?", "Delete Experiment", MessageBoxButtons.OKCancel);54 DialogResult result = MessageBox.Show("This action will permanently delete this job (also on the hive server). Continue?", "Delete Job", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); 55 55 if (result == DialogResult.OK) { 56 56 base.removeButton_Click(sender, e); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs
r6792 r6834 58 58 this.calculatingLabel = new System.Windows.Forms.Label(); 59 59 this.jobsLabel = new System.Windows.Forms.Label(); 60 this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 60 61 this.tabControl.SuspendLayout(); 61 62 this.tasksTabPage.SuspendLayout(); 62 63 this.permissionTabPage.SuspendLayout(); 64 this.runsTabPage.SuspendLayout(); 63 65 this.stateTabPage.SuspendLayout(); 64 66 this.logTabPage.SuspendLayout(); … … 149 151 // runsTabPage 150 152 // 153 this.runsTabPage.Controls.Add(this.runCollectionViewHost); 151 154 this.runsTabPage.Location = new System.Drawing.Point(4, 22); 152 155 this.runsTabPage.Name = "runsTabPage"; … … 418 421 this.jobsLabel.Text = "Waiting:"; 419 422 // 420 // RefreshableHiveExperimentView 423 // runCollectionViewHost 424 // 425 this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 426 | System.Windows.Forms.AnchorStyles.Left) 427 | System.Windows.Forms.AnchorStyles.Right))); 428 this.runCollectionViewHost.Caption = "View"; 429 this.runCollectionViewHost.Content = null; 430 this.runCollectionViewHost.Enabled = false; 431 this.runCollectionViewHost.Location = new System.Drawing.Point(3, 3); 432 this.runCollectionViewHost.Name = "runCollectionViewHost"; 433 this.runCollectionViewHost.ReadOnly = false; 434 this.runCollectionViewHost.Size = new System.Drawing.Size(703, 420); 435 this.runCollectionViewHost.TabIndex = 2; 436 this.runCollectionViewHost.ViewsLabelVisible = true; 437 this.runCollectionViewHost.ViewType = null; 438 // 439 // RefreshableHiveJobView 421 440 // 422 441 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); … … 437 456 this.Controls.Add(this.stopButton); 438 457 this.Controls.Add(this.resetButton); 439 this.Name = "RefreshableHive ExperimentView";458 this.Name = "RefreshableHiveJobView"; 440 459 this.Size = new System.Drawing.Size(717, 560); 441 460 this.tabControl.ResumeLayout(false); 442 461 this.tasksTabPage.ResumeLayout(false); 443 462 this.permissionTabPage.ResumeLayout(false); 463 this.runsTabPage.ResumeLayout(false); 444 464 this.stateTabPage.ResumeLayout(false); 445 465 this.logTabPage.ResumeLayout(false); … … 484 504 private System.Windows.Forms.Button refreshPermissionsButton; 485 505 private System.Windows.Forms.TabPage runsTabPage; 506 private MainForm.WindowsForms.ViewHost runCollectionViewHost; 486 507 487 508 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r6792 r6834 63 63 Content.StateLogListChanged += new EventHandler(Content_StateLogListChanged); 64 64 Content.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged); 65 Content.Hive JobsChanged += new EventHandler(Content_HiveJobChanged);65 Content.HiveTasksChanged += new EventHandler(Content_HiveTasksChanged); 66 66 Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged); 67 67 Content.ExecutionTimeChanged += new EventHandler(Content_ExecutionTimeChanged); 68 68 Content.IsAllowedPrivilegedChanged += new EventHandler(Content_IsAllowedPrivilegedChanged); 69 Content.Loaded += new EventHandler(Content_Loaded); 69 70 } 70 71 … … 77 78 Content.StateLogListChanged -= new EventHandler(Content_StateLogListChanged); 78 79 Content.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged); 79 Content.Hive JobsChanged -= new EventHandler(Content_HiveJobChanged);80 Content.HiveTasksChanged -= new EventHandler(Content_HiveTasksChanged); 80 81 Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged); 81 82 Content.ExecutionTimeChanged -= new EventHandler(Content_ExecutionTimeChanged); 83 Content.Loaded -= new EventHandler(Content_Loaded); 82 84 base.DeregisterContentEvents(); 83 85 } … … 92 94 93 95 private void RegisterHiveJobEvents() { 94 Content.HiveTasks.ItemsAdded += new CollectionItemsChangedEventHandler<HiveTask>(Hive Jobs_ItemsAdded_Removed_Reset);95 Content.HiveTasks.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveTask>(Hive Jobs_ItemsAdded_Removed_Reset);96 Content.HiveTasks.CollectionReset += new CollectionItemsChangedEventHandler<HiveTask>(Hive Jobs_ItemsAdded_Removed_Reset);96 Content.HiveTasks.ItemsAdded += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsAdded); 97 Content.HiveTasks.ItemsRemoved += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsRemoved); 98 Content.HiveTasks.CollectionReset += new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_CollectionReset); 97 99 } 98 100 private void DeregisterHiveJobEvents() { 99 Content.HiveTasks.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveTask>(Hive Jobs_ItemsAdded_Removed_Reset);100 Content.HiveTasks.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveTask>(Hive Jobs_ItemsAdded_Removed_Reset);101 Content.HiveTasks.CollectionReset -= new CollectionItemsChangedEventHandler<HiveTask>(Hive Jobs_ItemsAdded_Removed_Reset);101 Content.HiveTasks.ItemsAdded -= new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsAdded); 102 Content.HiveTasks.ItemsRemoved -= new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsRemoved); 103 Content.HiveTasks.CollectionReset -= new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_CollectionReset); 102 104 } 103 105 … … 112 114 refreshAutomaticallyCheckBox.Checked = false; 113 115 logView.Content = null; 116 runCollectionViewHost.Content = null; 114 117 } else { 115 118 nameTextBox.Text = Content.Job.Name; … … 119 122 refreshAutomaticallyCheckBox.Checked = Content.RefreshAutomatically; 120 123 logView.Content = Content.Log; 124 runCollectionViewHost.Content = GetAllRunsFromJob(Content); 121 125 } 122 126 hiveExperimentPermissionListView.Content = null; // has to be filled by refresh button 123 127 Content_JobStatisticsChanged(this, EventArgs.Empty); 124 128 Content_HiveExperimentChanged(this, EventArgs.Empty); 125 Content_Hive JobChanged(this, EventArgs.Empty);129 Content_HiveTasksChanged(this, EventArgs.Empty); 126 130 Content_IsProgressingChanged(this, EventArgs.Empty); 127 131 Content_StateLogListChanged(this, EventArgs.Empty); … … 163 167 164 168 #region Content Events 165 private void HiveJobs_ItemsAdded_Removed_Reset(object sender, CollectionItemsChangedEventArgs<HiveTask> e) { 166 if (InvokeRequired) 167 Invoke(new CollectionItemsChangedEventHandler<HiveTask>(HiveJobs_ItemsAdded_Removed_Reset), sender, e); 168 else { 169 SetEnabledStateOfControls(); 170 } 171 } 169 private void HiveTasks_ItemsAdded(object sender, CollectionItemsChangedEventArgs<HiveTask> e) { 170 if (InvokeRequired) 171 Invoke(new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsAdded), sender, e); 172 else { 173 foreach (HiveTask t in e.Items) { 174 t.TaskStateChanged += new EventHandler(HiveTask_TaskStateChanged); 175 } 176 SetEnabledStateOfControls(); 177 } 178 } 179 180 private void HiveTasks_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<HiveTask> e) { 181 if (InvokeRequired) 182 Invoke(new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_ItemsRemoved), sender, e); 183 else { 184 foreach (HiveTask t in e.Items) { 185 t.TaskStateChanged -= new EventHandler(HiveTask_TaskStateChanged); 186 } 187 SetEnabledStateOfControls(); 188 } 189 } 190 191 private void HiveTasks_CollectionReset(object sender, CollectionItemsChangedEventArgs<HiveTask> e) { 192 if (InvokeRequired) 193 Invoke(new CollectionItemsChangedEventHandler<HiveTask>(HiveTasks_CollectionReset), sender, e); 194 else { 195 foreach (HiveTask t in e.Items) { 196 t.TaskStateChanged -= new EventHandler(HiveTask_TaskStateChanged); 197 } 198 SetEnabledStateOfControls(); 199 } 200 } 201 202 void HiveTask_TaskStateChanged(object sender, EventArgs e) { 203 runCollectionViewHost.Content = GetAllRunsFromJob(Content); 204 } 205 172 206 private void Content_ExecutionStateChanged(object sender, EventArgs e) { 173 207 if (InvokeRequired) … … 224 258 } 225 259 } 226 private void Content_Hive JobChanged(object sender, EventArgs e) {227 if (InvokeRequired) 228 Invoke(new EventHandler(Content_Hive JobChanged), sender, e);260 private void Content_HiveTasksChanged(object sender, EventArgs e) { 261 if (InvokeRequired) 262 Invoke(new EventHandler(Content_HiveTasksChanged), sender, e); 229 263 else { 230 264 if (Content != null && Content.HiveTasks != null) { … … 236 270 SetEnabledStateOfControls(); 237 271 } 272 } 273 274 void Content_Loaded(object sender, EventArgs e) { 275 runCollectionViewHost.Content = GetAllRunsFromJob(Content); 238 276 } 239 277 … … 419 457 } 420 458 } 459 460 private RunCollection GetAllRunsFromJob(RefreshableJob job) { 461 if (job != null) { 462 RunCollection runs = new RunCollection(); 463 464 foreach (HiveTask subTask in job.HiveTasks) { 465 if (subTask is OptimizerHiveTask) { 466 OptimizerHiveTask ohTask = subTask as OptimizerHiveTask; 467 runs.AddRange(ohTask.ItemTask.Item.Runs); 468 } 469 } 470 return runs; 471 } else { 472 return null; 473 } 474 } 421 475 } 422 476 }
Note: See TracChangeset
for help on using the changeset viewer.