- Timestamp:
- 09/17/14 20:54:20 (10 years ago)
- Location:
- branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/ChartAnalysisView.cs
r11378 r11379 86 86 87 87 private void UpdateComboboxes() { 88 dataTableComboBox.Items.Clear();89 dataRowComboBox.Items.Clear();90 91 88 if (Content != null) { 92 89 UpdateDataTableComboBox(); … … 200 197 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Adding fitted lines to charts..."); 201 198 202 var task = Task.Factory.StartNew(AddLineToChart); 199 string resultName = (string)dataTableComboBox.SelectedItem; 200 string rowName = (string)dataRowComboBox.SelectedItem; 201 202 var task = Task.Factory.StartNew(() => AddLineToChart(resultName, rowName)); 203 203 204 204 task.ContinueWith((t) => { … … 212 212 } 213 213 214 private void AddLineToChart() { 215 string resultName = (string)dataTableComboBox.SelectedItem; 216 string rowName = (string)dataRowComboBox.SelectedItem; 217 214 private void AddLineToChart(string resultName, string rowName) { 218 215 foreach (IRun run in runs) { 219 216 DataTable resTable = (DataTable)run.Results[resultName]; … … 253 250 254 251 private void UpdateDataRowComboBox() { 252 string selectedItem = (string)this.dataRowComboBox.SelectedItem; 253 255 254 dataRowComboBox.Items.Clear(); 256 255 var resultName = (string)dataTableComboBox.SelectedItem; … … 263 262 264 263 dataRowComboBox.Items.AddRange(rowNames); 265 if (dataRowComboBox.Items.Count > 0) dataRowComboBox.SelectedItem = dataRowComboBox.Items[0]; 264 if (selectedItem != null && dataRowComboBox.Items.Contains(selectedItem)) { 265 dataRowComboBox.SelectedItem = selectedItem; 266 } else if (dataRowComboBox.Items.Count > 0) { 267 dataRowComboBox.SelectedItem = dataRowComboBox.Items[0]; 268 } 266 269 } 267 270 268 271 private void UpdateDataTableComboBox() { 272 string selectedItem = (string)this.dataTableComboBox.SelectedItem; 273 269 274 dataTableComboBox.Items.Clear(); 270 275 var dataTables = (from run in Content … … 274 279 275 280 dataTableComboBox.Items.AddRange(dataTables); 276 if (dataTableComboBox.Items.Count > 0) dataTableComboBox.SelectedItem = dataTableComboBox.Items[0]; 281 if (selectedItem != null && dataTableComboBox.Items.Contains(selectedItem)) { 282 dataTableComboBox.SelectedItem = selectedItem; 283 } else if (dataTableComboBox.Items.Count > 0) { 284 dataTableComboBox.SelectedItem = dataTableComboBox.Items[0]; 285 } 277 286 } 278 287 … … 280 289 progress = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Calculating values..."); 281 290 282 var task = Task.Factory.StartNew(RebuildDataTable); 291 string resultName = (string)dataTableComboBox.SelectedItem; 292 string rowName = (string)dataRowComboBox.SelectedItem; 293 294 var task = Task.Factory.StartNew(() => RebuildDataTable(resultName, rowName)); 283 295 284 296 task.ContinueWith((t) => { … … 292 304 } 293 305 294 private void RebuildDataTable() { 295 string resultName = (string)dataTableComboBox.SelectedItem; 296 string rowName = (string)dataRowComboBox.SelectedItem; 306 private void RebuildDataTable(string resultName, string rowName) { 297 307 LinearLeastSquaresFitting llsFitting = new LinearLeastSquaresFitting(); 298 308 LogFitting logFitting = new LogFitting(); -
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/CorrelationView.cs
r11378 r11379 140 140 141 141 private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 142 DeregisterRunEvents(e.OldItems); 143 RegisterRunEvents(e.Items); 142 144 UpdateUI(); 143 145 } 144 146 145 147 private void Content_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 148 DeregisterRunEvents(e.Items); 146 149 UpdateUI(); 147 150 } 148 151 149 152 private void Content_ItemsAdded(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 153 RegisterRunEvents(e.Items); 150 154 UpdateUI(); 151 155 }
Note: See TracChangeset
for help on using the changeset viewer.