1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2008 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 | using System;
|
---|
22 | using System.Collections.Generic;
|
---|
23 | using System.ComponentModel;
|
---|
24 | using System.Drawing;
|
---|
25 | using System.Data;
|
---|
26 | using System.Linq;
|
---|
27 | using System.Text;
|
---|
28 | using System.Windows.Forms;
|
---|
29 |
|
---|
30 | namespace HeuristicLab.GP.StructureIdentification {
|
---|
31 | public partial class VariableView : FunctionView {
|
---|
32 | public Variable Variable {
|
---|
33 | get {
|
---|
34 | return (Variable)Item;
|
---|
35 | }
|
---|
36 | set {
|
---|
37 | Item = value;
|
---|
38 | }
|
---|
39 | }
|
---|
40 | public VariableView()
|
---|
41 | : base() {
|
---|
42 | InitializeComponent();
|
---|
43 | }
|
---|
44 |
|
---|
45 | public VariableView(Variable variable)
|
---|
46 | : base() {
|
---|
47 | InitializeComponent();
|
---|
48 | Variable = variable;
|
---|
49 | }
|
---|
50 |
|
---|
51 | protected override void UpdateControls() {
|
---|
52 | base.UpdateControls();
|
---|
53 | minTimeOffsetTextBox.Text = Variable.MinTimeOffset.ToString();
|
---|
54 | maxTimeOffsetTextBox.Text = Variable.MaxTimeOffset.ToString();
|
---|
55 | }
|
---|
56 |
|
---|
57 | private void minTimeOffsetTextBox_TextChanged(object sender, EventArgs e) {
|
---|
58 | int minTimeOffset;
|
---|
59 | if (int.TryParse(minTimeOffsetTextBox.Text, out minTimeOffset)) {
|
---|
60 | Variable.MinTimeOffset = minTimeOffset;
|
---|
61 | functionPropertiesErrorProvider.SetError(minTimeOffsetTextBox, string.Empty);
|
---|
62 | } else {
|
---|
63 | functionPropertiesErrorProvider.SetError(minTimeOffsetTextBox, "Invalid value");
|
---|
64 | }
|
---|
65 | }
|
---|
66 |
|
---|
67 | private void maxTimeOffsetTextBox_TextChanged(object sender, EventArgs e) {
|
---|
68 | int maxTimeOffset;
|
---|
69 | if (int.TryParse(maxTimeOffsetTextBox.Text, out maxTimeOffset)) {
|
---|
70 | Variable.MaxTimeOffset = maxTimeOffset;
|
---|
71 | functionPropertiesErrorProvider.SetError(maxTimeOffsetTextBox, string.Empty);
|
---|
72 | } else {
|
---|
73 | functionPropertiesErrorProvider.SetError(maxTimeOffsetTextBox, "Invalid value");
|
---|
74 | }
|
---|
75 |
|
---|
76 | }
|
---|
77 | }
|
---|
78 | }
|
---|