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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace TProduct.Model 
{
   
        public static class MeasureTypeHelper
        {
            public static void InitialDispContrl(System.Windows.Forms.ComboBox ctrl)
            {
                eMeasureType instrumentType = eMeasureType.出口压力;
                Array typeData = Enum.GetValues(instrumentType.GetType());
                for (int i = 0; i < typeData.Length; i++)
                {
                    ctrl.Items.Add(typeData.GetValue(i));
                }
                ctrl.SelectedIndex = -1;
            }
 
            public static void InitialDispContrl(System.Windows.Forms.ListBox ctrl)
            {
                eMeasureType instrumentType = eMeasureType.出口压力;
                Array typeData = Enum.GetValues(instrumentType.GetType());
                for (int i = 0; i < typeData.Length; i++)
                {
                    ctrl.Items.Add(typeData.GetValue(i));
                }
                ctrl.SelectedIndex = -1;
            }
            //public static void InitialDispContrl(DevExpress.XtraEditors.ComboBoxEdit ctrl)
            //{
            //    eMeasureType instrumentType = eMeasureType.出口压力;
            //    Array typeData = Enum.GetValues(instrumentType.GetType());
            //    for (int i = 0; i < typeData.Length; i++)
            //    {
            //        ctrl.Properties.Items.Add(typeData.GetValue(i));
            //    }
            //    ctrl.SelectedIndex = -1;
            //}
 
            public static int GetMeasureType(string type)
            {
                if (string.IsNullOrEmpty(type))
                    return 0;
                switch (type)
                {
                    case "出口压力":
                        return (int)eMeasureType.出口压力;
                    case "进口压力":
                        return (int)eMeasureType.进口压力;
                    case "进出口压差":
                        return (int)eMeasureType.进出口压差;
                    case "流量":
                        return (int)eMeasureType.流量;
                    case "转速":
                        return (int)eMeasureType.转速;
                    case "功率":
                        return (int)eMeasureType.功率;
                    case "电流A":
                        return (int)eMeasureType.相电流A;
                    case "电流B":
                        return (int)eMeasureType.相电流B;
                    case "电流C":
                        return (int)eMeasureType.相电流C;
                    case "平均电流":
                        return (int)eMeasureType.平均相电流;
                    case "电压A":
                        return (int)eMeasureType.相电压A;
                    case "电压B":
                        return (int)eMeasureType.相电压B;
                    case "电压C":
                        return (int)eMeasureType.相电压C;
                    case "平均电压":
                        return (int)eMeasureType.平均相电压;
                    case "扭矩":
                        return (int)eMeasureType.扭矩;
                    case "电阻":
                        return (int)eMeasureType.电阻;
                    case "定子绕组温度":
                        return (int)eMeasureType.定子绕组温度;
                    case "轴温":
                        return (int)eMeasureType.轴温;
                    case "介质温度":
                        return (int)eMeasureType.介质温度;
                    default:
                        return 0;
 
                }
 
            }
        }
 
    
}