- Timestamp:
- 02/06/12 17:50:17 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
- Property svn:ignore
-
old new 3 3 *.resharper 4 4 *.suo 5 *.user 5 6 *.vsp 6 7 Doxygen 8 FxCopResults.txt 7 9 Google.ProtocolBuffers-0.9.1.dll 8 10 HeuristicLab 3.3.5.1.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs
r7268 r7460 25 25 private void InitializeComponent() { 26 26 this.components = new System.ComponentModel.Container(); 27 this.tabControl = new System.Windows.Forms.TabControl();27 this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl(); 28 28 this.tasksTabPage = new System.Windows.Forms.TabPage(); 29 this.jobsTreeView = new HeuristicLab.Clients.Hive.Views. HiveTaskItemTreeView();29 this.jobsTreeView = new HeuristicLab.Clients.Hive.Views.ExperimentManager.HiveTaskItemTreeView(); 30 30 this.permissionTabPage = new System.Windows.Forms.TabPage(); 31 31 this.refreshPermissionsButton = new System.Windows.Forms.Button(); 32 32 this.hiveExperimentPermissionListView = new HeuristicLab.Clients.Hive.JobManager.Views.HiveJobPermissionListView(); 33 33 this.runsTabPage = new System.Windows.Forms.TabPage(); 34 this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();35 34 this.stateTabPage = new System.Windows.Forms.TabPage(); 36 35 this.stateLogViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); … … 58 57 this.calculatingLabel = new System.Windows.Forms.Label(); 59 58 this.jobsLabel = new System.Windows.Forms.Label(); 59 this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 60 60 this.tabControl.SuspendLayout(); 61 61 this.tasksTabPage.SuspendLayout(); … … 106 106 this.jobsTreeView.ReadOnly = false; 107 107 this.jobsTreeView.Size = new System.Drawing.Size(704, 420); 108 this.jobsTreeView.TabIndex = 4;108 this.jobsTreeView.TabIndex = 0; 109 109 this.jobsTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.jobsTreeView_DragDrop); 110 110 this.jobsTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.jobsTreeView_DragEnter); … … 124 124 // refreshPermissionsButton 125 125 // 126 this.refreshPermissionsButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;126 this.refreshPermissionsButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshPermissionsButton.Image"))); 127 127 this.refreshPermissionsButton.Location = new System.Drawing.Point(3, 3); 128 128 this.refreshPermissionsButton.Name = "refreshPermissionsButton"; … … 158 158 this.runsTabPage.Text = "Runs"; 159 159 this.runsTabPage.UseVisualStyleBackColor = true; 160 //161 // runCollectionViewHost162 //163 this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)164 | System.Windows.Forms.AnchorStyles.Left)165 | System.Windows.Forms.AnchorStyles.Right)));166 this.runCollectionViewHost.Caption = "View";167 this.runCollectionViewHost.Content = null;168 this.runCollectionViewHost.Enabled = false;169 this.runCollectionViewHost.Location = new System.Drawing.Point(3, 3);170 this.runCollectionViewHost.Name = "runCollectionViewHost";171 this.runCollectionViewHost.ReadOnly = false;172 this.runCollectionViewHost.Size = new System.Drawing.Size(703, 420);173 this.runCollectionViewHost.TabIndex = 2;174 this.runCollectionViewHost.ViewsLabelVisible = true;175 this.runCollectionViewHost.ViewType = null;176 160 // 177 161 // stateTabPage … … 227 211 // 228 212 this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 229 this.startButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play;213 this.startButton.Image = ((System.Drawing.Image)(resources.GetObject("startButton.Image"))); 230 214 this.startButton.Location = new System.Drawing.Point(0, 536); 231 215 this.startButton.Name = "startButton"; … … 239 223 // 240 224 this.stopButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 241 this.stopButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Stop;225 this.stopButton.Image = ((System.Drawing.Image)(resources.GetObject("stopButton.Image"))); 242 226 this.stopButton.Location = new System.Drawing.Point(60, 536); 243 227 this.stopButton.Name = "stopButton"; … … 252 236 this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 253 237 this.resetButton.Enabled = false; 254 this.resetButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart;238 this.resetButton.Image = ((System.Drawing.Image)(resources.GetObject("resetButton.Image"))); 255 239 this.resetButton.Location = new System.Drawing.Point(90, 536); 256 240 this.resetButton.Name = "resetButton"; … … 284 268 this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 285 269 this.pauseButton.Enabled = false; 286 this.pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause;270 this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image"))); 287 271 this.pauseButton.Location = new System.Drawing.Point(30, 536); 288 272 this.pauseButton.Name = "pauseButton"; … … 309 293 this.resourceNamesTextBox.Name = "resourceNamesTextBox"; 310 294 this.resourceNamesTextBox.Size = new System.Drawing.Size(415, 20); 311 this.resourceNamesTextBox.TabIndex = 2;295 this.resourceNamesTextBox.TabIndex = 14; 312 296 this.resourceNamesTextBox.Validated += new System.EventHandler(this.resourceNamesTextBox_Validated); 313 297 // … … 328 312 this.nameTextBox.Name = "nameTextBox"; 329 313 this.nameTextBox.Size = new System.Drawing.Size(501, 20); 330 this.nameTextBox.TabIndex = 1;314 this.nameTextBox.TabIndex = 21; 331 315 this.nameTextBox.Validated += new System.EventHandler(this.nameTextBox_Validated); 332 316 // 333 317 // refreshButton 334 318 // 335 this.refreshButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;319 this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image"))); 336 320 this.refreshButton.Location = new System.Drawing.Point(3, 0); 337 321 this.refreshButton.Name = "refreshButton"; … … 349 333 this.isPrivilegedCheckBox.Name = "isPrivilegedCheckBox"; 350 334 this.isPrivilegedCheckBox.Size = new System.Drawing.Size(72, 17); 351 this.isPrivilegedCheckBox.TabIndex = 3;335 this.isPrivilegedCheckBox.TabIndex = 26; 352 336 this.isPrivilegedCheckBox.Text = "Privileged"; 353 337 this.toolTip.SetToolTip(this.isPrivilegedCheckBox, "If checked, the task will be executed in a privileged sandbox on the slave."); … … 435 419 this.jobsLabel.TabIndex = 0; 436 420 this.jobsLabel.Text = "Waiting:"; 421 // 422 // runCollectionViewHost 423 // 424 this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 425 | System.Windows.Forms.AnchorStyles.Left) 426 | System.Windows.Forms.AnchorStyles.Right))); 427 this.runCollectionViewHost.Caption = "View"; 428 this.runCollectionViewHost.Content = null; 429 this.runCollectionViewHost.Enabled = false; 430 this.runCollectionViewHost.Location = new System.Drawing.Point(3, 3); 431 this.runCollectionViewHost.Name = "runCollectionViewHost"; 432 this.runCollectionViewHost.ReadOnly = false; 433 this.runCollectionViewHost.Size = new System.Drawing.Size(703, 420); 434 this.runCollectionViewHost.TabIndex = 2; 435 this.runCollectionViewHost.ViewsLabelVisible = true; 436 this.runCollectionViewHost.ViewType = null; 437 437 // 438 438 // RefreshableHiveJobView … … 483 483 private Core.Views.LogView logView; 484 484 private System.Windows.Forms.TabPage tasksTabPage; 485 private HeuristicLab.Clients.Hive.Views. HiveTaskItemTreeView jobsTreeView;485 private HeuristicLab.Clients.Hive.Views.ExperimentManager.HiveTaskItemTreeView jobsTreeView; 486 486 private System.Windows.Forms.Label nameLabel; 487 487 private System.Windows.Forms.TextBox nameTextBox; -
branches/HeuristicLab.TimeSeries/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs
r7268 r7460 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using System.Linq; 25 25 using System.Threading; 26 using System.Threading.Tasks;27 26 using System.Windows.Forms; 28 27 using HeuristicLab.Clients.Hive.Views; … … 114 113 logView.Content = null; 115 114 refreshAutomaticallyCheckBox.Checked = false; 116 logView.Content = null;117 115 runCollectionViewHost.Content = null; 118 116 } else { … … 302 300 } 303 301 private void Content_ExceptionOccured(object sender, EventArgs<Exception> e) { 304 throw e.Value; 302 if (InvokeRequired) 303 Invoke(new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured), sender, e); 304 else { 305 //don't show the error dialog when downloading tasks, the HiveClient will throw an exception and the dialog will be shown then 306 if (sender.GetType() != typeof(ConcurrentTaskDownloader<ItemTask>) && sender.GetType() != typeof(TaskDownloader)) { 307 ErrorHandling.ShowErrorDialog(this, e.Value); 308 } 309 } 305 310 } 306 311 private void Content_StateLogListChanged(object sender, EventArgs e) { … … 318 323 } 319 324 } 325 320 326 321 327 private void UpdateStateLogList() { … … 336 342 if (nameTextBox.Text.Trim() == string.Empty) { 337 343 MessageBox.Show("Please enter a name for the job before uploading it!", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Information); 338 } else if (Content.ExecutionState == ExecutionState.Paused) {339 var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeJobAsync, Content);340 task.ContinueWith((t) => {341 FinishProgressView();342 MessageBox.Show("An error occured resuming the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);343 Content.Log.LogException(t.Exception);344 }, TaskContinuationOptions.OnlyOnFaulted);345 344 } else { 346 345 HiveClient.StartJob((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Start failed.", ex), Content, new CancellationToken()); 347 346 } 348 347 } 349 350 348 private void pauseButton_Click(object sender, EventArgs e) { 351 var task = System.Threading.Tasks.Task.Factory.StartNew(PauseJobAsync, Content); 352 task.ContinueWith((t) => { 353 FinishProgressView(); 354 MessageBox.Show("An error occured pausing the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); 355 Content.Log.LogException(t.Exception); 356 }, TaskContinuationOptions.OnlyOnFaulted); 357 } 358 349 HiveClient.PauseJob(Content); 350 } 359 351 private void stopButton_Click(object sender, EventArgs e) { 360 var task = System.Threading.Tasks.Task.Factory.StartNew(StopJobAsync, Content); 361 task.ContinueWith((t) => { 362 FinishProgressView(); 363 MessageBox.Show("An error occured stopping the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); 364 Content.Log.LogException(t.Exception); 365 }, TaskContinuationOptions.OnlyOnFaulted); 352 HiveClient.StopJob(Content); 366 353 } 367 354 private void resetButton_Click(object sender, EventArgs e) { } 368 369 private void PauseJobAsync(object job) {370 IProgress prog = new Progress();371 prog.Status = "Pausing job...";372 SetProgressView(prog);373 HiveClient.PauseJob((RefreshableJob)job);374 FinishProgressView();375 }376 377 private void StopJobAsync(object job) {378 IProgress prog = new Progress();379 prog.Status = "Stopping job...";380 SetProgressView(prog);381 HiveClient.StopJob((RefreshableJob)job);382 FinishProgressView();383 }384 385 private void ResumeJobAsync(object job) {386 IProgress prog = new Progress();387 prog.Status = "Resuming job...";388 SetProgressView(prog);389 HiveClient.ResumeJob((RefreshableJob)job);390 FinishProgressView();391 }392 355 393 356 private void nameTextBox_Validated(object sender, EventArgs e) { … … 428 391 } 429 392 } 393 394 430 395 #endregion 431 396 … … 435 400 startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false; 436 401 } else { 437 startButton.Enabled = Content.IsControllable && Content.HiveTasks != null && Content.HiveTasks.Count > 0 && (Content.ExecutionState == ExecutionState.Prepared || Content.ExecutionState == ExecutionState.Paused);402 startButton.Enabled = Content.IsControllable && Content.HiveTasks != null && Content.HiveTasks.Count > 0 && Content.ExecutionState == ExecutionState.Prepared; 438 403 pauseButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started; 439 404 stopButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started; … … 457 422 458 423 private void SetProgressView() { 459 if (InvokeRequired) { 460 Invoke(new Action(SetProgressView)); 461 } else { 462 if (progressView == null) { 463 progressView = new ProgressView(this, Content.Progress); 464 } else { 465 progressView.Progress = Content.Progress; 466 } 467 } 468 } 469 470 private void SetProgressView(IProgress progress) { 471 if (InvokeRequired) { 472 Invoke(new Action<IProgress>(SetProgressView), progress); 473 } else { 474 if (progressView == null) { 475 progressView = new ProgressView(this, progress); 476 } else { 477 progressView.Progress = progress; 478 } 479 } 424 if (progressView == null) { 425 progressView = new ProgressView(this, Content.Progress); 426 } 427 progressView.Progress = Content.Progress; 480 428 } 481 429 482 430 private void FinishProgressView() { 483 if (InvokeRequired) { 484 Invoke(new Action(FinishProgressView)); 485 } else { 486 if (progressView != null) { 487 progressView.Finish(); 488 progressView = null; 489 SetEnabledStateOfControls(); 490 } 431 if (progressView != null) { 432 progressView.Finish(); 433 progressView = null; 434 SetEnabledStateOfControls(); 491 435 } 492 436 } … … 533 477 if (tabControl.SelectedTab == permissionTabPage) { 534 478 if (!Content.IsSharable) { 535 MessageBox.Show("Unable to load permissions. You have insufficient access privileges.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Information);479 MessageBox.Show("Unable to load tab. You have insufficient access privileges."); 536 480 tabControl.SelectedTab = tasksTabPage; 537 481 }
Note: See TracChangeset
for help on using the changeset viewer.