-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUcFilter.cs
More file actions
70 lines (55 loc) · 1.83 KB
/
UcFilter.cs
File metadata and controls
70 lines (55 loc) · 1.83 KB
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
namespace UM_Monitor
{
using System.Windows.Forms;
public partial class UcFilter : UserControl
{
FilterConfig fc;
public UcFilter()
{
InitializeComponent();
this.initFilterconfig();
}
public void initFilterconfig()
{
this.fc = new FilterConfig(this.dateTimePicker1, this.dateTimePicker2);
switch (fc.mode)
{
case FilterConfig.FcMode.fromto:
this.radioButton3.Checked = true;
break;
case FilterConfig.FcMode.lastxseconds:
this.radioButton2.Checked = true;
break;
default:
this.radioButton1.Checked = true;
break;
}
this.numericUpDown1.Value = fc.seconds;
}
public FilterConfig GetFilterConfig()
{
return this.fc;
}
private void numericUpDown1_ValueChanged(object sender, System.EventArgs e)
{
if (this.fc != null)
this.fc.seconds = (int)this.numericUpDown1.Value;
}
private void radioButton1_CheckedChanged(object sender, System.EventArgs e)
{
if (this.fc != null && this.radioButton1.Checked)
this.fc.mode = FilterConfig.FcMode.all;
}
private void radioButton2_CheckedChanged(object sender, System.EventArgs e)
{
if (this.fc != null && this.radioButton2.Checked)
this.fc.mode = FilterConfig.FcMode.lastxseconds;
}
private void radioButton3_CheckedChanged(object sender, System.EventArgs e)
{
if (this.fc != null && this.radioButton3.Checked)
this.fc.mode = FilterConfig.FcMode.fromto;
}
}
}