@@ -14,6 +14,8 @@ public partial class DlgEditStats : Form
14
14
{
15
15
public Settings AppSettings ;
16
16
17
+ private bool NumericIgnoreUpdates = false ;
18
+
17
19
public DlgEditStats ( )
18
20
{
19
21
InitializeComponent ( ) ;
@@ -22,11 +24,14 @@ public DlgEditStats()
22
24
public DlgEditStats ( Settings settings ) : this ( )
23
25
{
24
26
AppSettings = settings ;
27
+ }
25
28
29
+ private void DlgEditStats_Load ( object sender , EventArgs e )
30
+ {
26
31
if ( AppSettings . YAxisIsPPM )
27
32
radioButton1 . Checked = true ;
28
33
if ( AppSettings . YAxisIsMV )
29
- radioButton1 . Checked = true ;
34
+ radioButton2 . Checked = true ;
30
35
if ( AppSettings . YAxisIsUV )
31
36
radioButton3 . Checked = true ;
32
37
@@ -35,6 +40,7 @@ public DlgEditStats(Settings settings) : this()
35
40
if ( AppSettings . HistoBinIsUV )
36
41
radioButton4 . Checked = true ;
37
42
43
+ NumericIgnoreUpdates = true ;
38
44
numericUpDown1 . Value = Convert . ToDecimal ( AppSettings . YAxisPPMperDiv ) ;
39
45
numericUpDown2 . Value = Convert . ToDecimal ( AppSettings . YAxisMVperDiv ) ;
40
46
numericUpDown3 . Value = Convert . ToDecimal ( AppSettings . YAxisUVPerDiv ) ;
@@ -43,9 +49,10 @@ public DlgEditStats(Settings settings) : this()
43
49
numericUpDown5 . Value = Convert . ToDecimal ( AppSettings . HistoBinInMV ) ;
44
50
45
51
numericUpDown6 . Value = Convert . ToDecimal ( AppSettings . SampleHistory ) ;
46
-
52
+ NumericIgnoreUpdates = false ;
47
53
}
48
54
55
+ // OK button
49
56
private void button4_Click ( object sender , EventArgs e )
50
57
{
51
58
AppSettings . YAxisIsPPM = false ;
@@ -85,6 +92,9 @@ private void button1_Click(object sender, EventArgs e)
85
92
AppSettings . YAxisIsUV = false ;
86
93
87
94
AppSettings . YAxisPPMperDiv = 10 ;
95
+
96
+ radioButton1 . Checked = true ;
97
+ numericUpDown1 . Value = Convert . ToDecimal ( 10 ) ;
88
98
}
89
99
90
100
// Set to 10 uV/div
@@ -96,6 +106,9 @@ private void button2_Click(object sender, EventArgs e)
96
106
97
107
AppSettings . YAxisUVPerDiv = 10 ;
98
108
109
+ radioButton3 . Checked = true ;
110
+ numericUpDown3 . Value = Convert . ToDecimal ( 10 ) ;
111
+
99
112
}
100
113
101
114
// Set histo to 10uV/bin
@@ -105,6 +118,39 @@ private void button3_Click(object sender, EventArgs e)
105
118
AppSettings . HistoBinIsUV = true ;
106
119
107
120
AppSettings . YAxisUVPerDiv = 10 ;
121
+
122
+ radioButton4 . Checked = true ;
123
+ numericUpDown4 . Value = Convert . ToDecimal ( 10 ) ;
124
+ }
125
+
126
+ private void numericUpDown1_ValueChanged ( object sender , EventArgs e )
127
+ {
128
+ if ( NumericIgnoreUpdates == false )
129
+ radioButton1 . Checked = true ;
130
+ }
131
+
132
+ private void numericUpDown2_ValueChanged ( object sender , EventArgs e )
133
+ {
134
+ if ( NumericIgnoreUpdates == false )
135
+ radioButton2 . Checked = true ;
136
+ }
137
+
138
+ private void numericUpDown3_ValueChanged ( object sender , EventArgs e )
139
+ {
140
+ if ( NumericIgnoreUpdates == false )
141
+ radioButton3 . Checked = true ;
142
+ }
143
+
144
+ private void numericUpDown5_ValueChanged ( object sender , EventArgs e )
145
+ {
146
+ if ( NumericIgnoreUpdates == false )
147
+ radioButton5 . Checked = true ;
148
+ }
149
+
150
+ private void numericUpDown4_ValueChanged ( object sender , EventArgs e )
151
+ {
152
+ if ( NumericIgnoreUpdates == false )
153
+ radioButton4 . Checked = true ;
108
154
}
109
155
}
110
156
}
0 commit comments