Changeset 14118
- Timestamp:
- 07/19/16 17:21:38 (8 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.Designer.cs
r14099 r14118 89 89 this.chart.TabIndex = 0; 90 90 this.chart.SelectionRangeChanged += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CursorEventArgs>(this.chart_SelectionRangeChanged); 91 this.chart.AnnotationPositionChanged += new System.EventHandler(this.chart_AnnotationPositionChanged); 91 92 this.chart.AnnotationPositionChanging += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.AnnotationPositionChangingEventArgs>(this.chart_AnnotationPositionChanging); 92 93 this.chart.DragDrop += new System.Windows.Forms.DragEventHandler(this.chart_DragDrop); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChart.cs
r14099 r14118 267 267 } 268 268 269 ResizeAllSeriesData();270 OrderAndColorSeries();271 }272 273 public async Task RecalculateAsync(bool updateOnFinish = true, bool resetYAxis = true) {274 if (IsDisposed275 || sharedFixedVariables == null || !solutions.Any() || string.IsNullOrEmpty(freeVariable)276 || trainingMin.IsAlmost(trainingMax) || trainingMin > trainingMax || drawingSteps == 0)277 return;278 279 calculationPendingTimer.Start();280 281 Update(); // immediately show label282 283 // cancel previous recalculate call284 if (cancelCurrentRecalculateSource != null)285 cancelCurrentRecalculateSource.Cancel();286 cancelCurrentRecalculateSource = new CancellationTokenSource();287 288 269 // Set cursor and x-axis 289 270 // Make sure to allow a small offset to be able to distinguish the vertical line annotation from the axis … … 302 283 chart.ChartAreas[0].AxisX.Title = FreeVariable + " : " + defaultValue.ToString("N3", CultureInfo.CurrentCulture); 303 284 285 ResizeAllSeriesData(); 286 OrderAndColorSeries(); 287 } 288 289 public async Task RecalculateAsync(bool updateOnFinish = true, bool resetYAxis = true) { 290 if (IsDisposed 291 || sharedFixedVariables == null || !solutions.Any() || string.IsNullOrEmpty(freeVariable) 292 || trainingMin.IsAlmost(trainingMax) || trainingMin > trainingMax || drawingSteps == 0) 293 return; 294 295 calculationPendingTimer.Start(); 296 297 // cancel previous recalculate call 298 if (cancelCurrentRecalculateSource != null) 299 cancelCurrentRecalculateSource.Cancel(); 300 cancelCurrentRecalculateSource = new CancellationTokenSource(); 301 var cancellationToken = cancelCurrentRecalculateSource.Token; 302 304 303 // Update series 305 var cancellationToken = cancelCurrentRecalculateSource.Token;306 304 try { 307 305 var limits = await UpdateAllSeriesDataAsync(cancellationToken); 308 //cancellationToken.ThrowIfCancellationRequested();309 306 310 307 yMin = limits.Lower; … … 453 450 if (yvalues[i] > max) max = yvalues[i]; 454 451 } 452 chart.Invalidate(); 453 454 cancellationToken.ThrowIfCancellationRequested(); 455 455 456 456 var confidenceBoundSolution = solution as IConfidenceRegressionSolution; 457 457 if (confidenceBoundSolution != null) { 458 458 var confidenceIntervalSeries = ciSeriesCache[solution]; 459 460 cancellationToken.ThrowIfCancellationRequested(); 461 var variances = 462 confidenceBoundSolution.Model.GetEstimatedVariances(internalDataset, 463 Enumerable.Range(0, internalDataset.Rows)).ToList(); 459 var variances = confidenceBoundSolution.Model.GetEstimatedVariances(internalDataset, Enumerable.Range(0, internalDataset.Rows)).ToList(); 464 460 for (int i = 0; i < xvalues.Count; i++) { 465 461 var lower = yvalues[i] - 1.96 * Math.Sqrt(variances[i]); … … 469 465 if (upper > max) max = upper; 470 466 } 467 chart.Invalidate(); 471 468 } 472 469 … … 619 616 620 617 e.NewLocationX = newLocation; 621 var annotation = VerticalLineAnnotation; 622 var x = annotation.X; 618 619 UpdateCursor(); 620 } 621 private void chart_AnnotationPositionChanged(object sender, EventArgs e) { 622 UpdateCursor(); 623 } 624 void UpdateCursor() { 625 var x = VerticalLineAnnotation.X; 623 626 sharedFixedVariables.SetVariableValue(x, FreeVariable, 0); 624 627 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/GradientChartConfigurationDialog.cs
r14099 r14118 51 51 private async void okButton_Click(object sender, System.EventArgs e) { 52 52 try { 53 Enabled = false; 53 54 chart.SuspendRepaint(); 54 55 if (xAutomaticCheckBox.Checked) { … … 82 83 } 83 84 finally { 85 Enabled = true; 84 86 chart.ResumeRepaint(true); 85 87 }
Note: See TracChangeset
for help on using the changeset viewer.