- Timestamp:
- 09/21/18 16:00:50 (6 years ago)
- 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 125 125 <Private>False</Private> 126 126 </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> 127 131 <Reference Include="HeuristicLab.Core-3.3"> 128 132 <HintPath>..\..\..\..\trunk\bin\HeuristicLab.Core-3.3.dll</HintPath> … … 173 177 </ProjectReference> 174 178 </ItemGroup> 175 <ItemGroup>176 <EmbeddedResource Include="HiveEngineView.resx">177 <DependentUpon>HiveEngineView.cs</DependentUpon>178 </EmbeddedResource>179 </ItemGroup>180 179 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 181 180 <PropertyGroup> -
addons/HeuristicLab.MetaOptimization/HeuristicLab.HiveEngine.Views/3.3/HiveEngineView.Designer.cs
r12930 r16173 25 25 /// </summary> 26 26 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(); 29 29 this.priorityLabel = new System.Windows.Forms.Label(); 30 this.priorityTextBox = new System.Windows.Forms.TextBox();31 30 this.label1 = new System.Windows.Forms.Label(); 32 31 this.executionTimeOnHiveTextBox = new System.Windows.Forms.TextBox(); … … 38 37 this.executionTimeLabel = new System.Windows.Forms.Label(); 39 38 this.executionTimeTextBox = new System.Windows.Forms.TextBox(); 39 this.priorityComboBox = new System.Windows.Forms.ComboBox(); 40 this.searchButton = new System.Windows.Forms.Button(); 40 41 this.tabControl.SuspendLayout(); 41 42 this.jobsTabPage.SuspendLayout(); … … 43 44 this.SuspendLayout(); 44 45 // 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; 65 65 // 66 66 // priorityLabel 67 67 // 68 68 this.priorityLabel.AutoSize = true; 69 this.priorityLabel.Location = new System.Drawing.Point(3, 55);69 this.priorityLabel.Location = new System.Drawing.Point(3, 81); 70 70 this.priorityLabel.Name = "priorityLabel"; 71 71 this.priorityLabel.Size = new System.Drawing.Size(41, 13); 72 72 this.priorityLabel.TabIndex = 5; 73 73 this.priorityLabel.Text = "Priority:"; 74 //75 // priorityTextBox76 //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);83 74 // 84 75 // label1 … … 96 87 | System.Windows.Forms.AnchorStyles.Left) 97 88 | System.Windows.Forms.AnchorStyles.Right))); 98 this.executionTimeOnHiveTextBox.Location = new System.Drawing.Point(1 29, 26);89 this.executionTimeOnHiveTextBox.Location = new System.Drawing.Point(132, 26); 99 90 this.executionTimeOnHiveTextBox.Name = "executionTimeOnHiveTextBox"; 100 91 this.executionTimeOnHiveTextBox.ReadOnly = true; 101 this.executionTimeOnHiveTextBox.Size = new System.Drawing.Size(57 7, 20);92 this.executionTimeOnHiveTextBox.Size = new System.Drawing.Size(574, 20); 102 93 this.executionTimeOnHiveTextBox.TabIndex = 8; 103 94 // … … 109 100 this.tabControl.Controls.Add(this.jobsTabPage); 110 101 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); 112 103 this.tabControl.Name = "tabControl"; 113 104 this.tabControl.SelectedIndex = 0; 114 this.tabControl.Size = new System.Drawing.Size(700, 4 60);105 this.tabControl.Size = new System.Drawing.Size(700, 433); 115 106 this.tabControl.TabIndex = 9; 116 107 // … … 121 112 this.jobsTabPage.Name = "jobsTabPage"; 122 113 this.jobsTabPage.Padding = new System.Windows.Forms.Padding(3); 123 this.jobsTabPage.Size = new System.Drawing.Size(692, 4 34);114 this.jobsTabPage.Size = new System.Drawing.Size(692, 407); 124 115 this.jobsTabPage.TabIndex = 0; 125 116 this.jobsTabPage.Text = "Jobs"; … … 135 126 this.hiveExperimentListView.ReadOnly = false; 136 127 this.hiveExperimentListView.ShowDetails = true; 137 this.hiveExperimentListView.Size = new System.Drawing.Size(686, 4 28);128 this.hiveExperimentListView.Size = new System.Drawing.Size(686, 401); 138 129 this.hiveExperimentListView.TabIndex = 0; 139 130 // … … 144 135 this.logTabPage.Name = "logTabPage"; 145 136 this.logTabPage.Padding = new System.Windows.Forms.Padding(3); 146 this.logTabPage.Size = new System.Drawing.Size(692, 4 34);137 this.logTabPage.Size = new System.Drawing.Size(692, 410); 147 138 this.logTabPage.TabIndex = 1; 148 139 this.logTabPage.Text = "Log"; … … 157 148 this.logView.Name = "logView"; 158 149 this.logView.ReadOnly = false; 159 this.logView.Size = new System.Drawing.Size(686, 4 28);150 this.logView.Size = new System.Drawing.Size(686, 404); 160 151 this.logView.TabIndex = 0; 161 152 // … … 163 154 // 164 155 this.executionTimeLabel.AutoSize = true; 165 this.executionTimeLabel.Location = new System.Drawing.Point( 4, 6);156 this.executionTimeLabel.Location = new System.Drawing.Point(3, 6); 166 157 this.executionTimeLabel.Name = "executionTimeLabel"; 167 158 this.executionTimeLabel.Size = new System.Drawing.Size(83, 13); … … 174 165 | System.Windows.Forms.AnchorStyles.Left) 175 166 | System.Windows.Forms.AnchorStyles.Right))); 176 this.executionTimeTextBox.Location = new System.Drawing.Point(1 29, 3);167 this.executionTimeTextBox.Location = new System.Drawing.Point(132, 3); 177 168 this.executionTimeTextBox.Name = "executionTimeTextBox"; 178 169 this.executionTimeTextBox.ReadOnly = true; 179 this.executionTimeTextBox.Size = new System.Drawing.Size(57 7, 20);170 this.executionTimeTextBox.Size = new System.Drawing.Size(574, 20); 180 171 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); 181 199 // 182 200 // HiveEngineView … … 184 202 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 185 203 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 204 this.Controls.Add(this.searchButton); 205 this.Controls.Add(this.priorityComboBox); 186 206 this.Controls.Add(this.executionTimeTextBox); 187 207 this.Controls.Add(this.executionTimeLabel); … … 189 209 this.Controls.Add(this.label1); 190 210 this.Controls.Add(this.executionTimeOnHiveTextBox); 191 this.Controls.Add(this.priorityTextBox);192 211 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); 195 214 this.Name = "HiveEngineView"; 196 215 this.Size = new System.Drawing.Size(706, 541); … … 205 224 #endregion 206 225 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; 209 228 private System.Windows.Forms.Label priorityLabel; 210 private System.Windows.Forms.TextBox priorityTextBox;211 229 private System.Windows.Forms.Label label1; 212 230 private System.Windows.Forms.TextBox executionTimeOnHiveTextBox; … … 218 236 private HeuristicLab.Core.Views.LogView logView; 219 237 private RefreshableHiveJobListView hiveExperimentListView; 238 protected System.Windows.Forms.ComboBox priorityComboBox; 239 private System.Windows.Forms.Button searchButton; 220 240 } 221 241 } -
addons/HeuristicLab.MetaOptimization/HeuristicLab.HiveEngine.Views/3.3/HiveEngineView.cs
r12930 r16173 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Windows.Forms; 26 using HeuristicLab.Clients.Hive; 27 using HeuristicLab.Clients.Hive.JobManager.Views; 23 28 using HeuristicLab.Core.Views; 24 29 using HeuristicLab.MainForm; … … 28 33 [Content(typeof(HiveEngine), IsDefaultView = true)] 29 34 public sealed partial class HiveEngineView : ItemView { 35 private readonly HiveResourceSelectorDialog hiveResourceSelectorDialog = new HiveResourceSelectorDialog(Guid.Empty, Guid.Empty); 36 30 37 public new HiveEngine Content { 31 38 get { return (HiveEngine)base.Content; } … … 70 77 base.OnContentChanged(); 71 78 if (Content == null) { 72 resourceIdsTextBox.Text = string.Empty;73 priority TextBox.Text = string.Empty;79 projectNameTextBox.Text = string.Empty; 80 priorityComboBox.SelectedIndex = 1; 74 81 executionTimeOnHiveTextBox.Text = string.Empty; 75 82 hiveExperimentListView.Content = null; 76 83 logView.Content = null; 77 84 } 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 80 98 executionTimeOnHiveTextBox.Text = Content.ExecutionTimeOnHive.ToString(); 81 99 hiveExperimentListView.Content = Content.Jobs; … … 86 104 protected override void SetEnabledStateOfControls() { 87 105 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 } 95 128 } 96 129 } 97 130 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 } 101 135 } 102 103 private void priorityTextBox_Validated(object sender, EventArgs e) {104 Content.Priority = int.Parse(priorityTextBox.Text);105 }106 #endregion107 136 } 108 137 }
Note: See TracChangeset
for help on using the changeset viewer.