Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/15/13 13:19:28 (11 years ago)
Author:
mkommend
Message:

#1837: Refactored sliding window analyzers and updated the provided algorithm.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SlidingWindowDataView.cs

    r7850 r9162  
    3232  public partial class SlidingWindowDataView : ItemView {
    3333    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
     34    private const string ESTIMATEDVAlUES_SERIES_NAME = "Estimated Values";
    3435
    3536    public new SlidingWindowData Content {
     
    5960    protected override void RegisterContentEvents() {
    6061      base.RegisterContentEvents();
    61       Content.SlidingWindowPosition.ValueChanged += new System.EventHandler(SlidingWindowPosition_ValueChanged);
     62      Content.SlidingWindowPosition.ValueChanged += new EventHandler(SlidingWindowPosition_ValueChanged);
     63      Content.EstimatedValuesChanged += new EventHandler(EstimatedValuesChanged);
    6264    }
    6365    protected override void DeregisterContentEvents() {
    64       Content.SlidingWindowPosition.ValueChanged -= new System.EventHandler(SlidingWindowPosition_ValueChanged);
     66      Content.SlidingWindowPosition.ValueChanged -= new EventHandler(SlidingWindowPosition_ValueChanged);
     67      Content.EstimatedValuesChanged -= new EventHandler(EstimatedValuesChanged);
    6568      base.DeregisterContentEvents();
    6669    }
     
    7174    }
    7275
    73     private void SlidingWindowPosition_ValueChanged(object sender, System.EventArgs e) {
     76    private void SlidingWindowPosition_ValueChanged(object sender, EventArgs e) {
    7477      if (InvokeRequired) Invoke((Action<object, EventArgs>)SlidingWindowPosition_ValueChanged, sender, e);
    7578      else UpdateStripLine();
     79    }
     80    private void EstimatedValuesChanged(object sender, EventArgs e) {
     81      if (InvokeRequired) Invoke((Action<object, EventArgs>)EstimatedValuesChanged, sender, e);
     82      else RedrawChart();
    7683    }
    7784
     
    8390      chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    8491      chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.TargetValues.ToArray());
     92
     93      if (Content.EstimatedValues.Any()) {
     94        chart.Series.Add(ESTIMATEDVAlUES_SERIES_NAME);
     95        chart.Series[ESTIMATEDVAlUES_SERIES_NAME].ChartType = SeriesChartType.FastLine;
     96        chart.Series[ESTIMATEDVAlUES_SERIES_NAME].Points.DataBindY(Content.EstimatedValues.ToArray());
     97      }
    8598
    8699      UpdateStripLine();
Note: See TracChangeset for help on using the changeset viewer.