- Timestamp:
- 12/16/15 17:04:35 (8 years ago)
- Location:
- branches/PerformanceComparison
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison
- Property svn:ignore
-
old new 2 2 *.suo 3 3 *.user 4 .git 5 .gitignore
-
- Property svn:ignore
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.Designer.cs
r12957 r13475 34 34 /// </summary> 35 35 private void InitializeComponent() { 36 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ExpertSystemView)); 36 37 this.evaluationsLimitabel = new System.Windows.Forms.Label(); 37 38 this.maxEvaluationsTextBox = new System.Windows.Forms.TextBox(); … … 50 51 this.algorithmInstancesViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 51 52 this.problemInstancesTabPage = new System.Windows.Forms.TabPage(); 52 this.problemInstancesView = new HeuristicLab.Optimization.Views.RunCollectionBubbleChartView(); 53 this.problemInstancesView = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 54 this.instancesDropPanel = new System.Windows.Forms.Panel(); 55 this.dragFLAHereLabel = new System.Windows.Forms.Label(); 56 this.refreshMapButton = new System.Windows.Forms.Button(); 53 57 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 58 this.okbDownloadButton = new System.Windows.Forms.Button(); 54 59 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 55 60 this.tabControl.SuspendLayout(); … … 59 64 this.okbTabPage.SuspendLayout(); 60 65 this.problemInstancesTabPage.SuspendLayout(); 66 this.instancesDropPanel.SuspendLayout(); 61 67 this.SuspendLayout(); 62 68 // … … 83 89 // maxEvaluationsTextBox 84 90 // 85 this.maxEvaluationsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 91 this.maxEvaluationsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 86 92 | System.Windows.Forms.AnchorStyles.Right))); 87 93 this.maxEvaluationsTextBox.Location = new System.Drawing.Point(75, 26); … … 94 100 // 95 101 this.tabControl.AllowDrop = true; 96 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 97 | System.Windows.Forms.AnchorStyles.Left) 102 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 103 | System.Windows.Forms.AnchorStyles.Left) 98 104 | System.Windows.Forms.AnchorStyles.Right))); 99 105 this.tabControl.Controls.Add(this.problemTabPage); … … 127 133 // problemViewHost 128 134 // 129 this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 130 | System.Windows.Forms.AnchorStyles.Left) 135 this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 136 | System.Windows.Forms.AnchorStyles.Left) 131 137 | System.Windows.Forms.AnchorStyles.Right))); 132 138 this.problemViewHost.Caption = "View"; … … 143 149 // openProblemButton 144 150 // 145 this.openProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Open;151 this.openProblemButton.Image = ((System.Drawing.Image)(resources.GetObject("openProblemButton.Image"))); 146 152 this.openProblemButton.Location = new System.Drawing.Point(36, 6); 147 153 this.openProblemButton.Name = "openProblemButton"; … … 154 160 // newProblemButton 155 161 // 156 this.newProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.NewDocument;162 this.newProblemButton.Image = ((System.Drawing.Image)(resources.GetObject("newProblemButton.Image"))); 157 163 this.newProblemButton.Location = new System.Drawing.Point(6, 6); 158 164 this.newProblemButton.Name = "newProblemButton"; … … 178 184 // algorithmViewHost 179 185 // 180 this.algorithmViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 181 | System.Windows.Forms.AnchorStyles.Left) 186 this.algorithmViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 187 | System.Windows.Forms.AnchorStyles.Left) 182 188 | System.Windows.Forms.AnchorStyles.Right))); 183 189 this.algorithmViewHost.Caption = "View"; … … 203 209 // suggestedInstancesComboBox 204 210 // 205 this.suggestedInstancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 211 this.suggestedInstancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 206 212 | System.Windows.Forms.AnchorStyles.Right))); 207 213 this.suggestedInstancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; … … 237 243 // okbTabPage 238 244 // 245 this.okbTabPage.Controls.Add(this.okbDownloadButton); 239 246 this.okbTabPage.Controls.Add(this.algorithmInstancesViewHost); 240 247 this.okbTabPage.Location = new System.Drawing.Point(4, 22); … … 248 255 // algorithmInstancesViewHost 249 256 // 257 this.algorithmInstancesViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 258 | System.Windows.Forms.AnchorStyles.Left) 259 | System.Windows.Forms.AnchorStyles.Right))); 250 260 this.algorithmInstancesViewHost.Caption = "View"; 251 261 this.algorithmInstancesViewHost.Content = null; 252 this.algorithmInstancesViewHost.Dock = System.Windows.Forms.DockStyle.Fill;253 262 this.algorithmInstancesViewHost.Enabled = false; 254 this.algorithmInstancesViewHost.Location = new System.Drawing.Point(3, 3 );263 this.algorithmInstancesViewHost.Location = new System.Drawing.Point(3, 35); 255 264 this.algorithmInstancesViewHost.Name = "algorithmInstancesViewHost"; 256 265 this.algorithmInstancesViewHost.ReadOnly = false; 257 this.algorithmInstancesViewHost.Size = new System.Drawing.Size(532, 329);266 this.algorithmInstancesViewHost.Size = new System.Drawing.Size(532, 297); 258 267 this.algorithmInstancesViewHost.TabIndex = 0; 259 268 this.algorithmInstancesViewHost.ViewsLabelVisible = true; … … 263 272 // 264 273 this.problemInstancesTabPage.Controls.Add(this.problemInstancesView); 274 this.problemInstancesTabPage.Controls.Add(this.instancesDropPanel); 275 this.problemInstancesTabPage.Controls.Add(this.refreshMapButton); 265 276 this.problemInstancesTabPage.Location = new System.Drawing.Point(4, 22); 266 277 this.problemInstancesTabPage.Name = "problemInstancesTabPage"; … … 273 284 // problemInstancesView 274 285 // 275 this.problemInstancesView.BackColor = System.Drawing.SystemColors.Window; 276 this.problemInstancesView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 277 this.problemInstancesView.Caption = "Bubble Chart"; 286 this.problemInstancesView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 287 | System.Windows.Forms.AnchorStyles.Left) 288 | System.Windows.Forms.AnchorStyles.Right))); 289 this.problemInstancesView.Caption = "View"; 278 290 this.problemInstancesView.Content = null; 279 this.problemInstancesView. Dock = System.Windows.Forms.DockStyle.Fill;280 this.problemInstancesView.Location = new System.Drawing.Point(3, 3 );291 this.problemInstancesView.Enabled = false; 292 this.problemInstancesView.Location = new System.Drawing.Point(3, 34); 281 293 this.problemInstancesView.Name = "problemInstancesView"; 282 294 this.problemInstancesView.ReadOnly = false; 283 this.problemInstancesView.Size = new System.Drawing.Size(532, 329); 284 this.problemInstancesView.TabIndex = 0; 295 this.problemInstancesView.Size = new System.Drawing.Size(532, 298); 296 this.problemInstancesView.TabIndex = 3; 297 this.problemInstancesView.ViewsLabelVisible = true; 298 this.problemInstancesView.ViewType = null; 299 // 300 // instancesDropPanel 301 // 302 this.instancesDropPanel.AllowDrop = true; 303 this.instancesDropPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 304 | System.Windows.Forms.AnchorStyles.Right))); 305 this.instancesDropPanel.BackColor = System.Drawing.Color.LightYellow; 306 this.instancesDropPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 307 this.instancesDropPanel.Controls.Add(this.dragFLAHereLabel); 308 this.instancesDropPanel.Location = new System.Drawing.Point(35, 7); 309 this.instancesDropPanel.Name = "instancesDropPanel"; 310 this.instancesDropPanel.Size = new System.Drawing.Size(500, 21); 311 this.instancesDropPanel.TabIndex = 2; 312 this.instancesDropPanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.instancesDropPanel_DragDrop); 313 this.instancesDropPanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.instancesDropPanel_DragEnter); 314 this.instancesDropPanel.DragOver += new System.Windows.Forms.DragEventHandler(this.instancesDropPanel_DragOver); 315 // 316 // dragFLAHereLabel 317 // 318 this.dragFLAHereLabel.Anchor = System.Windows.Forms.AnchorStyles.None; 319 this.dragFLAHereLabel.AutoSize = true; 320 this.dragFLAHereLabel.ForeColor = System.Drawing.SystemColors.ControlDarkDark; 321 this.dragFLAHereLabel.Location = new System.Drawing.Point(155, 3); 322 this.dragFLAHereLabel.Name = "dragFLAHereLabel"; 323 this.dragFLAHereLabel.Size = new System.Drawing.Size(175, 13); 324 this.dragFLAHereLabel.TabIndex = 0; 325 this.dragFLAHereLabel.Text = "Drag and drop runs with FLA here..."; 326 // 327 // refreshMapButton 328 // 329 this.refreshMapButton.Location = new System.Drawing.Point(3, 6); 330 this.refreshMapButton.Name = "refreshMapButton"; 331 this.refreshMapButton.Size = new System.Drawing.Size(26, 23); 332 this.refreshMapButton.TabIndex = 1; 333 this.refreshMapButton.Text = "Refresh"; 334 this.refreshMapButton.UseVisualStyleBackColor = true; 335 this.refreshMapButton.Click += new System.EventHandler(this.refreshMapButton_Click); 285 336 // 286 337 // openFileDialog … … 290 341 this.openFileDialog.Filter = "HeuristicLab Files|*.hl|All Files|*.*"; 291 342 this.openFileDialog.Title = "Open Optimizer"; 343 // 344 // okbDownloadButton 345 // 346 this.okbDownloadButton.Location = new System.Drawing.Point(6, 6); 347 this.okbDownloadButton.Name = "okbDownloadButton"; 348 this.okbDownloadButton.Size = new System.Drawing.Size(146, 23); 349 this.okbDownloadButton.TabIndex = 1; 350 this.okbDownloadButton.Text = "Download from OKB"; 351 this.okbDownloadButton.UseVisualStyleBackColor = true; 352 this.okbDownloadButton.Click += new System.EventHandler(this.okbDownloadButton_Click); 292 353 // 293 354 // ExpertSystemView … … 313 374 this.okbTabPage.ResumeLayout(false); 314 375 this.problemInstancesTabPage.ResumeLayout(false); 376 this.instancesDropPanel.ResumeLayout(false); 377 this.instancesDropPanel.PerformLayout(); 315 378 this.ResumeLayout(false); 316 379 this.PerformLayout(); … … 337 400 private MainForm.WindowsForms.ViewHost algorithmInstancesViewHost; 338 401 private System.Windows.Forms.TabPage problemInstancesTabPage; 339 private Optimization.Views.RunCollectionBubbleChartView problemInstancesView; 402 private System.Windows.Forms.Panel instancesDropPanel; 403 private System.Windows.Forms.Button refreshMapButton; 404 private System.Windows.Forms.Label dragFLAHereLabel; 405 private MainForm.WindowsForms.ViewHost problemInstancesView; 406 private System.Windows.Forms.Button okbDownloadButton; 340 407 } 341 408 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/ExpertSystemView.cs
r12860 r13475 21 21 22 22 using System; 23 using System.Collections; 23 24 using System.ComponentModel; 25 using System.IO; 26 using System.Linq; 24 27 using System.Windows.Forms; 28 using HeuristicLab.Clients.OKB.Administration; 29 using HeuristicLab.Clients.OKB.Query; 25 30 using HeuristicLab.Common; 31 using HeuristicLab.Common.Resources; 32 using HeuristicLab.Core; 26 33 using HeuristicLab.Core.Views; 27 34 using HeuristicLab.MainForm; 28 35 using HeuristicLab.Optimization; 36 using HeuristicLab.Persistence.Default.Xml; 29 37 using HeuristicLab.PluginInfrastructure; 30 38 … … 43 51 public ExpertSystemView() { 44 52 InitializeComponent(); 53 refreshMapButton.Text = string.Empty; 54 refreshMapButton.Image = VSImageLibrary.Refresh; 45 55 } 46 56 … … 83 93 runsView.Content = null; 84 94 algorithmInstancesViewHost.Content = null; 95 problemInstancesView.Content = null; 85 96 } else { 86 97 maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); … … 88 99 runsView.Content = Content.Runs; 89 100 algorithmInstancesViewHost.Content = Content.AlgorithmInstances; 101 problemInstancesView.Content = Content.ProblemInstances; 90 102 } 91 103 } finally { SuppressEvents = false; } … … 103 115 runsView.Enabled = Content != null; 104 116 algorithmInstancesViewHost.Enabled = Content != null; 117 refreshMapButton.Enabled = Content != null; 118 okbDownloadButton.Enabled = Content != null && Content.Problem != null && !ReadOnly && !Locked; 105 119 } 106 120 … … 131 145 try { 132 146 switch (e.PropertyName) { 147 case "AlgorithmInstances": algorithmInstancesViewHost.Content = Content.AlgorithmInstances; break; 133 148 case "MaximumEvaluations": maxEvaluationsTextBox.Text = Content.MaximumEvaluations.ToString(); break; 134 149 case "Problem": problemViewHost.Content = Content.Problem; break; 150 case "ProblemInstances": problemInstancesView.Content = Content.ProblemInstances; break; 135 151 } 136 152 } finally { SuppressEvents = false; } 153 SetEnabledStateOfControls(); 137 154 } 138 155 … … 233 250 } 234 251 #endregion 252 253 private bool validDragOperation; 254 private void instancesDropPanel_DragEnter(object sender, DragEventArgs e) { 255 validDragOperation = false; 256 if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IRun)) { 257 validDragOperation = true; 258 } else if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable)) { 259 validDragOperation = true; 260 var items = (IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 261 foreach (object item in items) 262 validDragOperation = validDragOperation && (item is IRun); 263 } 264 } 265 private void instancesDropPanel_DragOver(object sender, DragEventArgs e) { 266 e.Effect = DragDropEffects.None; 267 if (!validDragOperation) return; 268 if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link; // ALT key 269 else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move; // SHIFT key 270 else if (e.AllowedEffect.HasFlag(DragDropEffects.Copy)) e.Effect = DragDropEffects.Copy; 271 else if (e.AllowedEffect.HasFlag(DragDropEffects.Move)) e.Effect = DragDropEffects.Move; 272 else if (e.AllowedEffect.HasFlag(DragDropEffects.Link)) e.Effect = DragDropEffects.Link; 273 } 274 private void instancesDropPanel_DragDrop(object sender, DragEventArgs e) { 275 if (e.Effect == DragDropEffects.None) return; 276 if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IRun) { 277 var item = (IRun)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat); 278 Content.ProblemInstances.Add(e.Effect.HasFlag(DragDropEffects.Copy) ? (IRun)item.Clone() : item); 279 } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) { 280 var items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<IRun>(); 281 if (e.Effect.HasFlag(DragDropEffects.Copy)) { 282 var cloner = new Cloner(); 283 items = items.Select(x => cloner.Clone(x)); 284 } 285 Content.ProblemInstances.AddRange(items); 286 } 287 } 235 288 #endregion 289 290 private void refreshMapButton_Click(object sender, EventArgs e) { 291 Content.UpdateInstanceMap(); 292 } 293 294 private void okbDownloadButton_Click(object sender, EventArgs e) { 295 var queryClient = QueryClient.Instance; 296 queryClient.Refresh(); 297 298 var problemTypeFilter = (StringComparisonAvailableValuesFilter)queryClient.Filters.Single(x => x.Label == "Problem Data Type Name"); 299 problemTypeFilter.Value = Content.Problem.GetType().Name; 300 301 var runIds = queryClient.GetRunIds(problemTypeFilter).ToList(); 302 var count = queryClient.GetNumberOfRuns(problemTypeFilter); 303 if (count > 0) { 304 var list = new ItemList<IAlgorithm>(); 305 var adminClient = AdministrationClient.Instance; 306 adminClient.Refresh(); 307 var runs = queryClient.GetRuns(runIds, true).ToList(); 308 foreach (var rGroup in runs.GroupBy(x => x.Algorithm.Id)) { 309 var data = AdministrationClient.GetAlgorithmData(rGroup.Key); 310 if (data != null) { 311 using (var stream = new MemoryStream(data)) { 312 try { 313 var alg = (IAlgorithm)XmlParser.Deserialize<IContent>(stream); 314 alg.Runs.AddRange(rGroup.Select(x => queryClient.ConvertToOptimizationRun(x))); 315 list.Add(alg); 316 } catch (Exception) { } 317 stream.Close(); 318 } 319 } 320 } 321 Content.AlgorithmInstances = list; 322 } 323 } 236 324 } 237 325 } -
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Views/3.3/HeuristicLab.OptimizationExpertSystem.Views-3.3.csproj
r12957 r13475 78 78 <Private>False</Private> 79 79 </Reference> 80 <Reference Include="HeuristicLab.Clients.OKB-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 81 <SpecificVersion>False</SpecificVersion> 82 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Clients.OKB-3.3.dll</HintPath> 83 <Private>False</Private> 84 </Reference> 80 85 <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 81 86 <SpecificVersion>False</SpecificVersion> … … 121 126 <SpecificVersion>False</SpecificVersion> 122 127 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 128 <Private>False</Private> 129 </Reference> 130 <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 131 <SpecificVersion>False</SpecificVersion> 132 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath> 123 133 <Private>False</Private> 124 134 </Reference> … … 136 146 <Reference Include="System.Core" /> 137 147 <Reference Include="System.Drawing" /> 148 <Reference Include="System.Runtime.Serialization" /> 138 149 <Reference Include="System.Windows.Forms" /> 139 150 <Reference Include="System.Xml.Linq" /> … … 185 196 </ProjectReference> 186 197 </ItemGroup> 198 <ItemGroup> 199 <EmbeddedResource Include="ExpertSystemView.resx"> 200 <DependentUpon>ExpertSystemView.cs</DependentUpon> 201 </EmbeddedResource> 202 </ItemGroup> 187 203 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 188 204 <PropertyGroup>
Note: See TracChangeset
for help on using the changeset viewer.