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
using System;
using System.ComponentModel.DataAnnotations;
using TProduct.Model;
 
namespace TProduct.WinFrmUI.Data4Owner
{
    public class MotorExcelImportHelper
    {
        public MotorExcelImportHelper() { }
 
        public MotorExcelImportHelper(MotorExcelImportHelper obj)
        {
            this.Name = obj.Name;
            this.RatedPower = obj.RatedPower;
            this.PowerFactor = obj.PowerFactor;
            this.RatedI = obj.RatedI;
            this.RatedU = obj.RatedU;
            this.Ratedn = obj.Ratedn;
            this.PhaseNum = obj.PhaseNum;
            this.E_Self = obj.E_Self;
            this.E_PLC = obj.E_PLC;
            this.IsFrequency = obj.IsFrequency;
        }
        public Model.ProductMainExMotor GetMotor(string Name, string RatedPower, string PowerFactor, string RatedI, string RatedU, string Ratedn, string PhaseNum, string E_Self, string E_PLC, string IsFrequency)
        {
            var model = new Model.ProductMainExMotor();
            model.Name = Name;
            if (!string.IsNullOrEmpty(RatedPower))
            {
                model.RatedPower = Convert.ToDouble(RatedPower);
            }
            else
            {
                model.RatedPower = -1;
            }
 
            if (!string.IsNullOrEmpty(PowerFactor))
            {
                model.PowerFactor = Convert.ToDouble(PowerFactor);
            }
            else
            {
                model.PowerFactor = -1;
            }
            if (!string.IsNullOrEmpty(RatedI))
            {
                model.RatedI = Convert.ToDouble(RatedI);
            }
            else
            {
                model.RatedI = -1;
            }
 
            if (!string.IsNullOrEmpty(RatedU))
            {
                model.RatedU = Convert.ToDouble(RatedU);
            }
            else
            {
                model.RatedU = -1;
            }
 
            if (!string.IsNullOrEmpty(Ratedn))
            {
                model.Ratedn = Convert.ToDouble(Ratedn);
            }
            else
            {
                model.Ratedn = -1;
            }
 
            if (!string.IsNullOrEmpty(PhaseNum))
            {
                model.PhaseNum = (Model.eSupplyCurrentPhase)(Convert.ToInt32(PhaseNum) == 1 ? 1 : 2);
            }
            else
            {
                model.PhaseNum = Model.eSupplyCurrentPhase.三相;
            }
 
            RatedParas4Motor ratedparas_motor = new RatedParas4Motor();
            if (!string.IsNullOrEmpty(E_Self))
            {
                ratedparas_motor.E_Self = Convert.ToDouble(E_Self);
            }
            if (string.IsNullOrEmpty(E_Self))
            {
                ratedparas_motor.E_Self = -1;
            }
            if (!string.IsNullOrEmpty(E_PLC))
            {
                ratedparas_motor.E_PLC = Convert.ToDouble(E_PLC);
            }
            if (string.IsNullOrEmpty(E_PLC))
            {
                ratedparas_motor.E_PLC = -1;
            }
 
            if (!string.IsNullOrEmpty(IsFrequency))
            {
                ratedparas_motor.IsFrequency = Convert.ToInt32(IsFrequency) == 0 ? false : true;
            }
 
            if (string.IsNullOrEmpty(IsFrequency))
            {
                ratedparas_motor.IsFrequency = false;
            }
 
            model.RatedParas = ratedparas_motor.ToJson();
            return model;
        }
 
        /// <summary>
        /// 名称
        /// </summary>
        [Display(Name = "名称")]
        public string Name { get; set; }
        /// <summary>
        /// 额定功率kW
        /// </summary>
        [Display(Name = "功率kW")]
        public string RatedPower { get; set; }
 
        /// <summary>
        /// 功率因子
        /// </summary>
        [Display(Name = "功率因子")]
        public string PowerFactor { get; set; }
 
        /// <summary>
        /// 额定电流A
        /// </summary>
        [Display(Name = "电流A")]
        public string RatedI { get; set; }
 
        /// <summary>
        /// 额定电压U
        /// </summary>
        [Display(Name = "电压U")]
        public string RatedU { get; set; }
 
        /// <summary>
        /// 额定转速
        /// </summary>
        [Display(Name = "转速")]
        public string Ratedn { get; set; }
 
        /// <summary>
        /// 三相或者单相(3或者1)
        /// </summary>
        [Display(Name = "三相或者单相(3或者1)")]
        public string PhaseNum { get; set; }
 
        /// <summary>
        /// 电机效率
        /// </summary>
        [Display(Name = "电机效率")]
        public string E_Self { get; set; }
 
        /// <summary>
        /// 变频器效率
        /// </summary>
        [Display(Name = "变频器效率")]
        public string E_PLC { get; set; }
 
        /// <summary>
        /// 是否变频
        /// </summary>
        [Display(Name = "是否变频")]
        public string IsFrequency { get; set; }
    }
}