- Timestamp:
- 01/17/16 20:06:18 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBProblemView.Designer.cs
r12012 r13534 49 49 this.refreshButton = new System.Windows.Forms.Button(); 50 50 this.cloneProblemButton = new System.Windows.Forms.Button(); 51 this.tabControl = new System.Windows.Forms.TabControl(); 52 this.parametersTabPage = new System.Windows.Forms.TabPage(); 53 this.characteristicsTabPage = new System.Windows.Forms.TabPage(); 51 54 this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView(); 55 this.downloadCharacteristicsButton = new System.Windows.Forms.Button(); 56 this.uploadCharacteristicsButton = new System.Windows.Forms.Button(); 57 this.characteristicsMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView(); 52 58 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 59 this.tabControl.SuspendLayout(); 60 this.parametersTabPage.SuspendLayout(); 61 this.characteristicsTabPage.SuspendLayout(); 53 62 this.SuspendLayout(); 54 63 // … … 74 83 // 75 84 this.problemComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 76 85 | System.Windows.Forms.AnchorStyles.Right))); 77 86 this.problemComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 78 87 this.problemComboBox.FormattingEnabled = true; … … 116 125 this.cloneProblemButton.Click += new System.EventHandler(this.cloneProblemButton_Click); 117 126 // 127 // tabControl 128 // 129 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 130 | System.Windows.Forms.AnchorStyles.Left) 131 | System.Windows.Forms.AnchorStyles.Right))); 132 this.tabControl.Controls.Add(this.parametersTabPage); 133 this.tabControl.Controls.Add(this.characteristicsTabPage); 134 this.tabControl.Location = new System.Drawing.Point(6, 53); 135 this.tabControl.Name = "tabControl"; 136 this.tabControl.SelectedIndex = 0; 137 this.tabControl.Size = new System.Drawing.Size(700, 340); 138 this.tabControl.TabIndex = 8; 139 // 140 // parametersTabPage 141 // 142 this.parametersTabPage.Controls.Add(this.parameterCollectionView); 143 this.parametersTabPage.Location = new System.Drawing.Point(4, 22); 144 this.parametersTabPage.Name = "parametersTabPage"; 145 this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3); 146 this.parametersTabPage.Size = new System.Drawing.Size(692, 314); 147 this.parametersTabPage.TabIndex = 0; 148 this.parametersTabPage.Text = "Parameters"; 149 this.parametersTabPage.UseVisualStyleBackColor = true; 150 // 151 // characteristicsTabPage 152 // 153 this.characteristicsTabPage.Controls.Add(this.characteristicsMatrixView); 154 this.characteristicsTabPage.Controls.Add(this.uploadCharacteristicsButton); 155 this.characteristicsTabPage.Controls.Add(this.downloadCharacteristicsButton); 156 this.characteristicsTabPage.Location = new System.Drawing.Point(4, 22); 157 this.characteristicsTabPage.Name = "characteristicsTabPage"; 158 this.characteristicsTabPage.Padding = new System.Windows.Forms.Padding(3); 159 this.characteristicsTabPage.Size = new System.Drawing.Size(692, 314); 160 this.characteristicsTabPage.TabIndex = 1; 161 this.characteristicsTabPage.Text = "Characteristics"; 162 this.characteristicsTabPage.UseVisualStyleBackColor = true; 163 // 118 164 // parameterCollectionView 119 165 // 120 166 this.parameterCollectionView.AllowEditingOfHiddenParameters = false; 121 this.parameterCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)122 | System.Windows.Forms.AnchorStyles.Left)123 | System.Windows.Forms.AnchorStyles.Right)));124 167 this.parameterCollectionView.Caption = "ParameterCollection View"; 125 168 this.parameterCollectionView.Content = null; 126 this.parameterCollectionView.Location = new System.Drawing.Point(0, 53); 169 this.parameterCollectionView.Dock = System.Windows.Forms.DockStyle.Fill; 170 this.parameterCollectionView.Location = new System.Drawing.Point(3, 3); 127 171 this.parameterCollectionView.Name = "parameterCollectionView"; 128 this.parameterCollectionView.ReadOnly = false; 129 this.parameterCollectionView.Size = new System.Drawing.Size(706, 340); 130 this.parameterCollectionView.TabIndex = 7; 172 this.parameterCollectionView.ReadOnly = true; 173 this.parameterCollectionView.ShowDetails = true; 174 this.parameterCollectionView.Size = new System.Drawing.Size(686, 308); 175 this.parameterCollectionView.TabIndex = 8; 176 // 177 // downloadCharacteristicsButton 178 // 179 this.downloadCharacteristicsButton.Location = new System.Drawing.Point(6, 6); 180 this.downloadCharacteristicsButton.Name = "downloadCharacteristicsButton"; 181 this.downloadCharacteristicsButton.Size = new System.Drawing.Size(26, 23); 182 this.downloadCharacteristicsButton.TabIndex = 0; 183 this.downloadCharacteristicsButton.Text = "Download"; 184 this.downloadCharacteristicsButton.UseVisualStyleBackColor = true; 185 this.downloadCharacteristicsButton.Click += new System.EventHandler(this.downloadCharacteristicsButton_Click); 186 // 187 // uploadCharacteristicsButton 188 // 189 this.uploadCharacteristicsButton.Location = new System.Drawing.Point(38, 6); 190 this.uploadCharacteristicsButton.Name = "uploadCharacteristicsButton"; 191 this.uploadCharacteristicsButton.Size = new System.Drawing.Size(26, 23); 192 this.uploadCharacteristicsButton.TabIndex = 0; 193 this.uploadCharacteristicsButton.Text = "Upload"; 194 this.uploadCharacteristicsButton.UseVisualStyleBackColor = true; 195 this.uploadCharacteristicsButton.Click += new System.EventHandler(this.uploadCharacteristicsButton_Click); 196 // 197 // characteristicsMatrixView 198 // 199 this.characteristicsMatrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 200 | System.Windows.Forms.AnchorStyles.Left) 201 | System.Windows.Forms.AnchorStyles.Right))); 202 this.characteristicsMatrixView.Caption = "StringConvertibleMatrix View"; 203 this.characteristicsMatrixView.Content = null; 204 this.characteristicsMatrixView.Location = new System.Drawing.Point(6, 35); 205 this.characteristicsMatrixView.Name = "characteristicsMatrixView"; 206 this.characteristicsMatrixView.ReadOnly = false; 207 this.characteristicsMatrixView.ShowRowsAndColumnsTextBox = false; 208 this.characteristicsMatrixView.ShowStatisticalInformation = false; 209 this.characteristicsMatrixView.Size = new System.Drawing.Size(680, 273); 210 this.characteristicsMatrixView.TabIndex = 1; 131 211 // 132 212 // OKBProblemView … … 134 214 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 135 215 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 216 this.Controls.Add(this.tabControl); 136 217 this.Controls.Add(this.problemComboBox); 137 this.Controls.Add(this.parameterCollectionView);138 218 this.Controls.Add(this.problemLabel); 139 219 this.Controls.Add(this.cloneProblemButton); … … 144 224 this.Controls.SetChildIndex(this.cloneProblemButton, 0); 145 225 this.Controls.SetChildIndex(this.problemLabel, 0); 146 this.Controls.SetChildIndex(this.parameterCollectionView, 0); 226 this.Controls.SetChildIndex(this.problemComboBox, 0); 227 this.Controls.SetChildIndex(this.tabControl, 0); 147 228 this.Controls.SetChildIndex(this.nameTextBox, 0); 148 229 this.Controls.SetChildIndex(this.nameLabel, 0); 149 230 this.Controls.SetChildIndex(this.infoLabel, 0); 150 this.Controls.SetChildIndex(this.problemComboBox, 0);151 231 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 232 this.tabControl.ResumeLayout(false); 233 this.parametersTabPage.ResumeLayout(false); 234 this.characteristicsTabPage.ResumeLayout(false); 152 235 this.ResumeLayout(false); 153 236 this.PerformLayout(); … … 161 244 private System.Windows.Forms.Button refreshButton; 162 245 private System.Windows.Forms.Button cloneProblemButton; 163 private HeuristicLab.Core.Views.ParameterCollectionView parameterCollectionView; 246 private System.Windows.Forms.TabControl tabControl; 247 private System.Windows.Forms.TabPage parametersTabPage; 248 private System.Windows.Forms.TabPage characteristicsTabPage; 249 private Core.Views.ParameterCollectionView parameterCollectionView; 250 private Data.Views.StringConvertibleMatrixView characteristicsMatrixView; 251 private System.Windows.Forms.Button uploadCharacteristicsButton; 252 private System.Windows.Forms.Button downloadCharacteristicsButton; 164 253 165 254 -
trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBProblemView.cs
r12012 r13534 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using System.Windows.Forms; 26 using HeuristicLab.Common.Resources; 25 27 using HeuristicLab.Core.Views; 28 using HeuristicLab.Data; 26 29 using HeuristicLab.MainForm; 27 30 … … 38 41 public OKBProblemView() { 39 42 InitializeComponent(); 43 downloadCharacteristicsButton.Text = string.Empty; 44 downloadCharacteristicsButton.Image = VSImageLibrary.Refresh; 45 uploadCharacteristicsButton.Text = string.Empty; 46 uploadCharacteristicsButton.Image = VSImageLibrary.PublishToWeb; 40 47 } 41 48 … … 73 80 refreshButton.Enabled = (Content != null) && !ReadOnly && !Locked; 74 81 parameterCollectionView.Enabled = Content != null; 82 characteristicsMatrixView.Enabled = Content != null; 83 downloadCharacteristicsButton.Enabled = Content != null && Content.ProblemId != -1 && !Locked; 84 uploadCharacteristicsButton.Enabled = Content != null && Content.ProblemId != -1 && !Locked && !ReadOnly 85 && characteristicsMatrixView.Content != null && characteristicsMatrixView.Content.Rows > 0; 75 86 } 76 87 … … 103 114 if (InvokeRequired) 104 115 Invoke(new EventHandler(Content_ProblemChanged), sender, e); 105 else 116 else { 106 117 OnContentChanged(); 118 SetEnabledStateOfControls(); 119 } 107 120 } 108 121 #endregion … … 123 136 } 124 137 } 138 private void downloadCharacteristicsButton_Click(object sender, EventArgs e) { 139 var values = RunCreationClient.GetCharacteristicValues(Content.ProblemId).ToList(); 140 var content = new StringMatrix(values.Count, 3); 141 for (var i = 0; i < values.Count; i++) { 142 content[i, 0] = values[i].Name; 143 content[i, 1] = values[i].ToString(); 144 content[i, 2] = values[i].GetType().Name; 145 } 146 characteristicsMatrixView.Content = content; 147 SetEnabledStateOfControls(); 148 } 149 private void uploadCharacteristicsButton_Click(object sender, EventArgs e) { 150 var matrix = characteristicsMatrixView.Content as StringMatrix; 151 if (matrix == null) return; 152 var values = new List<Value>(matrix.Rows); 153 for (var i = 0; i < matrix.Rows; i++) { 154 var name = matrix[i, 0]; 155 var strValue = matrix[i, 1]; 156 var type = matrix[i, 2]; 157 values.Add(Value.Create(name, strValue, type)); 158 } 159 try { 160 RunCreationClient.SetCharacteristicValues(Content.ProblemId, values); 161 } catch (Exception ex) { PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex); } 162 } 125 163 #endregion 126 164
Note: See TracChangeset
for help on using the changeset viewer.