duheng
2025-03-20 1ec65a7b983a7d519c3602d20a855ac1bac1825e
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
namespace PBS.WinFrmUI.Hydro
{
    public partial class PumpCtrl : DevExpress.XtraEditors.XtraUserControl, IPlaceInfo
    {
        public PumpCtrl()
        {
            InitializeComponent();
        }
 
        private Model.Pump _model = null;
 
        public void Set(string paras)
        {
            _model = Model.Pump.ToModel(paras);
            if (_model == null)
                _model = new Model.Pump();
 
            this.QrTextEdit.EditValue = _model.Qr;
            this.HrTextEdit.EditValue = _model.Hr;
            this.NrTextEdit.EditValue = _model.Nr;
            this.PrTextEdit.EditValue = _model.Pr;
            this.ErTextEdit.EditValue = _model.Er;
            this.NPSHrTextEdit.EditValue = _model.NPSHr;
            this.StNumrTextEdit.EditValue = _model.StNumr;
            this.IcTextEdit.EditValue = _model.Ic;
            this.OcTextEdit.EditValue = _model.Oc;
            this.IOdTextEdit.EditValue = _model.IOd;
            this.IeTextEdit.EditValue = _model.Ie;
            this.OeTextEdit.EditValue = _model.Oe;
 
            this.IsBpCheckEdit.Checked = _model.IsBp;
            this.IsSxpCheckEdit.Checked = _model.IsSxp;
 
        }
 
        public bool Valid()
        {
            return true;
        }
 
        public string Get()
        {
            _model.Qr = Convert.ToDouble(this.QrTextEdit.EditValue);
            _model.Hr = Convert.ToDouble(this.HrTextEdit.EditValue);
            _model.Nr = Convert.ToDouble(this.NrTextEdit.EditValue);
            _model.Pr = Convert.ToDouble(this.PrTextEdit.EditValue);
            _model.Er = Convert.ToDouble(this.ErTextEdit.EditValue);
            _model.NPSHr = Convert.ToDouble(this.NPSHrTextEdit.EditValue);
            _model.StNumr = Convert.ToInt32(this.StNumrTextEdit.EditValue);
 
            if (this.IcTextEdit.EditValue == null)
                _model.Ic = null;
            else
                _model.Ic = Convert.ToDouble(this.IcTextEdit.EditValue);
 
            if (this.OcTextEdit.EditValue == null)
                _model.Oc = null;
            else
                _model.Oc = Convert.ToDouble(this.OcTextEdit.EditValue);
 
            if (this.IOdTextEdit.EditValue == null)
                _model.IOd = null;
            else
                _model.IOd = Convert.ToDouble(this.IOdTextEdit.EditValue);
 
            if (this.IeTextEdit.EditValue == null)
                _model.Ie = null;
            else
                _model.Ie = Convert.ToDouble(this.IeTextEdit.EditValue);
 
            if (this.OeTextEdit.EditValue == null)
                _model.Oe = null;
            else
                _model.Oe = Convert.ToDouble(this.OeTextEdit.EditValue);
 
            _model.IsBp = this.IsBpCheckEdit.Checked;
            _model.IsSxp = this.IsSxpCheckEdit.Checked;
 
            return _model.ToJson();
        }
    }
}