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
| package com.qianwen.mdc.collect.enums;
|
| public enum WorkstationParamTypeEnum {
| OTHER(0, "其他"),
| STATE(1, "状态"),
| OUTPUT(2, "产量"),
| /**
| * 3-ALARM
| */
| ALARM(3, "报警"),
| PROGRAMNUM(4, "程序号"),
| PULSE_OUTPUT(5, "脉冲产量"),
| ALARM_NO(6, "报警号"),
| ALARM_MSG(7, "报警信息"),
| COUNT(8, "计数"),
| PLUSE(9, "脉冲");
|
| private final Integer type;
| private final String description;
|
| WorkstationParamTypeEnum(final Integer type, final String description) {
| this.type = type;
| this.description = description;
| }
|
| public Integer getType() {
| return this.type;
| }
|
| public String getDescription() {
| return this.description;
| }
|
| public static WorkstationParamTypeEnum of(Integer messageType) {
| if (messageType == null) {
| return null;
| }
| WorkstationParamTypeEnum[] values = values();
| for (WorkstationParamTypeEnum messageEnum : values) {
| if (messageEnum.type.equals(messageType)) {
| return messageEnum;
| }
| }
| return null;
| }
|
| public boolean isEqual(Integer type) {
| return this.type.equals(type);
| }
| }
|
|