- Timestamp:
- 07/06/15 13:52:12 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/ChartAnalysisView.cs
r12117 r12599 108 108 109 109 void Content_RowsChanged(object sender, EventArgs e) { 110 RebuildDataTableAsync(); 110 if (suppressUpdates) return; 111 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_RowsChanged, sender, e); 112 else { 113 RebuildDataTableAsync(); 114 } 111 115 } 112 116 113 117 void Content_ColumnsChanged(object sender, EventArgs e) { 114 if (!suppressUpdates) { 118 if (suppressUpdates) return; 119 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_ColumnsChanged, sender, e); 120 else { 115 121 RebuildDataTableAsync(); 116 122 } … … 118 124 119 125 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 120 UpdateComboboxes(); 121 RebuildDataTableAsync(); 126 if (suppressUpdates) return; 127 if (InvokeRequired) Invoke((Action<object, CollectionItemsChangedEventArgs<IRun>>)Content_CollectionReset, sender, e); 128 else { 129 UpdateComboboxes(); 130 RebuildDataTableAsync(); 131 } 122 132 } 123 133 124 134 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 125 suppressUpdates = Content.UpdateOfRunsInProgress; 126 127 if (!suppressUpdates && !valuesAdded) { 128 RebuildDataTableAsync(); 129 } 130 if (valuesAdded) { 131 valuesAdded = false; 135 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_UpdateOfRunsInProgressChanged, sender, e); 136 else { 137 suppressUpdates = Content.UpdateOfRunsInProgress; 138 139 if (!suppressUpdates && !valuesAdded) { 140 RebuildDataTableAsync(); 141 } 142 if (valuesAdded) { 143 valuesAdded = false; 144 } 132 145 } 133 146 } … … 248 261 249 262 private void RebuildDataTableAsync() { 263 string resultName = (string)dataTableComboBox.SelectedItem; 264 if (string.IsNullOrEmpty(resultName)) return; 265 266 string rowName = (string)dataRowComboBox.SelectedItem; 267 250 268 progress = MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Calculating values..."); 251 252 string resultName = (string)dataTableComboBox.SelectedItem;253 string rowName = (string)dataRowComboBox.SelectedItem;254 255 269 var task = Task.Factory.StartNew(() => RebuildDataTable(resultName, rowName)); 256 270 -
trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/CorrelationView.cs
r12152 r12599 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Collections; 25 26 using HeuristicLab.Core.Views; 26 27 using HeuristicLab.Data; … … 81 82 Content.ColumnsChanged += Content_ColumnsChanged; 82 83 Content.RowsChanged += Content_RowsChanged; 83 Content.CollectionReset += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);84 Content.CollectionReset += new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 84 85 Content.UpdateOfRunsInProgressChanged += Content_UpdateOfRunsInProgressChanged; 85 86 } … … 89 90 Content.ColumnsChanged -= Content_ColumnsChanged; 90 91 Content.RowsChanged -= Content_RowsChanged; 91 Content.CollectionReset -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset);92 Content.CollectionReset -= new CollectionItemsChangedEventHandler<IRun>(Content_CollectionReset); 92 93 Content.UpdateOfRunsInProgressChanged -= Content_UpdateOfRunsInProgressChanged; 93 94 } 94 95 95 96 void Content_RowsChanged(object sender, EventArgs e) { 96 UpdateUI(); 97 if (suppressUpdates) return; 98 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_RowsChanged, sender, e); 99 else { 100 UpdateUI(); 101 } 97 102 } 98 103 99 104 void Content_ColumnsChanged(object sender, EventArgs e) { 100 if (!suppressUpdates) { 101 UpdateUI(); 102 } 103 } 104 105 private void Content_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IRun> e) { 106 UpdateUI(); 105 if (suppressUpdates) return; 106 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_ColumnsChanged, sender, e); 107 else { 108 UpdateUI(); 109 } 110 } 111 112 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 113 if (suppressUpdates) return; 114 if (InvokeRequired) Invoke((Action<object, CollectionItemsChangedEventArgs<IRun>>)Content_CollectionReset, sender, e); 115 else { 116 UpdateUI(); 117 } 107 118 } 108 119 109 120 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 110 suppressUpdates = Content.UpdateOfRunsInProgress; 111 UpdateUI(); 121 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_UpdateOfRunsInProgressChanged, sender, e); 122 else { 123 suppressUpdates = Content.UpdateOfRunsInProgress; 124 UpdateUI(); 125 } 112 126 } 113 127 #endregion 114 128 115 129 private void UpdateUI() { 116 if (!suppressUpdates) { 117 RebuildCorrelationTable(); 118 } 130 RebuildCorrelationTable(); 119 131 } 120 132 -
trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/SampleSizeInfluenceView.cs
r12116 r12599 41 41 private const string BoxPlotSeriesName = "BoxPlotSeries"; 42 42 private const string BoxPlotChartAreaName = "BoxPlotChartArea"; 43 private const string delimit or = ";";43 private const string delimiter = ";"; 44 44 45 45 private bool suppressUpdates = false; … … 72 72 protected override void RegisterContentEvents() { 73 73 base.RegisterContentEvents(); 74 Content.Reset += new EventHandler(Content_Reset);75 74 Content.ColumnNamesChanged += new EventHandler(Content_ColumnNamesChanged); 76 75 Content.ItemsAdded += new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded); … … 83 82 protected override void DeregisterContentEvents() { 84 83 base.DeregisterContentEvents(); 85 Content.Reset -= new EventHandler(Content_Reset);86 84 Content.ColumnNamesChanged -= new EventHandler(Content_ColumnNamesChanged); 87 85 Content.ItemsAdded -= new HeuristicLab.Collections.CollectionItemsChangedEventHandler<IRun>(Content_ItemsAdded); … … 142 140 DeregisterRunEvents(e.OldItems); 143 141 RegisterRunEvents(e.Items); 144 UpdateAll();142 if (!suppressUpdates) UpdateAll(); 145 143 } 146 144 private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IRun> e) { 147 145 DeregisterRunEvents(e.Items); 148 UpdateComboBoxes();146 if (!suppressUpdates) UpdateComboBoxes(); 149 147 } 150 148 private void Content_ItemsAdded(object sender, CollectionItemsChangedEventArgs<IRun> e) { 151 149 RegisterRunEvents(e.Items); 152 UpdateComboBoxes();150 if (!suppressUpdates) UpdateComboBoxes(); 153 151 } 154 152 private void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { … … 157 155 else { 158 156 suppressUpdates = Content.UpdateOfRunsInProgress; 159 if (!suppressUpdates) UpdateDataPoints(); 160 } 161 } 162 163 private void Content_Reset(object sender, EventArgs e) { 164 if (InvokeRequired) 165 Invoke(new EventHandler(Content_Reset), sender, e); 166 else { 167 this.categoricalMapping.Clear(); 168 UpdateDataPoints(); 169 UpdateAxisLabels(); 157 if (!suppressUpdates) UpdateAll(); 170 158 } 171 159 } … … 174 162 Invoke(new EventHandler(Content_ColumnNamesChanged), sender, e); 175 163 else { 176 if (!suppressUpdates) { 177 UpdateComboBoxes(); 178 } 164 if (!suppressUpdates) UpdateComboBoxes(); 179 165 } 180 166 } … … 182 168 if (InvokeRequired) 183 169 this.Invoke(new EventHandler(run_Changed), sender, e); 184 else if (!suppressUpdates) { 185 UpdateDataPoints(); 186 } 170 else if (!suppressUpdates) UpdateDataPoints(); 187 171 } 188 172 … … 190 174 if (InvokeRequired) 191 175 Invoke(new EventHandler(Content_AlgorithmNameChanged), sender, e); 192 else UpdateCaption();176 else if (!suppressUpdates) UpdateCaption(); 193 177 } 194 178 #endregion … … 226 210 if (values.Any()) { 227 211 if (hypergeometricCheckBox.Checked) { 228 xAxisTextBox.Text += ((int)(values.Count() / 16)) + delimit or + " ";229 xAxisTextBox.Text += ((int)(values.Count() / 8)) + delimit or + " ";212 xAxisTextBox.Text += ((int)(values.Count() / 16)) + delimiter + " "; 213 xAxisTextBox.Text += ((int)(values.Count() / 8)) + delimiter + " "; 230 214 xAxisTextBox.Text += (int)(values.Count() / 4); 231 215 } else { 232 xAxisTextBox.Text += ((int)(values.Count() / 4)) + delimit or + " ";233 xAxisTextBox.Text += ((int)(values.Count() / 2)) + delimit or + " ";234 xAxisTextBox.Text += ((int)(values.Count() / 4 * 3)) + delimit or + " ";216 xAxisTextBox.Text += ((int)(values.Count() / 4)) + delimiter + " "; 217 xAxisTextBox.Text += ((int)(values.Count() / 2)) + delimiter + " "; 218 xAxisTextBox.Text += ((int)(values.Count() / 4 * 3)) + delimiter + " "; 235 219 xAxisTextBox.Text += (int)(values.Count()); 236 220 } … … 340 324 341 325 private List<int> ParseGroupSizesFromText(string groupsText, bool verbose = true) { 342 string[] gs = groupsText.Split(delimit or.ToCharArray());326 string[] gs = groupsText.Split(delimiter.ToCharArray()); 343 327 List<int> vals = new List<int>(); 344 328 … … 351 335 v = int.Parse(ns); 352 336 vals.Add(v); 353 } 354 catch (Exception ex) { 337 } catch (Exception ex) { 355 338 if (verbose) { 356 ErrorHandling.ShowErrorDialog("Can't parse group sizes. Please only use numbers seperated by a " + delimit or + ". ", ex);339 ErrorHandling.ShowErrorDialog("Can't parse group sizes. Please only use numbers seperated by a " + delimiter + ". ", ex); 357 340 } 358 341 } … … 625 608 string newVals = ""; 626 609 foreach (int v in values) { 627 newVals += v + delimit or + " ";610 newVals += v + delimiter + " "; 628 611 } 629 612 xAxisTextBox.Text = newVals; -
trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/StatisticalTestsView.cs
r12131 r12599 40 40 private const int requiredSampleSize = 5; 41 41 private double[][] data; 42 private bool suppressUpdates = false; 42 43 43 44 public double SignificanceLevel { … … 105 106 106 107 void Content_RowsChanged(object sender, EventArgs e) { 107 RebuildDataTable(); 108 if (suppressUpdates) return; 109 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_RowsChanged, sender, e); 110 else { 111 RebuildDataTable(); 112 } 108 113 } 109 114 110 115 void Content_ColumnsChanged(object sender, EventArgs e) { 111 if (!Content.UpdateOfRunsInProgress) { 116 if (suppressUpdates) return; 117 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_ColumnsChanged, sender, e); 118 else { 112 119 RebuildDataTable(); 113 120 } … … 115 122 116 123 private void Content_CollectionReset(object sender, CollectionItemsChangedEventArgs<IRun> e) { 117 RebuildDataTable(); 124 if (suppressUpdates) return; 125 if (InvokeRequired) Invoke((Action<object, CollectionItemsChangedEventArgs<IRun>>)Content_CollectionReset, sender, e); 126 else { 127 RebuildDataTable(); 128 } 118 129 } 119 130 120 131 void Content_UpdateOfRunsInProgressChanged(object sender, EventArgs e) { 121 if (!Content.UpdateOfRunsInProgress) { 122 RebuildDataTable(); 132 if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_UpdateOfRunsInProgressChanged, sender, e); 133 else { 134 suppressUpdates = Content.UpdateOfRunsInProgress; 135 if (!suppressUpdates) RebuildDataTable(); 123 136 } 124 137 }
Note: See TracChangeset
for help on using the changeset viewer.