Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Optimization.Views/3.3/RunCollectionViews
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Optimization.Views
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionBoxPlotView.cs
r12820 r14029 248 248 matrix[5, i] = seriesValues.StandardDeviation(); 249 249 matrix[6, i] = seriesValues.Variance(); 250 matrix[7, i] = seriesValues. Percentile(0.25);251 matrix[8, i] = seriesValues. Percentile(0.75);250 matrix[7, i] = seriesValues.Quantile(0.25); 251 matrix[8, i] = seriesValues.Quantile(0.75); 252 252 } 253 253 statisticsMatrixView.Content = matrix; -
branches/crossvalidation-2434/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionChartAggregationView.cs
r12692 r14029 80 80 return; 81 81 } 82 UpdateDataTableComboBox(); // will trigger AddRuns 83 } 84 private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) { 85 if (suppressUpdates) return; 86 if (InvokeRequired) { 87 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e); 88 return; 89 } 90 RemoveRuns(e.Items); 82 91 UpdateDataTableComboBox(); 83 92 UpdateDataRowComboBox(); 84 AddRuns(e.Items); 85 } 86 private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) { 87 if (suppressUpdates) return; 88 if (InvokeRequired) { 89 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_ItemsRemoved), sender, e); 90 return; 91 } 93 RebuildCombinedDataTable(); 94 } 95 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 96 if (suppressUpdates) return; 97 if (InvokeRequired) { 98 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e); 99 return; 100 } 101 RemoveRuns(e.OldItems); 92 102 UpdateDataTableComboBox(); 93 103 UpdateDataRowComboBox(); 94 RemoveRuns(e.Items); 95 } 96 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 97 if (suppressUpdates) return; 98 if (InvokeRequired) { 99 Invoke(new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset), sender, e); 100 return; 101 } 102 UpdateDataTableComboBox(); 103 UpdateDataRowComboBox(); 104 RemoveRuns(e.OldItems); 105 AddRuns(e.Items); 104 RebuildCombinedDataTable(); 106 105 } 107 106 private void Content_AlgorithmNameChanged(object sender, EventArgs e) { … … 117 116 suppressUpdates = Content.UpdateOfRunsInProgress; 118 117 if (!suppressUpdates) { 118 foreach (var run in runMapping) 119 DeregisterRunEvents(run.Key); 120 runMapping.Clear(); 121 combinedDataTable.Rows.Clear(); 119 122 UpdateDataTableComboBox(); 120 UpdateDataRowComboBox();121 UpdateRuns(Content);122 123 } 123 124 } -
branches/crossvalidation-2434/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionTableView.cs
r12692 r14029 121 121 } 122 122 123 protected override void UpdateColumnHeaders() { 124 HashSet<string> visibleColumnNames = new HashSet<string>(dataGridView.Columns.OfType<DataGridViewColumn>() 125 .Where(c => c.Visible && !string.IsNullOrEmpty(c.HeaderText)).Select(c => c.HeaderText)); 126 123 public override void UpdateColumnHeaders() { 124 string[] colNames = base.Content.ColumnNames.ToArray(); 125 int colCount = colNames.Length; 127 126 for (int i = 0; i < dataGridView.ColumnCount; i++) { 128 if (i < base.Content.ColumnNames.Count())129 dataGridView.Columns[i].HeaderText = base.Content.ColumnNames.ElementAt(i);127 if (i < colCount) 128 dataGridView.Columns[i].HeaderText = colNames[i]; 130 129 else 131 130 dataGridView.Columns[i].HeaderText = "Column " + (i + 1); 131 } 132 133 HashSet<string> visibleColumnNames = new HashSet<string>( 134 dataGridView.Columns.OfType<DataGridViewColumn>() 135 .Where(c => c.Visible) 136 .Where(c => !string.IsNullOrEmpty(c.HeaderText)) 137 .Where(c => !IsConstant(c.HeaderText)) 138 .Select(c => c.HeaderText)); 139 140 for (int i = 0; i < dataGridView.ColumnCount; i++) { 132 141 dataGridView.Columns[i].Visible = visibleColumnNames.Count == 0 || visibleColumnNames.Contains(dataGridView.Columns[i].HeaderText); 133 142 } 143 } 144 145 // returns true when all values in the column are the same (missing values are included in the count) 146 private bool IsConstant(string columnName) { 147 Func<IRun, string, string> GetStringValue = (IRun r, string colName) => { 148 // also include missing values in the count 149 IItem v = null; 150 if (r.Parameters.TryGetValue(colName, out v)) return v.ToString(); 151 if (r.Results.TryGetValue(colName, out v)) return v.ToString(); 152 return string.Empty; 153 }; 154 155 var firstRun = Content.First(); 156 string firstValue = GetStringValue(firstRun, columnName); 157 return Content.Skip(1).All(run => firstValue == GetStringValue(run, columnName)); 134 158 } 135 159 -
branches/crossvalidation-2434/HeuristicLab.Optimization.Views/3.3/RunCollectionViews/RunCollectionView.cs
r12692 r14029 389 389 return; 390 390 ReadOnly = true; 391 391 392 try { 393 RunCollection.UpdateOfRunsInProgress = true; 392 394 RunCollection.Modify(); 393 395 } finally { 394 396 ReadOnly = false; 397 RunCollection.UpdateOfRunsInProgress = false; 395 398 } 396 399 }
Note: See TracChangeset
for help on using the changeset viewer.