lixiaojun
2022-08-17 d3024a7b50b35a8f24c1bfe0f13f4f86cc63a253
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
 
namespace IStation
{
    public class SignalType
    {
        public const string 瞬时流量 = "瞬时流量";
        public const string 累积流量 = "累积流量";
 
        public const string 压力 = "压力";
        public const string 水位 = "水位";
        public const string 扬程 = "扬程";
 
        public const string 视在功率 = "视在功率";
        public const string 有功功率 = "有功功率";
        public const string 无功功率 = "无功功率";
        public const string 功率因数 = "功率因数";
 
        public const string 频率 = "频率";
        public const string 转速 = "转速";
 
        public const string 有功电度 = "有功电度";
        public const string 无功电度 = "无功电度";
 
        public const string 运行状态 = "运行状态";
        public const string 运行时间 = "运行时间";
        public const string 开机次数 = "开机次数";
 
        public const string 电流 = "电流";
        public const string 电压 = "电压";
        public const string 电导率 = "电导率";
 
        public const string 效率 = "效率";
        public const string 千吨能耗 = "千吨能耗";
        public const string 单位能耗 = "单位能耗";
 
        public const string 阀门状态 = "阀门状态";
        public const string 阀门开度 = "阀门开度";
 
        public const string 温度 = "温度";
        public const string 浊度 = "浊度";
        public const string 余氯 = "余氯";
        public const string 湿度 = "湿度";
        public const string PH = "PH";
        public const string 溶解氧 = "溶解氧";
        public const string 音量 = "音量";
 
        public const string 加速度 = "加速度";
        public const string 速度 = "速度";
        public const string 振幅 = "振幅";
        public const string 位移 = "位移";
        public const string 波形数据包 = "波形数据包";
        public const string 恩普特振动配置包 = "恩普特振动配置包";
        public const string 乃尔振动配置包 = "乃尔振动配置包";
        public const string 航天801振动配置包 = "航天801振动配置包";
 
         
        /// <summary>
        /// 获取显示字典
        /// </summary>
        public static Dictionary<string, string> GetDisplayDict()
        {
            var dict = new Dictionary<string, string>();
            var type = typeof(SignalType);
            var flags = BindingFlags.Static | BindingFlags.Public;
            var fields = type.GetFields(flags);
            foreach (var item in fields)
            {
                dict.Add(item.GetValue(null).ToString(), item.Name);
            }
            return dict;
        }
 
        /// <summary>
        /// 获取显示名称
        /// </summary>
        public static string GetDisplayName(string identify)
        {
            Type type = typeof(SignalType);
            var flags = BindingFlags.Static | BindingFlags.Public;
            var fields = type.GetFields(flags);
            foreach (var item in fields)
            {
                if (item.GetRawConstantValue().ToString() == identify)
                    return item.Name;
            }
            return identify;
        } 
 
    }
}