tx
8 天以前 e0b138b3e057de6f57021e6c8963868f5c5acc5a
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
 
 
namespace TProduct.WinFrmUI.TPump
{
    /// <summary>
    /// 性能测试
    /// </summary>
    public partial class NpshTestIngMainPage
    {
        private void IntialPartInfoCtrl()
        {
            if (_partInfoCtrl == null)
            {
                this._partInfoCtrl = new TProduct.WinFrmUI.TPump.PartInfoCtrl();
 
                this._partInfoCtrl.Appearance.BackColor = System.Drawing.SystemColors.Control;
                this._partInfoCtrl.Appearance.Options.UseBackColor = true;
                this._partInfoCtrl.Dock = System.Windows.Forms.DockStyle.Fill;
                this._partInfoCtrl.Location = new System.Drawing.Point(0, 0);
                this._partInfoCtrl.Name = "PartInfoCtrl";
 
                this._partInfoCtrl.Size = new System.Drawing.Size(967, 555);
                //this._partInfoCtrl.SurfaceGuid = null;
                this._partInfoCtrl.TabIndex = 0;
                this._partInfoCtrl.OnChangeMotorInfo += (motor ) =>
                {
                    if (_currentMotor == null)
                        return;
                    this._currentMotor = motor;
                    var rated_motor = TProduct.Model.RatedParas4Motor.ToModel(_currentMotor.RatedParas);
 
                    if (theCalcDataDlg != null)
                        theCalcDataDlg.SetMotorInfo(rated_motor.E_Self, motor.EtaCurve);
 
                    if (this._linkHelper != null)
                    {
                        this._linkHelper.ResetProductInfo(this._currentPump, this._currentMotor);
                    }
 
                    var bllMtor = new BLL.ProductMain();
                    new BLL.ProductMotor().UpdateEx(_currentMotor);
 
                    if (OnChangeProductInfo != null)
                    {
                        OnChangeProductInfo(this._currentPump, _currentMotor);
                    }
                };
                this._partInfoCtrl.OnChangeElectricInfo += (eleInfo) =>
                {
                    if (eleInfo == null)
                        return;
 
                    if (this._linkHelper != null)
                    {
                        this._linkHelper.ResetElectricInfo(eleInfo);
                        this._testItem.ElectricInfo = eleInfo;
                        new BLL.TestProjectItem().Update(new Model.TestProjectItem(
                            this._testItem));
                    }
                };
                this._partInfoCtrl.OnChangeRatedParas += (rateParas) =>
                {
                    if (rateParas != this._ratedParas.ToJson())
                    {
                        this._ratedParas = Model.RatedParas4Pump.ToModel(rateParas);
                        this._currentPump.RatedParas = _ratedParas.ToJson();
                        //this._chartMainCtrl.RefreshRatedParas(this._ratedParas, this._testJudgeItems);
                        new BLL.ProductMain().UpdateRatedParas(_currentPump.ID, rateParas);
 
                        if (OnChangeProductInfo != null)
                        {
                            OnChangeProductInfo(this._currentPump, _currentMotor);
                        }
                    }
                };
 
                this.tabPagePartInfo.Controls.Add(this._partInfoCtrl);
            }
            if (_currentPump.MotorMainID.HasValue && _currentPump.MotorMainID > 0)
            {
                _currentMotor = new BLL.ProductMotor().GetExByProductID((long)_currentPump.MotorMainID);
            }
 
            this._partInfoCtrl.SetBindingData(
                this._currentPump,
                this._currentMotor,
                this._currentPart,
                this._testItem.ElectricInfo);
        }
 
        //TProduct.WinFrmUI.TBase.ProductTestBimfaceCtrl _model3dCtrl = null;
        private void InitialModel3d()
        {
            if (string.IsNullOrEmpty(_workBenchInfo.Model3dPath))
            {
                this.tabPage3D.PageVisible = false;
                return;
            }
            if (!TProduct.UserSetting.Setting.Disp.IsShowModel3d)
            {
                this.tabPage3D.PageVisible = false;
                return;
            }
 
            //if (_model3dCtrl == null)
            //{
            //    _model3dCtrl = new TProduct.WinFrmUI.TBase.ProductTestBimfaceCtrl();
            //    _model3dCtrl.Dock = DockStyle.Fill;
            //    _model3dCtrl.Name = "PumpTestBimfaceViewCtrl";
            //    _model3dCtrl.Padding = new Padding(0);
            //    string error_info;
            //    var url = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Model3d", _workBenchInfo.Model3dPath);
            //    if (_model3dCtrl.SetBindingData(url, out error_info) == false)
            //    {
            //        this.tabPage3D.PageVisible = false;
            //        MessageBox.Show(error_info);
            //        return;
            //    }
 
            //    this.tabPage3D.Controls.Add(_model3dCtrl);
            //}
        }
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barBtn测试台测点_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            TProduct.WinFrmUI.TestBench.ListWorkBenchMonitorPointDlg frm = new TProduct.WinFrmUI.TestBench.ListWorkBenchMonitorPointDlg();
            frm.SetBindingData(this._workBenchInfo);
            frm.Show();
        }
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barBtn测试台仪表_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var frm = new TProduct.WinFrmUI.TPump.ViewWorkBenchInfoDlg();
            frm.SetBindingData(this._workBenchInfo, this._testItem);
            frm.Show();
        }
    }
}