Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.cs @ 7183

Last change on this file since 7183 was 7183, checked in by gkronber, 12 years ago

#1081 implemented remaining metrics for time series prognosis solutions, added estimation limits fixed training and validation best solution analyzers, implemented overfitting analyzer.

File size: 2.9 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System.Windows.Forms;
23using HeuristicLab.Core;
24using HeuristicLab.Data;
25using HeuristicLab.MainForm;
26
27namespace HeuristicLab.Problems.DataAnalysis.Views {
28  [View("TimeSeriesPrognosisnSolution View")]
29  [Content(typeof(TimeSeriesPrognosisSolutionBase), false)]
30  public partial class TimeSeriesPrognosisSolutionView : DataAnalysisSolutionView {
31    public TimeSeriesPrognosisSolutionView() {
32      InitializeComponent();
33    }
34
35    public new TimeSeriesPrognosisSolutionBase Content {
36      get { return (TimeSeriesPrognosisSolutionBase)base.Content; }
37      set { base.Content = value; }
38    }
39
40    protected override void OnContentChanged() {
41      base.OnContentChanged();
42      if (Content != null) {
43        horizonTextBox.Text = Content.Horizon.ToString();
44      }
45    }
46
47    #region drag and drop
48    protected override void itemsListView_DragEnter(object sender, DragEventArgs e) {
49      validDragOperation = false;
50      if (ReadOnly) return;
51
52      var dropData = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
53      if (dropData is TimeSeriesPrognosisProblemData) validDragOperation = true;
54      else if (dropData is IValueParameter) {
55        var param = (IValueParameter)dropData;
56        if (param.Value is TimeSeriesPrognosisProblemData) validDragOperation = true;
57      }
58    }
59    #endregion
60
61    private void horizonTextBox_Validating(object sender, System.ComponentModel.CancelEventArgs e) {
62      int val;
63      if (int.TryParse(horizonTextBox.Text, out val)) {
64        e.Cancel = val <= 0 || val >= Content.ProblemData.TrainingPartition.End - Content.ProblemData.TrainingPartition.Start;
65      } else {
66        e.Cancel = true;
67      }
68    }
69
70    private void horizonTextBox_Validated(object sender, System.EventArgs e) {
71      int val;
72      int.TryParse(horizonTextBox.Text, out val);
73      Content.Horizon = val;
74    }
75
76    private void horizonTextBox_KeyDown(object sender, KeyEventArgs e) {
77      if (e.KeyCode == Keys.Enter) {
78        e.Handled = true;
79        this.Focus();
80      } else {
81        e.Handled = false;
82      }
83    }
84
85  }
86}
Note: See TracBrowser for help on using the repository browser.