Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/21/18 16:00:50 (6 years ago)
Author:
jkarder
Message:

#2839:

  • fixed compilation errors in HiveEngine
  • minor changes
Location:
addons/HeuristicLab.MetaOptimization/HeuristicLab.HiveEngine.Views/3.3
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • addons/HeuristicLab.MetaOptimization/HeuristicLab.HiveEngine.Views/3.3/HeuristicLab.HiveEngine.Views-3.3.csproj

    r15741 r16173  
    125125      <Private>False</Private>
    126126    </Reference>
     127    <Reference Include="HeuristicLab.Common.Resources-3.3">
     128      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     129      <Private>False</Private>
     130    </Reference>
    127131    <Reference Include="HeuristicLab.Core-3.3">
    128132      <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath>
     
    173177    </ProjectReference>
    174178  </ItemGroup>
    175   <ItemGroup>
    176     <EmbeddedResource Include="HiveEngineView.resx">
    177       <DependentUpon>HiveEngineView.cs</DependentUpon>
    178     </EmbeddedResource>
    179   </ItemGroup>
    180179  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    181180  <PropertyGroup>
  • addons/HeuristicLab.MetaOptimization/HeuristicLab.HiveEngine.Views/3.3/HiveEngineView.Designer.cs

    r12930 r16173  
    2525    /// </summary>
    2626    private void InitializeComponent() {
    27       this.resourceIdsLabel = new System.Windows.Forms.Label();
    28       this.resourceIdsTextBox = new System.Windows.Forms.TextBox();
     27      this.projectLabel = new System.Windows.Forms.Label();
     28      this.projectNameTextBox = new System.Windows.Forms.TextBox();
    2929      this.priorityLabel = new System.Windows.Forms.Label();
    30       this.priorityTextBox = new System.Windows.Forms.TextBox();
    3130      this.label1 = new System.Windows.Forms.Label();
    3231      this.executionTimeOnHiveTextBox = new System.Windows.Forms.TextBox();
     
    3837      this.executionTimeLabel = new System.Windows.Forms.Label();
    3938      this.executionTimeTextBox = new System.Windows.Forms.TextBox();
     39      this.priorityComboBox = new System.Windows.Forms.ComboBox();
     40      this.searchButton = new System.Windows.Forms.Button();
    4041      this.tabControl.SuspendLayout();
    4142      this.jobsTabPage.SuspendLayout();
     
    4344      this.SuspendLayout();
    4445      //
    45       // resourceIdsLabel
    46       //
    47       this.resourceIdsLabel.AutoSize = true;
    48       this.resourceIdsLabel.Location = new System.Drawing.Point(113, 55);
    49       this.resourceIdsLabel.Name = "resourceIdsLabel";
    50       this.resourceIdsLabel.Size = new System.Drawing.Size(70, 13);
    51       this.resourceIdsLabel.TabIndex = 3;
    52       this.resourceIdsLabel.Text = "ResourceIds:";
    53       //
    54       // resourceIdsTextBox
    55       //
    56       this.resourceIdsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    57             | System.Windows.Forms.AnchorStyles.Left)
    58             | System.Windows.Forms.AnchorStyles.Right)));
    59       this.resourceIdsTextBox.Location = new System.Drawing.Point(189, 52);
    60       this.resourceIdsTextBox.Name = "resourceIdsTextBox";
    61       this.resourceIdsTextBox.Size = new System.Drawing.Size(517, 20);
    62       this.resourceIdsTextBox.TabIndex = 4;
    63       this.resourceIdsTextBox.Text = "HEAL";
    64       this.resourceIdsTextBox.Validated += new System.EventHandler(this.resourceIdsTextBox_Validated);
     46      // projectLabel
     47      //
     48      this.projectLabel.AutoSize = true;
     49      this.projectLabel.Location = new System.Drawing.Point(3, 55);
     50      this.projectLabel.Name = "projectLabel";
     51      this.projectLabel.Size = new System.Drawing.Size(43, 13);
     52      this.projectLabel.TabIndex = 3;
     53      this.projectLabel.Text = "Project:";
     54      //
     55      // projectNameTextBox
     56      //
     57      this.projectNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     58            | System.Windows.Forms.AnchorStyles.Left)
     59            | System.Windows.Forms.AnchorStyles.Right)));
     60      this.projectNameTextBox.Location = new System.Drawing.Point(162, 52);
     61      this.projectNameTextBox.Name = "projectNameTextBox";
     62      this.projectNameTextBox.ReadOnly = true;
     63      this.projectNameTextBox.Size = new System.Drawing.Size(544, 20);
     64      this.projectNameTextBox.TabIndex = 4;
    6565      //
    6666      // priorityLabel
    6767      //
    6868      this.priorityLabel.AutoSize = true;
    69       this.priorityLabel.Location = new System.Drawing.Point(3, 55);
     69      this.priorityLabel.Location = new System.Drawing.Point(3, 81);
    7070      this.priorityLabel.Name = "priorityLabel";
    7171      this.priorityLabel.Size = new System.Drawing.Size(41, 13);
    7272      this.priorityLabel.TabIndex = 5;
    7373      this.priorityLabel.Text = "Priority:";
    74       //
    75       // priorityTextBox
    76       //
    77       this.priorityTextBox.Location = new System.Drawing.Point(50, 52);
    78       this.priorityTextBox.Name = "priorityTextBox";
    79       this.priorityTextBox.Size = new System.Drawing.Size(57, 20);
    80       this.priorityTextBox.TabIndex = 6;
    81       this.priorityTextBox.Text = "0";
    82       this.priorityTextBox.Validated += new System.EventHandler(this.priorityTextBox_Validated);
    8374      //
    8475      // label1
     
    9687            | System.Windows.Forms.AnchorStyles.Left)
    9788            | System.Windows.Forms.AnchorStyles.Right)));
    98       this.executionTimeOnHiveTextBox.Location = new System.Drawing.Point(129, 26);
     89      this.executionTimeOnHiveTextBox.Location = new System.Drawing.Point(132, 26);
    9990      this.executionTimeOnHiveTextBox.Name = "executionTimeOnHiveTextBox";
    10091      this.executionTimeOnHiveTextBox.ReadOnly = true;
    101       this.executionTimeOnHiveTextBox.Size = new System.Drawing.Size(577, 20);
     92      this.executionTimeOnHiveTextBox.Size = new System.Drawing.Size(574, 20);
    10293      this.executionTimeOnHiveTextBox.TabIndex = 8;
    10394      //
     
    109100      this.tabControl.Controls.Add(this.jobsTabPage);
    110101      this.tabControl.Controls.Add(this.logTabPage);
    111       this.tabControl.Location = new System.Drawing.Point(3, 78);
     102      this.tabControl.Location = new System.Drawing.Point(3, 105);
    112103      this.tabControl.Name = "tabControl";
    113104      this.tabControl.SelectedIndex = 0;
    114       this.tabControl.Size = new System.Drawing.Size(700, 460);
     105      this.tabControl.Size = new System.Drawing.Size(700, 433);
    115106      this.tabControl.TabIndex = 9;
    116107      //
     
    121112      this.jobsTabPage.Name = "jobsTabPage";
    122113      this.jobsTabPage.Padding = new System.Windows.Forms.Padding(3);
    123       this.jobsTabPage.Size = new System.Drawing.Size(692, 434);
     114      this.jobsTabPage.Size = new System.Drawing.Size(692, 407);
    124115      this.jobsTabPage.TabIndex = 0;
    125116      this.jobsTabPage.Text = "Jobs";
     
    135126      this.hiveExperimentListView.ReadOnly = false;
    136127      this.hiveExperimentListView.ShowDetails = true;
    137       this.hiveExperimentListView.Size = new System.Drawing.Size(686, 428);
     128      this.hiveExperimentListView.Size = new System.Drawing.Size(686, 401);
    138129      this.hiveExperimentListView.TabIndex = 0;
    139130      //
     
    144135      this.logTabPage.Name = "logTabPage";
    145136      this.logTabPage.Padding = new System.Windows.Forms.Padding(3);
    146       this.logTabPage.Size = new System.Drawing.Size(692, 434);
     137      this.logTabPage.Size = new System.Drawing.Size(692, 410);
    147138      this.logTabPage.TabIndex = 1;
    148139      this.logTabPage.Text = "Log";
     
    157148      this.logView.Name = "logView";
    158149      this.logView.ReadOnly = false;
    159       this.logView.Size = new System.Drawing.Size(686, 428);
     150      this.logView.Size = new System.Drawing.Size(686, 404);
    160151      this.logView.TabIndex = 0;
    161152      //
     
    163154      //
    164155      this.executionTimeLabel.AutoSize = true;
    165       this.executionTimeLabel.Location = new System.Drawing.Point(4, 6);
     156      this.executionTimeLabel.Location = new System.Drawing.Point(3, 6);
    166157      this.executionTimeLabel.Name = "executionTimeLabel";
    167158      this.executionTimeLabel.Size = new System.Drawing.Size(83, 13);
     
    174165            | System.Windows.Forms.AnchorStyles.Left)
    175166            | System.Windows.Forms.AnchorStyles.Right)));
    176       this.executionTimeTextBox.Location = new System.Drawing.Point(129, 3);
     167      this.executionTimeTextBox.Location = new System.Drawing.Point(132, 3);
    177168      this.executionTimeTextBox.Name = "executionTimeTextBox";
    178169      this.executionTimeTextBox.ReadOnly = true;
    179       this.executionTimeTextBox.Size = new System.Drawing.Size(577, 20);
     170      this.executionTimeTextBox.Size = new System.Drawing.Size(574, 20);
    180171      this.executionTimeTextBox.TabIndex = 11;
     172      //
     173      // priorityComboBox
     174      //
     175      this.priorityComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     176            | System.Windows.Forms.AnchorStyles.Right)));
     177      this.priorityComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     178      this.priorityComboBox.FormattingEnabled = true;
     179      this.priorityComboBox.Items.AddRange(new object[] {
     180            "Low",
     181            "Normal",
     182            "Urgent",
     183            "Critical"});
     184      this.priorityComboBox.Location = new System.Drawing.Point(132, 78);
     185      this.priorityComboBox.Name = "priorityComboBox";
     186      this.priorityComboBox.Size = new System.Drawing.Size(574, 21);
     187      this.priorityComboBox.TabIndex = 44;
     188      this.priorityComboBox.SelectedIndexChanged += new System.EventHandler(this.priorityComboBox_SelectedIndexChanged);
     189      //
     190      // searchButton
     191      //
     192      this.searchButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Zoom;
     193      this.searchButton.Location = new System.Drawing.Point(132, 49);
     194      this.searchButton.Name = "searchButton";
     195      this.searchButton.Size = new System.Drawing.Size(24, 24);
     196      this.searchButton.TabIndex = 45;
     197      this.searchButton.UseVisualStyleBackColor = true;
     198      this.searchButton.Click += new System.EventHandler(this.searchButton_Click);
    181199      //
    182200      // HiveEngineView
     
    184202      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    185203      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     204      this.Controls.Add(this.searchButton);
     205      this.Controls.Add(this.priorityComboBox);
    186206      this.Controls.Add(this.executionTimeTextBox);
    187207      this.Controls.Add(this.executionTimeLabel);
     
    189209      this.Controls.Add(this.label1);
    190210      this.Controls.Add(this.executionTimeOnHiveTextBox);
    191       this.Controls.Add(this.priorityTextBox);
    192211      this.Controls.Add(this.priorityLabel);
    193       this.Controls.Add(this.resourceIdsLabel);
    194       this.Controls.Add(this.resourceIdsTextBox);
     212      this.Controls.Add(this.projectLabel);
     213      this.Controls.Add(this.projectNameTextBox);
    195214      this.Name = "HiveEngineView";
    196215      this.Size = new System.Drawing.Size(706, 541);
     
    205224    #endregion
    206225
    207     private System.Windows.Forms.Label resourceIdsLabel;
    208     private System.Windows.Forms.TextBox resourceIdsTextBox;
     226    private System.Windows.Forms.Label projectLabel;
     227    private System.Windows.Forms.TextBox projectNameTextBox;
    209228    private System.Windows.Forms.Label priorityLabel;
    210     private System.Windows.Forms.TextBox priorityTextBox;
    211229    private System.Windows.Forms.Label label1;
    212230    private System.Windows.Forms.TextBox executionTimeOnHiveTextBox;
     
    218236    private HeuristicLab.Core.Views.LogView logView;
    219237    private RefreshableHiveJobListView hiveExperimentListView;
     238    protected System.Windows.Forms.ComboBox priorityComboBox;
     239    private System.Windows.Forms.Button searchButton;
    220240  }
    221241}
  • addons/HeuristicLab.MetaOptimization/HeuristicLab.HiveEngine.Views/3.3/HiveEngineView.cs

    r12930 r16173  
    2121
    2222using System;
     23using System.Collections.Generic;
     24using System.Linq;
     25using System.Windows.Forms;
     26using HeuristicLab.Clients.Hive;
     27using HeuristicLab.Clients.Hive.JobManager.Views;
    2328using HeuristicLab.Core.Views;
    2429using HeuristicLab.MainForm;
     
    2833  [Content(typeof(HiveEngine), IsDefaultView = true)]
    2934  public sealed partial class HiveEngineView : ItemView {
     35    private readonly HiveResourceSelectorDialog hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Guid.Empty, Guid.Empty);
     36
    3037    public new HiveEngine Content {
    3138      get { return (HiveEngine)base.Content; }
     
    7077      base.OnContentChanged();
    7178      if (Content == null) {
    72         resourceIdsTextBox.Text = string.Empty;
    73         priorityTextBox.Text = string.Empty;
     79        projectNameTextBox.Text = string.Empty;
     80        priorityComboBox.SelectedIndex = 1;
    7481        executionTimeOnHiveTextBox.Text = string.Empty;
    7582        hiveExperimentListView.Content = null;
    7683        logView.Content = null;
    7784      } else {
    78         resourceIdsTextBox.Text = Content.ResourceNames;
    79         priorityTextBox.Text = Content.Priority.ToString();
     85        if (Content.ProjectId != null && Content.ProjectId != Guid.Empty) {
     86          var project = HiveServiceLocator.Instance.CallHiveService(s => s.GetProject(Content.ProjectId));
     87          if (project != null) projectNameTextBox.Text = project.Name;
     88        } else {
     89          projectNameTextBox.Text = string.Empty;
     90        }
     91
     92        if (Content.Priority >= 0 && Content.Priority < priorityComboBox.Items.Count) {
     93          priorityComboBox.SelectedIndex = Content.Priority;
     94        } else {
     95          priorityComboBox.SelectedIndex = 1;
     96        }
     97
    8098        executionTimeOnHiveTextBox.Text = Content.ExecutionTimeOnHive.ToString();
    8199        hiveExperimentListView.Content = Content.Jobs;
     
    86104    protected override void SetEnabledStateOfControls() {
    87105      base.SetEnabledStateOfControls();
    88       // Enable or disable controls based on whether the content is null or the view is set readonly
    89       if (Content != null) {
    90         resourceIdsTextBox.ReadOnly = this.ReadOnly;
    91         priorityTextBox.ReadOnly = this.ReadOnly;
    92       } else {
    93         resourceIdsTextBox.ReadOnly = false;
    94         priorityTextBox.ReadOnly = false;
     106
     107      searchButton.Enabled = Content != null && !ReadOnly && !Locked;
     108      projectNameTextBox.Enabled = Content != null && !ReadOnly && !Locked;
     109      priorityComboBox.Enabled = Content != null && !ReadOnly && !Locked;
     110    }
     111
     112    private void searchButton_Click(object sender, EventArgs e) {
     113      hiveResourceSelectorDialog.SelectedProjectId = Content != null ? Content.ProjectId : Guid.Empty;
     114      hiveResourceSelectorDialog.SelectedResourceIds = Content != null ? Content.ResourceIds : new List<Guid>();
     115
     116      var result = hiveResourceSelectorDialog.ShowDialog(this);
     117      if (result == DialogResult.OK) {
     118        var selectedProject = hiveResourceSelectorDialog.SelectedProject;
     119        if (selectedProject != null) {
     120          projectNameTextBox.Text = selectedProject.Name;
     121          Content.ProjectId = selectedProject.Id;
     122          Content.ResourceIds = hiveResourceSelectorDialog.SelectedResources.Select(x => x.Id).ToList();
     123        } else {
     124          projectNameTextBox.Text = string.Empty;
     125          Content.ProjectId = Guid.Empty;
     126          Content.ResourceIds = new List<Guid>();
     127        }
    95128      }
    96129    }
    97130
    98     #region Event Handlers (child controls)
    99     private void resourceIdsTextBox_Validated(object sender, EventArgs e) {
    100       Content.ResourceNames = resourceIdsTextBox.Text;
     131    private void priorityComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     132      if (Content != null && Content.Priority != priorityComboBox.SelectedIndex) {
     133        Content.Priority = priorityComboBox.SelectedIndex;
     134      }
    101135    }
    102 
    103     private void priorityTextBox_Validated(object sender, EventArgs e) {
    104       Content.Priority = int.Parse(priorityTextBox.Text);
    105     }
    106     #endregion
    107136  }
    108137}
Note: See TracChangeset for help on using the changeset viewer.