Changeset 7338
- Timestamp:
- 01/16/12 17:06:32 (13 years ago)
- Location:
- branches/ChangeDatasetOfRegressionModel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ChangeDatasetOfRegressionModel/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj
r7122 r7338 275 275 </BootstrapperPackage> 276 276 </ItemGroup> 277 <ItemGroup> 278 <EmbeddedResource Include="SymbolicRegressionSolutionView.resx"> 279 <DependentUpon>SymbolicRegressionSolutionView.cs</DependentUpon> 280 </EmbeddedResource> 281 </ItemGroup> 277 282 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 278 283 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
branches/ChangeDatasetOfRegressionModel/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.Designer.cs
r5829 r7338 36 36 // 37 37 // 38 // splitContainer.Panel 138 // splitContainer.Panel2 39 39 // 40 this.splitContainer.Panel 1.Controls.Add(this.btnSimplify);40 this.splitContainer.Panel2.Controls.Add(this.btnSimplify); 41 41 this.splitContainer.Size = new System.Drawing.Size(480, 275); 42 42 this.splitContainer.SplitterDistance = 255; … … 68 68 // btnSimplify 69 69 // 70 this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 71 this.btnSimplify.Location = new System.Drawing.Point(177, 4); 70 this.btnSimplify.Location = new System.Drawing.Point(3, 4); 72 71 this.btnSimplify.Name = "btnSimplify"; 73 72 this.btnSimplify.Size = new System.Drawing.Size(75, 23); -
branches/ChangeDatasetOfRegressionModel/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r7097 r7338 366 366 </BootstrapperPackage> 367 367 </ItemGroup> 368 <ItemGroup> 369 <EmbeddedResource Include="Solution Views\RegressionSolutionView.resx"> 370 <DependentUpon>RegressionSolutionView.cs</DependentUpon> 371 </EmbeddedResource> 372 </ItemGroup> 368 373 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 369 374 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
branches/ChangeDatasetOfRegressionModel/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.Designer.cs
r7259 r7338 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.btnImport = new System.Windows.Forms.Button(); 48 this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); 47 49 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 48 50 this.splitContainer.Panel1.SuspendLayout(); … … 55 57 // splitContainer 56 58 // 59 // 60 // splitContainer.Panel1 61 // 62 this.splitContainer.Panel1.Controls.Add(this.btnImport); 57 63 // 58 64 // itemsGroupBox … … 67 73 // 68 74 this.toolTip.SetToolTip(this.removeButton, "Remove"); 75 // 76 // btnImport 77 // 78 this.btnImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 79 this.btnImport.Location = new System.Drawing.Point(172, 4); 80 this.btnImport.Name = "btnImport"; 81 this.btnImport.Size = new System.Drawing.Size(75, 23); 82 this.btnImport.TabIndex = 7; 83 this.btnImport.Text = "Import"; 84 this.btnImport.UseVisualStyleBackColor = true; 85 this.btnImport.Click += new System.EventHandler(this.btnImport_Click); 86 // 87 // openFileDialog 88 // 89 this.openFileDialog.Filter = "HL files|*.hl"; 90 this.openFileDialog.Title = "Import ProblemData or Problem..."; 69 91 // 70 92 // RegressionSolutionView … … 84 106 85 107 #endregion 108 109 private System.Windows.Forms.Button btnImport; 110 private System.Windows.Forms.OpenFileDialog openFileDialog; 86 111 } 87 112 } -
branches/ChangeDatasetOfRegressionModel/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs
r7259 r7338 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 22 24 using System.Windows.Forms; 23 25 using HeuristicLab.Core; 24 26 using HeuristicLab.MainForm; 27 using HeuristicLab.Persistence.Default.Xml; 28 using HeuristicLab.PluginInfrastructure; 25 29 26 30 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 50 54 } 51 55 #endregion 56 57 private void btnImport_Click(object sender, System.EventArgs e) { 58 if (openFileDialog.ShowDialog(this) == DialogResult.OK) { 59 object hlFile = null; 60 try { 61 hlFile = XmlParser.Deserialize(openFileDialog.FileName); 62 } 63 catch (Exception ex) { 64 ErrorHandling.ShowErrorDialog(this, ex); 65 } 66 IRegressionProblemData problemData = null; 67 if (hlFile != null && hlFile is RegressionProblemData) { 68 problemData = (RegressionProblemData)hlFile; 69 } else if (hlFile != null && hlFile is IRegressionProblem) { 70 problemData = ((IRegressionProblem)hlFile).ProblemData; 71 } 72 if (problemData != null) { 73 IList<string> missingVariables = new List<string>(); 74 if (!problemData.TargetVariable.Equals(Content.ProblemData.TargetVariable)) 75 missingVariables.Add(Content.ProblemData.TargetVariable); 76 77 //foreach (var item in Content.ProblemData.InputVariables.CheckedItems) { 78 // if (!problemData.InputVariables.Contains(item.Value)) 79 // missingVariables.Add(item.Value.ToString()); 80 //} 81 82 //easier solution will be created later 83 bool found; 84 foreach (var item in Content.ProblemData.InputVariables.CheckedItems) { 85 found = false; 86 foreach (var it in problemData.InputVariables) { 87 if (it.Value.Equals(item.Value.Value)) { 88 found = true; 89 break; 90 } 91 } 92 if (!found) 93 missingVariables.Add(item.Value.ToString()); 94 } 95 96 if (missingVariables.Count != 0) { 97 string message = ""; 98 foreach (var item in missingVariables) { 99 message += item + Environment.NewLine; 100 } 101 ErrorHandling.ShowErrorDialog(this, new Exception(message)); 102 } else { 103 Content.ProblemData = problemData; 104 } 105 } 106 } 107 } 52 108 } 53 109 }
Note: See TracChangeset
for help on using the changeset viewer.