tx
2025-04-10 2538101febc78f525945da72c7cdcb2589f9e6ea
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
using System;
using System.Collections.Generic;
using TProduct.Model;
 
namespace TProduct.WinFrmUI.TPump
{
    public class CalcFeatTestBaseDlg : TProduct.WinFrmUI.TBase.CalcBaseDlg
    {
        public CalcFeatTestBaseDlg() : base()
        {
        }
        public Action<TProduct.Model.PumpFeatTestRecordViewModel, int> OnSaveRecord = null;
 
        public virtual bool NewTestRecord(
            List<TProduct.Model.MonitorPointValuePure> valueList, bool isAutoCalc)
        {
            return false;
        }
        public virtual bool NewTestRecord4Save(
            List<TProduct.Model.MonitorPointValuePure> valueList )
        {
            return false;
        }
        public virtual void EditTestRecord(TProduct.Model.PumpFeatTestRecordViewModel record)
        {
        }
 
        public virtual void InitialMonitorInfo(List<TProduct.Model.WorkBenchMonitorPoint> allMonitorList)
        {
        }
 
        protected TProduct.Model.TestProjectParas _testParas = null;
        protected bool _isTemperatureTrn = false; //是否温度换算
        protected double _atmospherePressure = 101.3;//大气压
        protected double _elevation = 100;//海拔高度
        protected TProduct.Model.ePowerTestMethod _powerTestMethod = Model.ePowerTestMethod.功率;
        protected bool _isInlet清水池 = false;
 
        internal void SetTestInfo(
            TProduct.Model.WorkBenchBase bench,
            TProduct.Model.TestProjectItemView testItem)
        {
            if (bench == null || testItem == null)
                return;
            this._testItemID = testItem.ItemID;
            this._testItem = testItem;
 
 
            this._testParas = testItem.ProjectParas;
            this._isTemperatureTrn = _testParas.IsTemperatureTrn;
            if (this._testParas.SpeedSimuMethod != null)
            {
                this._speedSimuMethod = _testParas.SpeedSimuMethod.Value;
            }
 
 
            var method = new Model.WorkBenchMethod4Pump(bench.TestMethod);
            if (method.Power != null)
            {
                _powerTestMethod = method.Power.Value;
                _isInlet清水池 = method.InletIsUseWaterLevel == 1 ? true : false;
            }
 
            var bench_setting = new TProduct.Model.WorkBenchSetting4Pump(bench.TestSetting);
            this._elevation = bench_setting.Elevation;
            this._atmospherePressure = bench_setting.AtmosphericPressure;
        }
 
        /// <summary>
        /// 
        /// </summary>
        protected double _motorRatedEta = 100;
        protected double _pumpRatedN = 2900;
        protected TProduct.Model.eSpeedSimuMethod _speedSimuMethod = eSpeedSimuMethod.转速换算;//是否转速换算到额定转速
        protected TProduct.Model.RatedParas4Pump _pumpRatedParas = null;
        protected TProduct.Model.eSupplyCurrentType _supplyCurrentType = eSupplyCurrentType.交流;
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ratedN"></param>
        /// <param name="ratedParas"></param>
        internal virtual void SetPumpInfo(TProduct.Model.ProductSeries series,TProduct.Model.ProductMainExPump pump)
        {
            if (pump == null || pump.Ratedn == null)
            {
                _speedSimuMethod = eSpeedSimuMethod.不换算; return;
            }
          
            if (string.IsNullOrEmpty(pump.RatedParas))
            {
                _speedSimuMethod = eSpeedSimuMethod.不换算; return;
            }
            this._pumpRatedN = pump.Ratedn.Value;
            this._pumpRatedParas = TProduct.Model.RatedParas4Pump.ToModel(pump.RatedParas);
            this._supplyCurrentType = _pumpRatedParas.CurrentType;
 
            if(this._testParas != null)
            {
                if (this._testParas.SpeedSimuMethod == null)
                {
                    if (series != null && series.Paras != null)
                    {
                        _speedSimuMethod = series.Paras.SpeedSimuMethod;
                    }
                }
                else if (this._testParas.SpeedSimuMethod ==  eSpeedSimuMethod.不换算)
                {
                    _speedSimuMethod = eSpeedSimuMethod.不换算;
                } 
            }
             
        }
 
        /// <summary>
        /// 设置电机参数
        /// </summary>
        /// <param name="ratedEta"></param>
        /// <param name="eatCurve"></param>
        public virtual void SetMotorInfo(TProduct.Model.ProductMainExMotor motor)
        {
        }
 
        /// <summary>
        /// 设置阀门开度
        /// </summary>
        /// <param name="prop"></param>
        /// <param name="paras"></param>
        /// <returns></returns>
        public virtual void SetValveDegree(string prop, double paras)
        {
 
        }
        /// <summary>
        /// 外部修改了电机效率, 刷新数据
        /// </summary>
        /// <param name="eta"></param>
        public virtual bool RefreshMotorEta(double eta)
        {
            return true;
        }
 
        /// <summary>
        /// 外部修改了额定转速, 刷新数据
        /// </summary>
        /// <param name="eta"></param>
        public virtual bool RefreshRatedn(double speed)
        {
            this._pumpRatedN = speed;   
            return true;
        }
    }
}