Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/12 17:50:17 (13 years ago)
Author:
gkronber
Message:

#1081: merged r7266:7459 from the trunk into the time series prognosis branch.

Location:
branches/HeuristicLab.TimeSeries
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/JobManagerMenuItem.cs

    r7268 r7460  
    2121
    2222using System.Collections.Generic;
     23using System.Windows.Forms;
    2324using HeuristicLab.Clients.Hive;
    2425using HeuristicLab.MainForm;
     
    3839      get { return 10000; }
    3940    }
     41    public override Keys ShortCutKeys {
     42      get { return Keys.Control | Keys.H; }
     43    }
    4044  }
    4145}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs

    r7268 r7460  
    2525    private void InitializeComponent() {
    2626      this.components = new System.ComponentModel.Container();
    27       this.tabControl = new System.Windows.Forms.TabControl();
     27      this.tabControl = new HeuristicLab.MainForm.WindowsForms.DragOverTabControl();
    2828      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();
    3030      this.permissionTabPage = new System.Windows.Forms.TabPage();
    3131      this.refreshPermissionsButton = new System.Windows.Forms.Button();
    3232      this.hiveExperimentPermissionListView = new HeuristicLab.Clients.Hive.JobManager.Views.HiveJobPermissionListView();
    3333      this.runsTabPage = new System.Windows.Forms.TabPage();
    34       this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    3534      this.stateTabPage = new System.Windows.Forms.TabPage();
    3635      this.stateLogViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     
    5857      this.calculatingLabel = new System.Windows.Forms.Label();
    5958      this.jobsLabel = new System.Windows.Forms.Label();
     59      this.runCollectionViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    6060      this.tabControl.SuspendLayout();
    6161      this.tasksTabPage.SuspendLayout();
     
    106106      this.jobsTreeView.ReadOnly = false;
    107107      this.jobsTreeView.Size = new System.Drawing.Size(704, 420);
    108       this.jobsTreeView.TabIndex = 4;
     108      this.jobsTreeView.TabIndex = 0;
    109109      this.jobsTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.jobsTreeView_DragDrop);
    110110      this.jobsTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.jobsTreeView_DragEnter);
     
    124124      // refreshPermissionsButton
    125125      //
    126       this.refreshPermissionsButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;
     126      this.refreshPermissionsButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshPermissionsButton.Image")));
    127127      this.refreshPermissionsButton.Location = new System.Drawing.Point(3, 3);
    128128      this.refreshPermissionsButton.Name = "refreshPermissionsButton";
     
    158158      this.runsTabPage.Text = "Runs";
    159159      this.runsTabPage.UseVisualStyleBackColor = true;
    160       //
    161       // runCollectionViewHost
    162       //
    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;
    176160      //
    177161      // stateTabPage
     
    227211      //
    228212      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")));
    230214      this.startButton.Location = new System.Drawing.Point(0, 536);
    231215      this.startButton.Name = "startButton";
     
    239223      //
    240224      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")));
    242226      this.stopButton.Location = new System.Drawing.Point(60, 536);
    243227      this.stopButton.Name = "stopButton";
     
    252236      this.resetButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    253237      this.resetButton.Enabled = false;
    254       this.resetButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Restart;
     238      this.resetButton.Image = ((System.Drawing.Image)(resources.GetObject("resetButton.Image")));
    255239      this.resetButton.Location = new System.Drawing.Point(90, 536);
    256240      this.resetButton.Name = "resetButton";
     
    284268      this.pauseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
    285269      this.pauseButton.Enabled = false;
    286       this.pauseButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Pause;
     270      this.pauseButton.Image = ((System.Drawing.Image)(resources.GetObject("pauseButton.Image")));
    287271      this.pauseButton.Location = new System.Drawing.Point(30, 536);
    288272      this.pauseButton.Name = "pauseButton";
     
    309293      this.resourceNamesTextBox.Name = "resourceNamesTextBox";
    310294      this.resourceNamesTextBox.Size = new System.Drawing.Size(415, 20);
    311       this.resourceNamesTextBox.TabIndex = 2;
     295      this.resourceNamesTextBox.TabIndex = 14;
    312296      this.resourceNamesTextBox.Validated += new System.EventHandler(this.resourceNamesTextBox_Validated);
    313297      //
     
    328312      this.nameTextBox.Name = "nameTextBox";
    329313      this.nameTextBox.Size = new System.Drawing.Size(501, 20);
    330       this.nameTextBox.TabIndex = 1;
     314      this.nameTextBox.TabIndex = 21;
    331315      this.nameTextBox.Validated += new System.EventHandler(this.nameTextBox_Validated);
    332316      //
    333317      // refreshButton
    334318      //
    335       this.refreshButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Refresh;
     319      this.refreshButton.Image = ((System.Drawing.Image)(resources.GetObject("refreshButton.Image")));
    336320      this.refreshButton.Location = new System.Drawing.Point(3, 0);
    337321      this.refreshButton.Name = "refreshButton";
     
    349333      this.isPrivilegedCheckBox.Name = "isPrivilegedCheckBox";
    350334      this.isPrivilegedCheckBox.Size = new System.Drawing.Size(72, 17);
    351       this.isPrivilegedCheckBox.TabIndex = 3;
     335      this.isPrivilegedCheckBox.TabIndex = 26;
    352336      this.isPrivilegedCheckBox.Text = "Privileged";
    353337      this.toolTip.SetToolTip(this.isPrivilegedCheckBox, "If checked, the task will be executed in a privileged sandbox on the slave.");
     
    435419      this.jobsLabel.TabIndex = 0;
    436420      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;
    437437      //
    438438      // RefreshableHiveJobView
     
    483483    private Core.Views.LogView logView;
    484484    private System.Windows.Forms.TabPage tasksTabPage;
    485     private HeuristicLab.Clients.Hive.Views.HiveTaskItemTreeView jobsTreeView;
     485    private HeuristicLab.Clients.Hive.Views.ExperimentManager.HiveTaskItemTreeView jobsTreeView;
    486486    private System.Windows.Forms.Label nameLabel;
    487487    private System.Windows.Forms.TextBox nameTextBox;
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r7268 r7460  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2424using System.Linq;
    2525using System.Threading;
    26 using System.Threading.Tasks;
    2726using System.Windows.Forms;
    2827using HeuristicLab.Clients.Hive.Views;
     
    114113        logView.Content = null;
    115114        refreshAutomaticallyCheckBox.Checked = false;
    116         logView.Content = null;
    117115        runCollectionViewHost.Content = null;
    118116      } else {
     
    302300    }
    303301    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      }
    305310    }
    306311    private void Content_StateLogListChanged(object sender, EventArgs e) {
     
    318323      }
    319324    }
     325
    320326
    321327    private void UpdateStateLogList() {
     
    336342      if (nameTextBox.Text.Trim() == string.Empty) {
    337343        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);
    345344      } else {
    346345        HiveClient.StartJob((Exception ex) => ErrorHandling.ShowErrorDialog(this, "Start failed.", ex), Content, new CancellationToken());
    347346      }
    348347    }
    349 
    350348    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    }
    359351    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);
    366353    }
    367354    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     }
    392355
    393356    private void nameTextBox_Validated(object sender, EventArgs e) {
     
    428391      }
    429392    }
     393
     394
    430395    #endregion
    431396
     
    435400        startButton.Enabled = pauseButton.Enabled = stopButton.Enabled = resetButton.Enabled = false;
    436401      } 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;
    438403        pauseButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started;
    439404        stopButton.Enabled = Content.IsControllable && Content.ExecutionState == ExecutionState.Started;
     
    457422
    458423    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;
    480428    }
    481429
    482430    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();
    491435      }
    492436    }
     
    533477      if (tabControl.SelectedTab == permissionTabPage) {
    534478        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.");
    536480          tabControl.SelectedTab = tasksTabPage;
    537481        }
Note: See TracChangeset for help on using the changeset viewer.