Changeset 7347 for branches/ChangeDatasetOfRegressionModel/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views
- Timestamp:
- 01/17/12 16:18:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ChangeDatasetOfRegressionModel/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs
r7338 r7347 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 24 26 using System.Windows.Forms; 25 27 using HeuristicLab.Core; … … 64 66 ErrorHandling.ShowErrorDialog(this, ex); 65 67 } 68 66 69 IRegressionProblemData problemData = null; 67 70 if (hlFile != null && hlFile is RegressionProblemData) { … … 71 74 } 72 75 if (problemData != null) { 73 IList<string> missingVariables = new List<string>();76 StringBuilder message = new StringBuilder(); 74 77 if (!problemData.TargetVariable.Equals(Content.ProblemData.TargetVariable)) 75 missingVariables.Add(Content.ProblemData.TargetVariable); 78 message.AppendLine("The target variables are not matching. Old target variable: '" + Content.ProblemData.TargetVariable 79 + "'. New targetvariable: '" + problemData.TargetVariable + "'"); 76 80 77 //foreach (var item in Content.ProblemData.InputVariables.CheckedItems) { 78 // if (!problemData.InputVariables.Contains(item.Value)) 79 // missingVariables.Add(item.Value.ToString()); 80 //} 81 List<string> variables = problemData.InputVariables.Select(x => x.Value).ToList(); 81 82 82 //easier solution will be created later83 bool found;84 83 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()); 84 if (!variables.Contains(item.Value.Value)) 85 message.AppendLine("Input variable '" + item.Value.Value + "' is not in the new problem data."); 94 86 } 95 87 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 { 88 if (message.Length != 0) 89 ErrorHandling.ShowErrorDialog(this, new Exception(message.ToString())); 90 else 103 91 Content.ProblemData = problemData; 104 }105 92 } 106 93 }
Note: See TracChangeset
for help on using the changeset viewer.