-
Notifications
You must be signed in to change notification settings - Fork 1
/
VisualiseForm.cs
260 lines (183 loc) · 7.76 KB
/
VisualiseForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
using ArcGIS.Desktop.Framework.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;
namespace ArcSWAT3
{
public partial class VisualiseForm : Form
{
private Visualise _parent;
public VisualiseForm(Visualise parent) {
InitializeComponent();
this._parent = parent;
}
public void removeAnimationMode() {
this.animationMode.Visible = false;
this.composeOptions.Visible = false;
}
public void setCompare(bool enabled) {
this.compareGroup.Visible = enabled;
}
public ComboBox PscenariosCombo => this.scenariosCombo;
public ComboBox PoutputCombo => this.outputCombo;
public ComboBox PvariablePlot => this.variablePlot;
public TabControl PtabWidget => this.tabWidget;
public Timer Ptimer => this.timer;
public TextBox PobservedFileEdit => this.observedFileEdit;
public ComboBox PstartDay => this.startDay;
public ComboBox PfinishDay => this.finishDay;
public ComboBox PstartMonth => this.startMonth;
public ComboBox PfinishMonth => this.finishMonth;
public TextBox PstartYear => this.startYear;
public TextBox PfinishYear => this.finishYear;
public DataGridView PtableWidget => this.tableWidget;
public ComboBox PplotType => this.plotType;
public TextBox PresultsFileEdit => this.resultsFileEdit;
public ComboBox PvariableCombo => this.variableCombo;
public ComboBox PanimationVariableCombo => this.animationVariableCombo;
public ListBox PvariableList => this.variableList;
public ComboBox PsummaryCombo => this.summaryCombo;
public ComboBox PhruPlot => this.hruPlot;
public ComboBox PsubPlot => this.subPlot;
public RadioButton PcurrentAnimation => this.currentAnimation;
public RadioButton PprintAnimation => this.printAnimation;
public Label PdateLabel=> this.dateLabel;
public RadioButton PcanvasAnimation => this.canvasAnimation;
public RadioButton PlandscapeButton => this.landscapeButton;
public NumericUpDown PprintCount => this.printCount;
public GroupBox PcomposeOptions => this.composeOptions;
public NumericUpDown PcomposeCount => this.composeCount;
public TrackBar Pslider => this.slider;
public NumericUpDown PspinBox => this.spinBox;
public Button PrecordButton => this.recordButton;
public Button PplayButton => this.playButton;
public Label PcompareLabel => this.compareLabel;
public Label PrecordLabel => this.recordLabel;
private void scenariosCombo_SelectionChangeCommitted(object sender, EventArgs e) {
this._parent.setupDb();
}
private void outputCombo_SelectedChangeCommitted(object sender, EventArgs e) {
this._parent.setVariables();
}
private void PsummaryCombo_SelectionChangeCommitted(object sender, EventArgs e) {
this._parent.changeSummary();
}
private void addButton_Click(object sender, EventArgs e) {
this._parent.addClick();
}
private void allButton_Click(object sender, EventArgs e) {
this._parent.allClick();
}
private void delButton_Click(object sender, EventArgs e) {
this._parent.delClick();
}
private void clearbutton_Click(object sender, EventArgs e) {
this._parent.clearClick();
}
private void resultsFileButton_Click(object sender, EventArgs e) {
this._parent.setResultsFile();
}
private void tabWidget_SelectedIndexChanged(object sender, EventArgs e) {
this._parent.modeChange();
}
private void saveButton_Click(object sender, EventArgs e) {
this._parent.makeResults();
}
private void printButton_Click(object sender, EventArgs e) {
this._parent.printResults();
}
private void canvasAnimation_CheckedChanged(object sender, EventArgs e) {
this._parent.changeAnimationMode();
}
private void printAnimation_CheckedChanged(object sender, EventArgs e) {
this._parent.changeAnimationMode();
}
private void animationVariableCombo_SelectionChangeCommitted(object sender, EventArgs e) {
this._parent.setupAnimateLayer();
}
private void trackBar1_Scroll(object sender, EventArgs e) {
this._parent.changeAnimate();
}
private void trackBar1_MouseDown(object sender, MouseEventArgs e) {
this._parent.pressSlider();
}
private void playCommand_Click(object sender, EventArgs e) {
this._parent.doPlay();
}
private void pauseCommand_Click(object sender, EventArgs e) {
this._parent.doPause();
}
private void rewindCommand_Click(object sender, EventArgs e) {
this._parent.doRewind();
}
private void recordButton_Click(object sender, EventArgs e) {
this._parent.record();
}
private void playButton_Click(object sender, EventArgs e) {
this._parent.playRecording();
}
private void spinBox_ValueChanged(object sender, EventArgs e) {
this._parent.changeSpeed((int)spinBox.Value);
}
private void timer1_Tick(object sender, EventArgs e) {
this._parent.doStep();
}
private void subPlot_SelectionChangeCommitted(object sender, EventArgs e) {
this._parent.plotSetSub();
}
private void hruPlot_SelectionChangeCommitted(object sender, EventArgs e) {
this._parent.plotSetHRU();
}
private void variablePlot_SelectionChangeCommitted(object sender, EventArgs e) {
this._parent.plotSetVar();
}
private void addPlot_Click(object sender, EventArgs e) {
this._parent.doAddPlot();
}
private void deletePlot_Click(object sender, EventArgs e) {
this._parent.doDelPlot();
}
private void copyPlot_Click(object sender, EventArgs e) {
this._parent.doCopyPlot();
}
private void upPlot_Click(object sender, EventArgs e) {
this._parent.doUpPlot();
}
private void downPlot_Click(object sender, EventArgs e) {
this._parent.doDownPlot();
}
private void addObserved_Click(object sender, EventArgs e) {
this._parent.addObservedPlot();
}
private void observedFileButton_Click(object sender, EventArgs e) {
this._parent.setObservedFile(observedFileEdit.Text);
}
private void plotButton_Click(object sender, EventArgs e) {
this._parent.writePlotData();
}
private void closeButton_Click(object sender, EventArgs e) {
this._parent.doClose();
}
private void compareButton_Click(object sender, EventArgs e) {
this._parent.startCompareScenarios();
}
private void VisualiseForm_KeyUp(object sender, KeyEventArgs e) {
if (e.KeyValue == 39) { // right arrow
this._parent.animateStepRight();
} else if (e.KeyValue == 37) { // left arrow
this._parent.animateStepLeft();
}
}
private void slider_ValueChanged(object sender, EventArgs e) {
this._parent.changeAnimate();
}
}
}