- Timestamp:
- 07/03/12 16:46:35 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:mergeinfo changed
/trunk/sources merged: 8084,8088-8090,8092-8100,8102-8113,8115,8117-8132,8134-8146,8148-8156,8158-8160,8163-8170,8173-8176,8178-8190,8192-8205
- Property svn:mergeinfo changed
-
branches/GP-MoveOperators/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionDataTableView.cs
r8085 r8206 26 26 using HeuristicLab.Analysis; 27 27 using HeuristicLab.Collections; 28 using HeuristicLab.Common;29 28 using HeuristicLab.Core.Views; 30 29 using HeuristicLab.MainForm; … … 36 35 private const string AllDataRows = "All DataRows"; 37 36 38 public RunCollectionDataTableView() {39 InitializeComponent();40 runMapping = new Dictionary<IRun, IEnumerable<DataRow>>();41 combinedDataTable = new DataTable("Combined DataTable", "A data table containing all data rows from all run.");42 viewHost.Content = combinedDataTable;43 suppressUpdates = false;44 }45 46 37 public new RunCollection Content { 47 38 get { return (RunCollection)base.Content; } … … 49 40 } 50 41 42 private int rowNumber = 0; 51 43 private bool suppressUpdates; 52 44 private readonly Dictionary<IRun, IEnumerable<DataRow>> runMapping; … … 54 46 public DataTable CombinedDataTable { 55 47 get { return combinedDataTable; } 48 } 49 50 public RunCollectionDataTableView() { 51 InitializeComponent(); 52 runMapping = new Dictionary<IRun, IEnumerable<DataRow>>(); 53 combinedDataTable = new DataTable("Combined DataTable", "A data table containing data rows from multiple runs."); 54 viewHost.Content = combinedDataTable; 55 suppressUpdates = false; 56 56 } 57 57 … … 111 111 private void run_Changed(object sender, EventArgs e) { 112 112 if (suppressUpdates) return; 113 IRun run = (IRun)sender; 114 UpdateRuns(run.ToEnumerable()); 115 113 var run = (IRun)sender; 114 UpdateRuns(new IRun[] { run }); 116 115 } 117 116 #endregion … … 131 130 private void RebuildCombinedDataTable() { 132 131 RemoveRuns(Content); 132 rowNumber = 0; 133 133 AddRuns(Content); 134 134 } … … 142 142 combinedDataTable.Rows.AddRange(dataRows); 143 143 } 144 144 145 private void RemoveRuns(IEnumerable<IRun> runs) { 145 146 var dataRows = runs.Where(r => runMapping.ContainsKey(r)).SelectMany(r => runMapping[r]).ToList(); … … 165 166 } 166 167 167 private int rowNumber = 0;168 168 private IEnumerable<DataRow> ExtractDataRowsFromRun(IRun run) { 169 stringresultName = (string)dataTableComboBox.SelectedItem;170 stringrowName = (string)dataRowComboBox.SelectedItem;169 var resultName = (string)dataTableComboBox.SelectedItem; 170 var rowName = (string)dataRowComboBox.SelectedItem; 171 171 if (!run.Results.ContainsKey(resultName)) yield break; 172 172 173 DataTabledataTable = (DataTable)run.Results[resultName];173 var dataTable = (DataTable)run.Results[resultName]; 174 174 foreach (var dataRow in dataTable.Rows) { 175 175 if (dataRow.Name != rowName && rowName != AllDataRows) continue; … … 197 197 private void UpdateDataRowComboBox() { 198 198 dataRowComboBox.Items.Clear(); 199 stringresultName = (string)dataTableComboBox.SelectedItem;199 var resultName = (string)dataTableComboBox.SelectedItem; 200 200 var dataTables = from run in Content 201 201 where run.Results.ContainsKey(resultName) -
branches/GP-MoveOperators/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTabularView.cs
r7469 r8206 164 164 RunCollectionRowComparer rowComparer = new RunCollectionRowComparer(); 165 165 if (sortedColumns.Count() != 0) { 166 rowComparer.SortedIndi zes = sortedColumns;166 rowComparer.SortedIndices = sortedColumns; 167 167 rowComparer.Matrix = Content; 168 168 Array.Sort(newSortedIndex, rowComparer); … … 194 194 } 195 195 196 private List<KeyValuePair<int, SortOrder>> sortedIndi zes;197 public IEnumerable<KeyValuePair<int, SortOrder>> SortedIndi zes {198 get { return this.sortedIndi zes; }199 set { sortedIndi zes = new List<KeyValuePair<int, SortOrder>>(value); }196 private List<KeyValuePair<int, SortOrder>> sortedIndices; 197 public IEnumerable<KeyValuePair<int, SortOrder>> SortedIndices { 198 get { return this.sortedIndices; } 199 set { sortedIndices = new List<KeyValuePair<int, SortOrder>>(value); } 200 200 } 201 201 private RunCollection matrix; … … 212 212 if (matrix == null) 213 213 throw new InvalidOperationException("Could not sort IStringConvertibleMatrix if the matrix member is null."); 214 if (sortedIndi zes == null)214 if (sortedIndices == null) 215 215 return 0; 216 216 217 foreach (KeyValuePair<int, SortOrder> pair in sortedIndi zes.Where(p => p.Value != SortOrder.None)) {217 foreach (KeyValuePair<int, SortOrder> pair in sortedIndices.Where(p => p.Value != SortOrder.None)) { 218 218 value1 = matrix.GetValue(x, pair.Key); 219 219 value2 = matrix.GetValue(y, pair.Key);
Note: See TracChangeset
for help on using the changeset viewer.