tx
2025-04-09 fa7510e1ed63df0366787fa4ed1b3db6426d2b46
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
using System;
 
namespace TProduct.WinFrmUI.TValve
{
    public partial class SetValveCoordinateDlg : DevExpress.XtraEditors.XtraForm
    {
        public event Action<TProduct.Model.ValveCoordinateParas> OnChangedCoord = null;
 
        private TProduct.Model.ValveCoordinateParas _coordinateParas = null;
        public TProduct.Model.ValveCoordinateParas CoordinateParas { get { return _coordinateParas; } set { _coordinateParas = value; } }
 
 
 
        public void SetCoordinate(TProduct.Model.ValveCoordinateParas coordinateParas)
        {
 
            this._coordinateParas = coordinateParas;
 
        }
 
 
        public SetValveCoordinateDlg()
        {
            InitializeComponent();
            this.btnSet.SetCancelButtonColor();
            this.btnClose.SetCancelButtonColor();
        }
 
        private void LoadWindow(object sender, EventArgs e)
        {
            if (_coordinateParas == null)
                return;
 
 
 
            //流量刻度间隔数
            //textGridNumberX.Text = _coordinateParas.GridSpaceNumberX.ToString();
            //textGridNumberY.Text = _coordinateParas.GridSpaceNumberY.ToString();
            //textGridNumberX.Enabled = true;
 
            //textMinDispX.Text = _coordinateParas.CoordMinX.ToString();
            //textCoordSpaceX.Text = _coordinateParas.CoordSpaceX.ToString();
 
 
 
 
            //textStartLineNoKv.Text = _coordinateParas.StartLineNoKv.ToString();
            //textEndLineNoKv.Text = _coordinateParas.EndLineNoKv.ToString();
 
            //textMaxDispKv.Text = (_coordinateParas.CoordMinKv + _coordinateParas.EndLineNoKv * _coordinateParas.CoordSpaceKv).ToString();
            //textCoordSpaceKv.Text = _coordinateParas.CoordSpaceKv.ToString();
 
 
 
 
 
            //textEndLineNoRc.Text = _coordinateParas.EndLineNoRc.ToString();
            //textStartLineNoRc.Text = _coordinateParas.StartLineNoRc.ToString();
            //textCoordSpaceRc.Text = _coordinateParas.CoordSpaceRc.ToString();
            //textMaxDispRc.Text = (_coordinateParas.CoordMinRc + _coordinateParas.EndLineNoRc * _coordinateParas.CoordSpaceRc).ToString();
 
 
 
 
 
 
        }
 
 
 
        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
 
        private void btnSet_Click(object sender, EventArgs e)
        {
            if (OnChangedCoord == null || _coordinateParas == null)
                return;
 
            //double space = 0;
            //int start = 0, end = 0, num = 0;
            //double maxValue = 0;
 
 
 
            //if (!double.TryParse(textCoordSpaceX.Text, out space))
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
            //    return;
            //}
            //if (space < 0.01)
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("刻度值过小,请重新调整"));
            //    return;
            //}
 
            //if (!int.TryParse(textGridNumberX.Text, out num))
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString(" 刻度数请输入合理值"));
            //    return;
            //}
            //_coordinateParas.GridSpaceNumberX = num;
 
            //if (!int.TryParse(textGridNumberY.Text, out num))
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString(" 刻度数请输入合理值"));
            //    return;
            //}
            //_coordinateParas.GridSpaceNumberY = num;
 
 
 
            //double CoordMinX = 0;
            //double.TryParse(textMinDispX.Text, out CoordMinX);
 
 
 
            //_coordinateParas.CoordMinX = CoordMinX;
            //_coordinateParas.CoordSpaceX = space;
 
 
 
 
 
 
 
            //if (!int.TryParse(textStartLineNoKv.Text, out start))
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("扬程刻度数请输入合理值"));
            //    return;
            //}
            //if (!int.TryParse(textEndLineNoKv.Text, out end))
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("扬程刻度数请输入合理值"));
            //    return;
            //}
            //if (start >= end - 1)
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("扬程刻度设置不合理"));
            //    return;
            //}
            //if (!double.TryParse(textCoordSpaceKv.Text, out space))
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
            //    return;
            //}
 
 
            //if (!double.TryParse(textMaxDispKv.Text, out maxValue))
            //{
            //    XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
            //    return;
            //}
 
            //_coordinateParas.StartLineNoKv = start;
            //_coordinateParas.EndLineNoKv = end;
 
            //_coordinateParas.CoordSpaceKv = space;
            //_coordinateParas.CoordMinKv = maxValue - _coordinateParas.EndLineNoKv * space;
 
 
 
 
 
 
            //if (groupBoxE.Visible)
            //{
            //    if (!int.TryParse(textEndLineNoRc.Text, out end))
            //    {
            //        XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("效率刻度数请输入合理值"));
            //        return;
            //    }
            //    if (!int.TryParse(textStartLineNoRc.Text, out start))
            //    {
            //        XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("效率刻度数请输入合理值"));
            //        return;
            //    }
            //    if (start >= end - 1)
            //    {
            //        XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("Rc刻度设置不合理"));
            //        return;
            //    }
            //    if (!double.TryParse(textCoordSpaceRc.Text, out space))
            //    {
            //        XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
            //        return;
            //    }
            //    if (space < 0.001)
            //    {
            //        XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("刻度值过小,请重新调整"));
            //        return;
            //    }
            //    if (!double.TryParse(textMaxDispRc.Text, out maxValue))
            //    {
            //        XtraMessageBox.Show(TProduct.UserSetting.Localization.TranslateHelper.GetString("请输入合理值"));
            //        return;
            //    }
            //    _coordinateParas.CoordSpaceRc = space;
            //    _coordinateParas.StartLineNoRc = start;
            //    _coordinateParas.EndLineNoRc = end;
            //    _coordinateParas.CoordMinRc = maxValue - _coordinateParas.EndLineNoRc * _coordinateParas.CoordSpaceRc;
            //}
 
 
 
 
 
 
 
 
 
            //
            if (OnChangedCoord != null)
                OnChangedCoord(_coordinateParas);
        }
 
 
    }
}